/* The shop: shop.html, product.html and the cart drawer. Loaded after site.css.
   Front-counter colors (moon blue + balloon gold), same dark wall as the About page. */

.shop {
  min-height: 60vh;
  padding: clamp(32px, 5vw, 64px) 0 clamp(56px, 8vw, 104px);
  background: linear-gradient(180deg, var(--ink) 0%, var(--navy) 100%);
}

.shop-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.shop-bar h1 { font-size: clamp(2.2rem, 5.6vw, 3.8rem); }
.shop-bar .eyebrow a { color: inherit; text-decoration: none; }
.shop-bar .eyebrow a:hover { color: var(--accent); }
.cart-button { min-height: 42px; flex: none; }
.shop__lede { max-width: 56ch; margin-top: 14px; }

/* The scripts show and hide things with the hidden attribute; keep it winning over display rules. */
.shop [hidden] { display: none; }

.shop-status {
  margin-top: clamp(24px, 4vw, 40px);
  padding: 28px 0;
  color: var(--muted);
}
.shop-status a { color: var(--accent); }

.textlink {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.textlink[disabled] { opacity: 0.5; cursor: default; }

/* ---------- Grid ---------- */

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.6vw, 34px);
  list-style: none;
  margin: clamp(24px, 4vw, 40px) 0 0;
  padding: 0;
  transition: opacity 0.15s ease;
}
.shop-grid.is-loading { opacity: 0.55; }

.tile {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: start;
}

.tile__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-2);
}
.tile__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.tile:hover .tile__media img { transform: scale(1.03); }

.tile__ribbon {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tile__name {
  margin-top: 6px;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.15;
}
.tile__name a { color: inherit; text-decoration: none; }
.tile__name a:hover { color: var(--accent); }
.tile__price { font-family: var(--mono); font-size: 0.95rem; }
.tile__price s, .product__price s, .cart-line__price s { color: var(--muted); }
.tile__note { font-size: 0.85rem; color: var(--muted); }
.tile .btn { min-height: 42px; margin-top: 6px; }
.shop-more { margin-top: 28px; }

@media (max-width: 900px) { .shop-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .shop-grid { grid-template-columns: 1fr; } }

/* ---------- Product ---------- */

.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
  margin-top: clamp(20px, 3vw, 32px);
}

.product__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--ink-2);
}

.product__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.product__thumbs button {
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  background: none;
  cursor: pointer;
}
.product__thumbs button:hover, .product__thumbs button:focus-visible { border-color: var(--accent); }
.product__thumbs img { display: block; width: 64px; height: 80px; object-fit: cover; }

.product__body { display: grid; gap: 16px; }
.product__body h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.05; }
.product__price { font-family: var(--mono); font-size: 1.25rem; color: var(--accent); }
.product__buy { display: grid; gap: 16px; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.choices legend {
  width: 100%;
  margin-bottom: 8px;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.chip {
  min-width: 52px;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid rgba(242, 237, 230, 0.45);
  border-radius: 2px;
  background: none;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.9rem;
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.chip[disabled] { opacity: 0.35; text-decoration: line-through; cursor: not-allowed; }

.product__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.product__row .btn { flex: 1 1 200px; }
.product__row .btn[disabled] { cursor: not-allowed; }
.product__note { font-size: 0.92rem; color: var(--muted); }
.product__note--error { color: #ff8a8a; }
.product__description { padding-top: 18px; border-top: 1px solid var(--line); }
.product__description h2 { margin-top: 18px; font-size: 1.2rem; }

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid rgba(242, 237, 230, 0.45);
  border-radius: 2px;
}
.stepper button {
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--paper);
  font-size: 1.15rem;
  cursor: pointer;
}
.stepper button:hover { color: var(--accent); }
.stepper button[disabled] { opacity: 0.35; cursor: default; }
.stepper span { min-width: 30px; text-align: center; font-family: var(--mono); }

@media (max-width: 760px) { .product { grid-template-columns: 1fr; } }

/* ---------- Cart drawer ---------- */

.cart-open { overflow: hidden; }

.cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  background: rgba(5, 5, 8, 0.72);
}
.cart-backdrop[hidden] { display: none; }

.cart {
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  height: 100%;
  border-left: 1px solid var(--line);
  background: var(--ink-2);
  outline: none;
}

.cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.cart__head h2 { font-size: 1.5rem; }
.cart__close {
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--paper);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.cart__close:hover { color: var(--accent); }

.cart__error { margin: 14px 20px 0; padding: 10px 12px; border: 1px solid #ff8a8a; color: #ffb3b3; font-size: 0.92rem; }
.cart__lines { flex: 1; overflow-y: auto; padding: 6px 20px; }
.cart__empty { padding: 28px 0; color: var(--muted); }

.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.cart-line img, .cart-line__noimg { display: block; width: 64px; height: 80px; object-fit: cover; background: var(--ink); }
.cart-line__name { font-weight: 600; line-height: 1.25; }
.cart-line__meta { font-size: 0.86rem; color: var(--muted); }
.cart-line__warn { color: #ffb3b3; }
.cart-line__row { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.cart-line__row .stepper button { width: 36px; height: 36px; }
.cart-line__row .textlink { font-size: 0.86rem; }
.cart-line__price { font-family: var(--mono); font-size: 0.95rem; white-space: nowrap; }

.cart__foot { display: grid; gap: 12px; padding: 18px 20px 22px; border-top: 1px solid var(--line); }
.cart__foot:empty { display: none; }
.cart__totals { display: grid; gap: 6px; margin: 0; }
.cart__totals div { display: flex; justify-content: space-between; gap: 16px; }
.cart__totals dt { color: var(--muted); }
.cart__totals dd { margin: 0; font-family: var(--mono); font-size: 0.92rem; text-align: right; }
.cart__total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.cart__total dt { color: var(--paper); font-weight: 600; }
.cart__total dd { font-size: 1.05rem; color: var(--accent); }
.cart__checkout[disabled] { cursor: progress; }
.cart__fine { font-size: 0.8rem; color: var(--muted); text-align: center; }