/* The storefront (shop.html). Builds on the tokens and buttons in app.css, so light/dark mode and branding follow the rest of the site. */

.shop-page main { padding: 28px 0 8px; min-height: 60vh; }
.shop-page h1:focus { outline: none; }
.muted { color: var(--ink-3); font-weight: 500; }
.fine { color: var(--ink-3); font-size: 13px; line-height: 1.5; margin: 10px 0 0; }
.fine svg { vertical-align: -2px; }
.wide { width: 100%; }
.pre { white-space: pre-wrap; }

/* header cart + test banner */
.cart-link { position: relative; display: inline-grid; place-items: center; width: 42px; height: 40px; padding: 0 !important; }
.cart-count { position: absolute; top: 0; right: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--deal); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; }
.test-banner { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--line); text-align: center; padding: 8px 16px; font-size: 13.5px; font-weight: 650; }
.test-banner[hidden] { display: none; }

/* page heads, notices, empty states */
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: clamp(28px, 4.5vw, 42px); font-weight: 800; letter-spacing: -0.035em; }
.page-head p { color: var(--ink-2); margin: 8px 0 0; font-size: 16.5px; max-width: 62ch; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 16px; font-size: 14.5px; line-height: 1.5; border: 1px solid transparent; }
.alert.info { background: var(--brand-50); color: var(--ink); border-color: var(--line); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.good { background: var(--good-bg); color: var(--good); }
.alert a { font-weight: 700; text-decoration: underline; color: inherit; }
.empty p { margin: 0 0 14px; }
.noimg { display: grid; place-items: center; width: 100%; height: 100%; color: #c8c2e4; }

/* the list of products */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.pcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); transition: transform 0.18s, box-shadow 0.18s; }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(60, 30, 160, 0.16); }
.pcard-media { position: relative; display: block; aspect-ratio: 1 / 0.85; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; }
.pbadge { position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.pbadge.off { background: var(--deal); color: #fff; }
.pbadge.low { background: var(--warn-bg); color: var(--warn); }
.pbadge.out { background: var(--ink); color: var(--bg); }
.pcard-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.kind { align-self: flex-start; font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-700); background: var(--brand-50); padding: 3px 9px; border-radius: 999px; }
:root[data-theme='dark'] .kind { color: var(--brand); }
.pcard-title { font-size: 17px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.pcard-title a { color: var(--ink); }
.pcard-sum { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pcard .price { font-size: 23px; }
.mrp { color: var(--ink-3); font-size: 14px; }
.pcard-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; align-items: center; }
.pcard-actions .btn { flex: 1; }
.soldout { flex: 1; text-align: center; font-weight: 700; color: var(--ink-3); padding: 8px; }

/* one product */
.crumb { margin: 0 0 14px; font-size: 14px; font-weight: 650; }
.crumb a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.pdp { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.gallery-main { aspect-ratio: 1 / 1; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumbs button { width: 68px; height: 68px; padding: 0; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.thumbs button:hover, .thumbs button:focus-visible { border-color: var(--brand); outline: none; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pdp-info { display: flex; flex-direction: column; gap: 12px; }
.pdp-info h1 { font-size: clamp(26px, 3.8vw, 38px); font-weight: 800; letter-spacing: -0.03em; }
.lead { margin: 0; color: var(--ink-2); font-size: 16.5px; line-height: 1.55; }
.price-row.big .price { font-size: 36px; }
.price-row.big .mrp { font-size: 17px; }
.save { color: var(--good); font-weight: 800; font-size: 14px; }
.stock { margin: 0; font-weight: 700; font-size: 14px; }
.stock.ok { color: var(--good); }
.stock.low { color: var(--warn); }
.stock.out { color: var(--bad); }
.buy-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.qty { display: grid; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.qty .num { width: 84px; padding: 11px 10px; font-size: 15px; }
.facts { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.facts svg { flex: none; margin-top: 1px; color: var(--brand); }
.about { margin-top: 36px; max-width: 74ch; }
.about h2 { font-size: 22px; margin-bottom: 12px; }
.about p { color: var(--ink-2); line-height: 1.7; margin: 0 0 14px; }

/* cart, checkout and order pages: a main column and a summary */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.summary { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-1); display: grid; gap: 12px; }
.summary h2 { font-size: 18px; }
.summary .btn { margin-top: 2px; }
.totals { margin: 0; display: grid; gap: 8px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--ink-2); }
.totals dt, .totals dd { margin: 0; }
.totals .grand { padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink); font-size: 18px; font-weight: 800; }
.mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.mini li { display: flex; justify-content: space-between; gap: 12px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--ink-3); font-size: 13.5px; font-weight: 650; display: inline-flex; gap: 5px; align-items: center; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--bad); }

.clines { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.cline { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.cline-pic { width: 84px; height: 84px; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.cline-pic img { width: 100%; height: 100%; object-fit: cover; }
.cline-main { display: grid; gap: 6px; }
.cline-name { color: var(--ink); font-weight: 700; font-size: 16px; }
.cline-total { font-family: var(--font-display); font-size: 19px; }
.stepper { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stepper output { min-width: 22px; text-align: center; font-weight: 800; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* forms */
.form { display: grid; gap: 18px; }
.form.narrow { max-width: 460px; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px 20px 20px; margin: 0; display: grid; gap: 14px; min-width: 0; }
.form legend { padding: 0 8px; font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.form label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.form input:not([type='checkbox']), .form select { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; color: var(--ink); font: 500 15.5px var(--font-text); }
.form input:focus-visible, .form select:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--brand); }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.form .check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.form .btn[disabled], .btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* an order */
.status { border-radius: var(--radius); padding: 22px 24px; margin-bottom: 14px; border: 1px solid var(--line); background: var(--surface); }
.status h1 { font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; letter-spacing: -0.03em; }
.status p { margin: 8px 0 0; color: var(--ink-2); line-height: 1.55; }
.status.good { background: var(--good-bg); border-color: transparent; }
.status.good h1 { color: var(--good); }
.status.warn { background: var(--warn-bg); border-color: transparent; }
.status.warn h1 { color: var(--warn); }
.status.bad { background: var(--bad-bg); border-color: transparent; }
.status.bad h1 { color: var(--bad); }
.status.info { background: var(--brand-50); }
.hold { font-weight: 700; font-variant-numeric: tabular-nums; }
.onum { margin: 0 0 18px; font-size: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.panel h2 { font-size: 18px; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.panel address { font-style: normal; line-height: 1.6; color: var(--ink-2); }
.olines { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.oline-top { display: flex; justify-content: space-between; gap: 12px; font-weight: 650; }
.deliver { margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.deliver h4 { flex: 1 0 100%; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.keyrow { flex: 1 0 100%; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.keyrow code { font: 600 14.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface); border: 1px dashed var(--line); padding: 8px 12px; border-radius: 10px; word-break: break-all; user-select: all; }
.info .panel p { color: var(--ink-2); line-height: 1.65; margin: 0 0 10px; }

@media (max-width: 880px) {
  .pdp { grid-template-columns: 1fr; gap: 22px; }
  .cols { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 640px) {
  /* app.css hides every header link on a phone; the cart must stay reachable (the "Shop" link is redundant here) */
  .shop-page .nav a.cart-link { display: inline-grid; }
  .shop-page .nav { gap: 6px; }
}
@media (max-width: 560px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pcard-body { padding: 12px; }
  .pcard-actions { flex-direction: column; align-items: stretch; }
  .pcard-actions .btn { width: 100%; }
  .form .two { grid-template-columns: 1fr; }
  .cline { grid-template-columns: 64px minmax(0, 1fr); }
  .cline-pic { width: 64px; height: 64px; }
  .cline-total { grid-column: 2; }
  .buy-row .btn { flex: 1; }
  .shop-page main { padding-top: 18px; }
}
