:root {
  --blue: #2c81e5;
  --blue-dark: #1560b8;
  --navy: #0b1f33;
  --muted: #41607d;
  --pale: #eef4fb;
  --line: #d5e2f0;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 16px/1.5 "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--navy); background: #fff; }
h1, h2 { font-family: Poppins, "Segoe UI", system-ui, sans-serif; line-height: 1.2; }
img { max-width: 100%; display: block; }
a { color: var(--blue-dark); }
ul { list-style: none; padding: 0; margin: 0; }
button, select, input { font: inherit; color: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.demo-banner, .announcement { margin: 0; padding: 8px 16px; text-align: center; font-size: 14px; }
.demo-banner { background: #ffe9a8; }
.announcement { background: var(--blue-dark); color: #fff; }

.header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--navy); font-weight: 700; }
.brand img { object-fit: contain; }
.brand small { color: var(--blue-dark); font-size: inherit; }
.header-actions { display: flex; gap: 8px; align-items: center; }
select { min-height: 44px; max-width: 160px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: #fff; }

.primary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--blue-dark); color: #fff; font-weight: 600; text-decoration: none; cursor: pointer; }
.primary:hover { background: #0f4c94; }
.primary:disabled { background: #7d93a9; cursor: default; }
.wide { width: 100%; }
.link { background: none; border: 0; padding: 8px; color: var(--blue-dark); text-decoration: underline; }
.chip { min-height: 44px; min-width: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

.hero { padding: 72px 16px; text-align: center; color: #fff; background: #0e4a78 center / cover; }
.hero h1 { margin: 0 0 8px; font-size: clamp(32px, 6vw, 52px); }
.hero p { margin: 0 auto; max-width: 34em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 20px 16px 40px; }
.status { text-align: center; padding: 48px 16px; }

.categories { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; text-decoration: none; color: var(--navy); }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--pale); margin-bottom: 8px; }
.card:hover .card-name { text-decoration: underline; }
.card-name { font-weight: 600; }
.card-price { color: var(--muted); }

.back { display: inline-block; padding: 8px 0; }
.product-layout { display: grid; gap: 24px; }
@media (min-width: 760px) { .product-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.gallery { min-width: 0; }
.stage { position: relative; touch-action: pan-y pinch-zoom; user-select: none; }
/* Fourthwall photos are 3:4, so show them whole. */
.product-image { width: 100%; aspect-ratio: 3 / 4; max-height: 78vh; object-fit: contain; border-radius: 12px; background: var(--pale); }
.arrow { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: rgb(255 255 255 / 0.9); color: var(--navy); font-size: 28px; line-height: 1; }
.arrow.previous { left: 8px; }
.arrow.next { right: 8px; }
.counter { position: absolute; right: 8px; bottom: 8px; padding: 2px 10px; border-radius: 12px; background: rgb(11 31 51 / 0.75); color: #fff; font-size: 13px; }
.stage .product-image { cursor: zoom-in; }
.enlarge { position: absolute; right: 8px; top: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 20px; background: rgb(255 255 255 / 0.9); color: var(--navy); font-size: 14px; }
.zoom-dialog { inset: 0; width: 100%; height: 100%; height: 100dvh; max-width: none; max-height: none; padding: 0; background: #fff; overflow: hidden; }
.zoom-dialog[open] { display: flex; flex-direction: column; }
.zoom-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.zoom-hint { flex: 1; font-size: 14px; color: var(--muted); }
.zoom-bar button { min-height: 44px; min-width: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.zoom-view { flex: 1; min-height: 0; display: flex; overflow: auto; overscroll-behavior: contain; background: var(--pale); }
/* margin: auto centers the photo and still lets every edge scroll into view. */
.zoom-view img { display: block; margin: auto; max-width: 100%; max-height: 100%; cursor: zoom-in; user-select: none; }
.zoomed .zoom-view img { flex: none; max-width: none; max-height: none; cursor: grab; }
.zoomed .zoom-view img:active { cursor: grabbing; }
.zoomed .arrow { display: none; }
.thumbs { position: relative; display: flex; gap: 8px; overflow-x: auto; padding: 10px 3px; }
.thumb { flex: none; width: 64px; padding: 0; border: 2px solid transparent; border-radius: 10px; background: var(--pale); overflow: hidden; }
.thumb img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.thumb[aria-current="true"] { border-color: var(--blue-dark); }
@media (min-width: 760px) { .gallery { position: sticky; top: 76px; } }
/* Keep the name and price within reach on phones. */
@media (max-width: 759px) { .product-image { max-height: 52vh; } }
.product-layout h1 { margin: 0 0 4px; }
.product-price { font-size: 22px; font-weight: 700; margin: 0 0 12px; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
form label { display: block; font-weight: 600; margin-bottom: 6px; }
#qty { width: 90px; min-height: 44px; margin: 0 12px 0 0; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; }
.description { overflow-x: auto; }
details { border-top: 1px solid var(--line); padding: 10px 0; overflow-x: auto; }
summary { cursor: pointer; font-weight: 600; }
.message { color: #a3261f; min-height: 1em; }

dialog { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(420px, 100%); height: 100%; max-height: 100%; max-width: 100%; border: 0; padding: 16px; color: inherit; }
dialog::backdrop { background: rgb(6 25 45 / 0.5); }
.cart-head { display: flex; justify-content: space-between; align-items: center; }
#cart-items li { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
#cart-items img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.stepper { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.step { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.subtotal { display: flex; justify-content: space-between; font-size: 18px; }
.note { font-size: 14px; color: var(--muted); }

.newsletter { background: var(--pale); text-align: center; padding: 36px 16px; }
.newsletter h2 { margin-top: 0; }
.footer { padding: 24px 16px 40px; text-align: center; font-size: 14px; color: var(--muted); }
.footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
.footer nav a { padding: 6px 0; }
.legal { max-width: 720px; }

#open-cart { white-space: nowrap; }
@media (max-width: 520px) {
  .header { padding: 8px 10px; }
  .brand > span { display: none; }
  .categories { flex-wrap: nowrap; overflow-x: auto; padding: 3px; }
  .chip { white-space: nowrap; }
  .categories .chip { flex: none; }
}
