/* JPOS default theme. Served by StorefrontAssetController from the theme's own assets/ folder — this file
   is the only copy; nothing is mirrored into wwwroot.

   Tokens first, components after. --accent / --page-bg / --ink / --surface / --shell / --radius /
   --section-gap / --button-radius / --button-border are written by layout/theme.liquid from the shop's
   own settings, so nothing below reads `settings` directly. */

:root {
  --muted: #6b7280;
  --line: #e5e7eb;

  /* Fallbacks for the four the layout normally writes. A snippet rendered outside the layout (an error
     page served before settings load) still has something to lay itself out with. */
  --accent: #171717;
  --page-bg: #ffffff;
  --ink: #171717;
  --surface: #f9fafb;
  --shell: 1200px;
  --radius: 12px;
  --section-gap: 56px;
  --button-radius: 8px;
  --button-border: 0px;

  /* Spacing scale. One ladder for the whole theme, so a new section does not invent its own 22px. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Side gutter, widened with the viewport the way Dawn does — a phone needs the screen, a desktop
     needs the margin. Redefined in the media queries at the bottom of this block. */
  --gutter: 16px;

  --duration-short: 100ms;
  --duration-default: 200ms;
  --duration-long: 500ms;
  --duration-reveal: 600ms;
  --ease-out-slow: cubic-bezier(0, 0, 0.3, 1);

  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-header: 0 2px 12px rgba(0, 0, 0, 0.07);
}

@media screen and (min-width: 750px) {
  :root { --gutter: 32px; }
}

@media screen and (min-width: 990px) {
  :root { --gutter: 50px; }
}

* { box-sizing: border-box; }

/* Column layout + main:flex-1 keeps the footer at the bottom of the viewport on a short page (an empty
   cart, a 404) instead of leaving it floating halfway up. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--page-bg);
  line-height: 1.55;
}

img { max-width: 100%; }
a { color: inherit; }

/* The shell every full-width strip aligns to: header, page content, footer. The merchant's "bề rộng tối
   đa" is the CONTENT width, so the gutter is subtracted rather than added — a 1200px setting means 1200px
   of text, not 1200px minus the margins. */
.page-width {
  width: min(var(--shell), calc(100% - var(--gutter) * 2));
  margin-left: auto;
  margin-right: auto;
}

.muted { color: var(--muted); }
.empty { color: var(--muted); padding: var(--space-6) 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Focus ------------------------------------------------------------------- */

/* The theme had no focus style at all, which means a keyboard visitor tabbing through the header could
   not tell where they were — a real accessibility failure, not a polish item. Two rings (one in the page
   colour, one in the accent) so it stays visible on a pale card and on a photo alike. :focus-visible, so
   a mouse click never paints it. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid transparent; /* forced-colors mode draws this; the box-shadow below is ignored there */
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--page-bg), 0 0 0 5px var(--accent);
  border-radius: 3px;
}

/* First tab stop on every page, so a keyboard visitor can jump the whole header instead of tabbing
   through the menu on each page. Off-screen until focused. */
.skip-to-content {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 60;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--button-radius);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-to-content:focus { transform: translateY(0); }

.icon { width: 20px; height: 20px; display: block; }

.button {
  display: inline-block; margin-top: var(--space-4); padding: var(--space-3) var(--space-5);
  border: var(--button-border) solid var(--accent);
  border-radius: var(--button-radius); background: var(--accent); color: #fff;
  text-decoration: none; font-weight: 600;
  transition: opacity var(--duration-short) ease, transform var(--duration-short) ease;
}
.button:hover { opacity: .88; }
.button:active { transform: translateY(1px); }

.link-button {
  border: 0; padding: 0; background: none; color: var(--muted);
  font: inherit; text-decoration: underline; cursor: pointer;
  transition: color var(--duration-short) ease;
}
.link-button:hover { color: var(--ink); }

/* Header ------------------------------------------------------------------ */

.header-wrapper {
  position: relative;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: var(--page-bg);
}

.header-wrapper--sticky { position: sticky; top: 0; }

/* Only once the page has actually scrolled — a shadow under a header sitting at the top of an unscrolled
   page is a shadow with nothing to cast onto. theme.js sets the class. */
.header-wrapper.is-scrolled { box-shadow: var(--shadow-header); }
.header-wrapper { transition: box-shadow var(--duration-default) ease; }

/* Three columns on desktop: menu on the left of the brand, icons hard right. On mobile the nav is
   replaced by the hamburger in the same slot, so the brand never moves between breakpoints. */
.header {
  display: grid;
  grid-template-areas: "menu brand icons";
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 0;
}

.header .drawer { grid-area: menu; justify-self: start; }
.header .brand { grid-area: brand; justify-self: center; }
.header .site-nav { grid-area: menu; }
.header__icons { grid-area: icons; justify-self: end; }

@media screen and (min-width: 990px) {
  /* Logo on the left is the default; "Đặt logo ở giữa" swaps to the centred arrangement. */
  .header:not(.header--center) {
    grid-template-areas: "brand menu icons";
    grid-template-columns: auto 1fr auto;
  }
  .header:not(.header--center) .brand { justify-self: start; }
  .header:not(.header--center) .site-nav { justify-self: start; }

  .header--center {
    grid-template-areas: "menu brand icons";
    grid-template-columns: 1fr auto 1fr;
  }
  .header--center .site-nav { justify-self: start; }
}

.brand {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-size: 20px; font-weight: 700; text-decoration: none;
}
.brand__logo { height: 36px; width: auto; object-fit: contain; }
.brand__name { white-space: nowrap; }

/* A shop with a logo does not also need its name spelled out beside it on a phone, where that is the
   difference between a header that fits and one that wraps. */
@media screen and (max-width: 749px) {
  .brand__logo + .brand__name { display: none; }
  .brand { font-size: 17px; }
}

.site-nav { display: none; align-items: center; gap: var(--space-5); }

@media screen and (min-width: 990px) {
  .site-nav { display: flex; }
  .header .drawer { display: none; }
}

.site-nav__link {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-2) 0;
  color: var(--ink); text-decoration: none; font-size: 15px;
  text-decoration-thickness: 1px; text-underline-offset: 4px;
  transition: text-decoration-color var(--duration-short) ease;
}
.site-nav__link:hover { text-decoration: underline; text-decoration-thickness: 2px; }

.icon--caret { width: 10px; height: 6px; }

.header__icons { display: flex; align-items: center; gap: var(--space-2); }

.header__icon {
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: none;
  color: var(--ink); cursor: pointer; text-decoration: none;
  transition: background-color var(--duration-short) ease;
}
.header__icon:hover { background: var(--surface); }

/* <summary> renders a disclosure triangle by default, which is not what a hamburger button looks like. */
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ""; }

.header__icon--menu .icon--close { display: none; }
.drawer[open] .header__icon--menu .icon--menu { display: none; }
.drawer[open] .header__icon--menu .icon--close { display: block; }

.cart-link__count {
  position: absolute; top: 2px; right: 0;
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600;
}

/* Header search ----------------------------------------------------------- */

.header__search-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line);
  background: var(--page-bg);
  box-shadow: var(--shadow-float);
}

.site-search { display: flex; gap: var(--space-2); }
.site-search input {
  flex: 1; min-height: 44px; padding: 0 var(--space-3);
  border: 1px solid var(--line); border-radius: var(--button-radius); font: inherit;
  background: var(--page-bg); color: var(--ink);
}
.site-search button, .search-form button {
  min-height: 44px; padding: 0 var(--space-5); border: 0; border-radius: var(--button-radius);
  background: var(--accent); color: #fff; font: inherit; cursor: pointer;
}

/* Mobile drawer ----------------------------------------------------------- */

/* Without JavaScript a <details> simply shows its content when open, which is why the panel's resting
   state below is VISIBLE. The .js rules underneath — added by theme.js once it runs — put it back
   off-screen so it can slide in. A visitor with scripts blocked still gets a working menu. */
.drawer__overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, .45);
}

.drawer__panel {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 41;
  width: min(330px, 85vw);
  padding: var(--space-7) var(--space-5) var(--space-5);
  background: var(--page-bg);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.js .drawer__overlay { opacity: 0; transition: opacity var(--duration-default) ease; }
.js .drawer__panel { transform: translateX(-100%); transition: transform var(--duration-default) var(--ease-out-slow); }
.js .drawer.is-opening .drawer__overlay { opacity: 1; }
.js .drawer.is-opening .drawer__panel { transform: translateX(0); }

/* The hamburger becomes the drawer's close button, so it has to sit ABOVE the panel it opened — the
   panel is fixed at top:0 and would otherwise bury it, leaving the overlay and Esc as the only ways out.
   The panel's top padding is what leaves it room. Both live inside .header-wrapper's stacking context, so
   these z-indexes only ever compete with each other. */
.drawer[open] > summary { position: relative; z-index: 42; }

.drawer__nav { display: flex; flex-direction: column; }

.drawer__link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: 16px;
}

.drawer__group > summary { border-bottom: 1px solid var(--line); }
.drawer__group > summary .drawer__link { border-bottom: 0; }
.drawer__group[open] > summary .icon--caret { transform: rotate(180deg); }
.drawer__group .icon--caret { transition: transform var(--duration-short) ease; }
.drawer__sub { padding-left: var(--space-4); }
.drawer__sub .drawer__link { font-size: 15px; color: var(--muted); }

.drawer__foot { margin-top: var(--space-5); }

/* Shell / footer ---------------------------------------------------------- */

.page-shell {
  flex: 1;
  width: min(var(--shell), calc(100% - var(--gutter) * 2));
  margin: var(--space-7) auto var(--space-8);
}

.page-title { margin-bottom: var(--space-5); }
.page-title h1 { margin: 0 0 var(--space-1); font-size: clamp(26px, 4vw, 36px); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }

.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-6);
  padding: var(--space-7) 0;
  color: var(--muted); font-size: 14px;
}
.site-footer p { margin: 0 0 var(--space-1); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__name { color: var(--ink); font-weight: 700; font-size: 16px; margin-bottom: var(--space-2); }
.site-footer__heading { color: var(--ink); font-weight: 600; margin-bottom: var(--space-2); }
.site-footer__links { display: flex; flex-direction: column; gap: var(--space-2); }

.site-footer__social { display: flex; gap: var(--space-3); margin-top: var(--space-4); }
.site-footer__social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--page-bg); color: var(--ink);
  transition: background-color var(--duration-short) ease, color var(--duration-short) ease;
}
.site-footer__social a:hover { background: var(--accent); color: #fff; }

.site-footer__bar { border-top: 1px solid var(--line); }
.site-footer__bar p { padding: var(--space-4) 0; color: var(--muted); font-size: 13px; }

/* Home -------------------------------------------------------------------- */

.home-hero { padding: var(--space-7) 0; text-align: center; }
.home-hero h1 { margin: 0 0 var(--space-2); font-size: clamp(32px, 6vw, 56px); }
.home-hero p { margin: 0; color: var(--muted); }

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

.product-page { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: var(--space-7); }
.product-gallery { display: grid; gap: var(--space-3); align-content: start; }

/* One horizontally scrolling strip with scroll-snap, and the thumbnails are plain #anchor links into it.
   That is what makes the gallery work with NO JavaScript: the browser's own "scroll to the fragment"
   lands on the right slide, and the snap keeps it there. theme.js only highlights the active thumbnail. */
.product-gallery__stage {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  border-radius: var(--radius);
  background: var(--surface);
  /* The strip is one long row of slides; hiding the bar keeps the thumbnails below it from looking like
     a second scrollbar. Scrolling by touch, wheel and keyboard all still work. */
  scrollbar-width: none;
}
.product-gallery__stage::-webkit-scrollbar { display: none; }

.product-gallery__slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
}

/* contain, not cover: a product photo is the thing being sold, so cropping it to fill a box is worse
   than the letterboxing the surface colour gives. max-height caps a tall photo so the price and the buy
   button stay above the fold on a desktop. */
.product-gallery__slide img {
  display: block; width: 100%; aspect-ratio: 1; max-height: 560px; object-fit: contain;
}

.product-gallery__thumbs {
  display: flex; gap: var(--space-2); overflow-x: auto;
  padding-bottom: var(--space-1);
  scrollbar-width: thin;
}
.product-gallery__thumb {
  flex: 0 0 72px;
  border: 2px solid transparent; border-radius: var(--button-radius);
  overflow: hidden; background: var(--surface);
  transition: border-color var(--duration-short) ease, opacity var(--duration-short) ease;
  opacity: .65;
}
.product-gallery__thumb img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.product-gallery__thumb:hover { opacity: 1; }
.product-gallery__thumb.is-active { border-color: var(--accent); opacity: 1; }

.product-gallery__empty { aspect-ratio: 1; max-height: 560px; border-radius: var(--radius); background: var(--surface); }

/* Stock line ---------------------------------------------------------------- */

.product-stock { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-5); font-size: 15px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--in { background: #16a34a; }
.dot--out { background: var(--muted); }

/* Variant pills ------------------------------------------------------------- */

/* Radio inputs behind labels: the control is a real form field, so choosing a variant needs no
   JavaScript and the choice posts with the form like any other. */
.variant-pills { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2); }
.variant-pills__label {
  display: inline-flex; flex-direction: column; gap: 2px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line); border-radius: var(--button-radius);
  background: var(--page-bg); cursor: pointer; font-size: 15px; line-height: 1.3;
  transition: border-color var(--duration-short) ease, background-color var(--duration-short) ease;
}
.variant-pills__price { color: var(--muted); font-size: 13px; }
.variant-pills__label:hover { border-color: var(--ink); }
.variant-pills__input:checked + .variant-pills__label {
  border-color: var(--accent); background: var(--accent); color: #fff;
}
.variant-pills__input:checked + .variant-pills__label .variant-pills__price { color: rgba(255, 255, 255, .8); }
/* A sold-out variant stays visible and stays readable — striking it out is what tells a shopper the
   size they wanted exists but is gone, which "not listed at all" never does. */
.variant-pills__input:disabled + .variant-pills__label {
  opacity: .45; cursor: not-allowed; text-decoration: line-through;
}
/* The input is visually hidden, so the ring has to be drawn on the label it controls or a keyboard
   visitor tabbing through the variants sees nothing at all move. */
.variant-pills__input:focus-visible + .variant-pills__label {
  box-shadow: 0 0 0 3px var(--page-bg), 0 0 0 5px var(--accent);
}

.product-form__label { font-size: 14px; color: var(--muted); }

/* Accordion ----------------------------------------------------------------- */

/* <details>, so open/close, the keyboard and the browser's own Ctrl+F (which finds text inside a closed
   one) all work without a line of script. */
.accordion { margin-top: var(--space-6); border-top: 1px solid var(--line); }
.accordion__item { border-bottom: 1px solid var(--line); }
.accordion__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4) 0; font-weight: 600;
}
.accordion__item[open] .accordion__head .icon--caret { transform: rotate(180deg); }
.accordion__head .icon--caret { transition: transform var(--duration-short) ease; flex: 0 0 auto; }
.accordion__body { padding-bottom: var(--space-4); }

/* Collection toolbar -------------------------------------------------------- */

.collection-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5); padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}
.collection-toolbar__count { margin: 0; }

.collection-sort { display: flex; align-items: center; gap: var(--space-2); font-size: 14px; }
.collection-sort label { color: var(--muted); white-space: nowrap; }
.collection-sort select {
  min-height: 40px; padding: 0 var(--space-3);
  border: 1px solid var(--line); border-radius: var(--button-radius);
  background: var(--page-bg); color: var(--ink); font: inherit; font-size: 14px;
}
.collection-sort button {
  min-height: 40px; padding: 0 var(--space-4); border: 0; border-radius: var(--button-radius);
  background: var(--accent); color: #fff; font: inherit; font-size: 14px; cursor: pointer;
}

/* Empty states -------------------------------------------------------------- */

/* An empty list with a way out of it, rather than one sentence and a dead end. */
.empty-state { padding: var(--space-8) var(--space-4); text-align: center; }
.empty-state__title { margin: 0 0 var(--space-2); font-size: 18px; font-weight: 600; }

.product-info { position: sticky; top: var(--space-6); align-self: start; }
.product-info h1 { margin: 0 0 var(--space-3); font-size: clamp(28px, 4vw, 44px); }
.vendor { margin: 0 0 var(--space-2); color: var(--muted); }

.price { display: flex; align-items: baseline; gap: var(--space-2); margin: 0; font-weight: 600; }
.price__compare { color: var(--muted); font-weight: 400; }
/* The product page shows the same .price markup as a card, at the size a product page deserves. */
.product-info .price { margin-bottom: var(--space-5); font-size: 24px; font-weight: 700; }
.product-info .price__compare { font-size: 18px; }

.description { line-height: 1.7; white-space: pre-line; }

.product-form { display: grid; gap: var(--space-2); margin-top: var(--space-6); }
.product-form label { font-size: 14px; color: var(--muted); }
.product-form select, .product-form input, .product-form button {
  min-height: 48px; padding: 0 var(--space-4); border: 1px solid var(--line);
  border-radius: var(--button-radius); font: inherit;
}
.product-form button {
  margin-top: var(--space-2); border: 0; color: #fff; background: var(--accent);
  font-weight: 600; cursor: pointer;
}
.product-form button:disabled { opacity: .45; cursor: not-allowed; }

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

/* Column COUNT rather than auto-fill: the merchant picked a number, so the grid has to honour it instead
   of deriving one from a minimum width. minmax(0, 1fr) — not just 1fr — because a grid track's default
   min-width is auto, which lets a long unbroken product name push its column wider than its share and
   spill the whole row off the page. */
.product-grid {
  display: grid; gap: var(--space-6) var(--space-3);
  grid-template-columns: repeat(var(--grid-cols-mobile, 2), minmax(0, 1fr));
}

@media screen and (min-width: 750px) {
  .product-grid {
    gap: var(--space-6) var(--space-5);
    grid-template-columns: repeat(var(--grid-cols, 4), minmax(0, 1fr));
  }
}

.card-wrapper { height: 100%; }
.card { display: flex; flex-direction: column; height: 100%; }

/* padding-bottom, not aspect-ratio: the box must already have its height while the image is still
   downloading, otherwise every card in the grid jumps down a notch the moment the photos land. */
.card__media {
  position: relative; display: block; overflow: hidden;
  padding-bottom: var(--product-ratio, 100%);
  border-radius: var(--radius);
  background: var(--surface);
}

.card__image {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  transition: transform var(--duration-long) ease, opacity var(--duration-default) ease;
}
.card__image--hover { opacity: 0; }

/* hover:hover keeps all of this off touch screens, where "hover" means the first tap and a shopper would
   otherwise have to tap twice to open a product. */
@media (hover: hover) {
  .card:hover .card__image--hover { opacity: 1; }
  .anim-media .card:hover .card__image { transform: scale(1.04); }
}

.card__badges {
  position: absolute; left: var(--space-3); top: var(--space-3);
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2);
}
.badge {
  padding: 3px var(--space-2); border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
}
.badge--sale { background: var(--accent); color: #fff; }
.badge--soldout { background: var(--page-bg); color: var(--muted); border: 1px solid var(--line); }

.card__content { display: flex; flex-direction: column; gap: var(--space-1); padding-top: var(--space-3); }
.card__heading { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; }
.card__heading a {
  text-decoration: none;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: text-decoration-thickness ease var(--duration-short);
}
.card__heading a:hover { text-decoration: underline; }
.card__content .price { font-size: 15px; }
.card__content .price__compare { font-size: 14px; }

.collection-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.collection-card {
  padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--page-bg);
  transition: box-shadow var(--duration-short) ease, transform var(--duration-short) ease;
}
.collection-card:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); }
.collection-card h2 { margin: 0; font-size: 18px; }
.collection-card a { text-decoration: none; }

.pagination { display: flex; align-items: center; justify-content: center; gap: var(--space-5); margin-top: var(--space-7); }
.pagination a { text-decoration: none; font-weight: 600; }
.pagination span { color: var(--muted); }

/* Search ------------------------------------------------------------------ */

.search-form { display: flex; gap: var(--space-2); margin-bottom: var(--space-5); }
.search-form input {
  flex: 1; min-height: 44px; padding: 0 var(--space-4);
  border: 1px solid var(--line); border-radius: var(--button-radius); font: inherit;
}

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

.cart-items { display: grid; gap: var(--space-4); }
.cart-item {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: var(--space-5); align-items: center;
  padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius);
}
.cart-item__media { display: block; width: 96px; aspect-ratio: 1; border-radius: var(--button-radius); background: var(--surface); overflow: hidden; }
.cart-item__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__info h2 { margin: 0 0 var(--space-1); font-size: 16px; }
.cart-item__info h2 a { text-decoration: none; }
.cart-item__info p { margin: 0; font-size: 14px; }
.cart-item__actions { display: grid; gap: var(--space-2); justify-items: end; }
.cart-item__total { margin: 0; font-weight: 700; }
.cart-item__quantity { display: flex; gap: var(--space-1); }
.cart-item__quantity input { width: 76px; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--button-radius); font: inherit; }
.cart-item__quantity button { min-height: 38px; padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--button-radius); background: var(--page-bg); font: inherit; cursor: pointer; }

.cart-summary {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4);
  margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--line);
}
.cart-summary__total { display: flex; gap: var(--space-3); align-items: baseline; margin: 0; font-size: 18px; }
.cart-summary .button { margin-top: 0; }

.cart-summary__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.cart-summary__actions .button { margin-top: 0; }
.button--ghost { border: 1px solid var(--line); background: var(--page-bg); color: var(--ink); }

/* Content / 404 ------------------------------------------------------------ */

.content-page { max-width: 720px; }
.page-content { white-space: pre-line; line-height: 1.75; }

.not-found-page { padding: var(--space-8) 0; text-align: center; }
.not-found-page h1 { margin: 0; font-size: clamp(56px, 12vw, 96px); }
.not-found-page p { color: var(--muted); }

/* Checkout ----------------------------------------------------------------- */

.checkout-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: var(--space-7); align-items: start; }

.checkout-form h2, .checkout-summary h2 { margin: 0 0 var(--space-4); font-size: 18px; }
.checkout-form h2 + .field, .checkout-form h2 + .field-row { margin-top: 0; }
.checkout-form > h2:not(:first-child) { margin-top: var(--space-6); }

.field { display: grid; gap: var(--space-1); margin-bottom: var(--space-4); }
.field label { font-size: 14px; color: var(--muted); }
.field input, .field select, .field textarea {
  min-height: 44px; padding: 10px var(--space-3); border: 1px solid var(--line);
  border-radius: var(--button-radius); font: inherit; background: var(--page-bg); color: var(--ink);
}
.field textarea { min-height: 88px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }

.choices { gap: 10px; }
.choice { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 15px; }
.choice input { min-height: 0; width: auto; }

.checkout-form button[type="submit"] {
  width: 100%; min-height: 50px; border: 0; border-radius: var(--button-radius);
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.checkout-note { margin: var(--space-3) 0 0; font-size: 14px; text-align: center; }

.form-error {
  margin-bottom: var(--space-5); padding: var(--space-3) var(--space-4); border: 1px solid #fca5a5;
  border-radius: var(--button-radius); background: #fef2f2; color: #b91c1c;
}

.form-success {
  margin-bottom: var(--space-5); padding: var(--space-3) var(--space-4); border: 1px solid #86efac;
  border-radius: var(--button-radius); background: #f0fdf4; color: #15803d;
}

.checkout-summary { padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.checkout-summary__line { display: flex; justify-content: space-between; gap: var(--space-4); margin-bottom: 10px; font-size: 14px; }
.checkout-summary__total {
  display: flex; justify-content: space-between; gap: var(--space-4);
  margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); font-size: 17px;
}
.checkout-summary a { display: inline-block; margin-top: var(--space-4); font-size: 14px; }

.checkout-done { padding: var(--space-8) 0; text-align: center; }
.checkout-done h1 { margin: 0 0 var(--space-3); }

/* Sections ----------------------------------------------------------------- */

.rich-text { max-width: 720px; margin: 0 auto; text-align: center; }
.rich-text h2 { margin: 0 0 var(--space-3); font-size: 24px; }
.rich-text__body { color: var(--muted); line-height: 1.8; white-space: pre-line; }

/* Sections stack on the home page, so the gap belongs between them rather than inside each one —
   otherwise a theme author has to remember the spacing every time they add a block. */
.page-shell > section + section,
.page-shell > .featured + section { margin-top: var(--section-gap); }

.featured { margin-top: var(--section-gap); }
.featured .page-title h2 { margin: 0; font-size: clamp(22px, 3vw, 28px); }
.featured__more { margin-top: var(--space-5); text-align: center; }
.featured__more a { font-weight: 600; text-decoration: none; }

/* Image banner -------------------------------------------------------------- */

/* The scrim and the content are stacked over the photo, so the section is a positioning context and the
   image fills it absolutely — object-fit:cover rather than a background-image so the browser can pick a
   srcset and lazily decode it like any other <img>. */
.image-banner {
  position: relative;
  display: grid; align-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: var(--space-7);
}
.image-banner--thap { min-height: 280px; }
.image-banner--vua { min-height: 420px; }
.image-banner--cao { min-height: 580px; }

.image-banner__media {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center;
}

/* The one thing keeping the text readable on a bright photo. Its opacity is the merchant's setting. */
.image-banner__scrim { position: absolute; inset: 0; background: #000; }

.image-banner__content { position: relative; padding: var(--space-7) 0; color: #fff; }
.image-banner__content--trai { text-align: left; }
.image-banner__content--giua { text-align: center; }
.image-banner__content--phai { text-align: right; }

.image-banner__heading { margin: 0 0 var(--space-3); font-size: clamp(28px, 5vw, 52px); line-height: 1.15; }
.image-banner__text { margin: 0; font-size: 17px; opacity: .9; }
.image-banner__buttons { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.image-banner__content--giua .image-banner__buttons { justify-content: center; }
.image-banner__content--phai .image-banner__buttons { justify-content: flex-end; }
.image-banner__buttons .button { margin-top: 0; }
/* On a photo the ghost button needs a border of its own — var(--line) is a pale grey that disappears. */
.image-banner__buttons .button--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }

/* A banner with no photo behind it would print white text on a pale surface. */
.image-banner:not(:has(.image-banner__media)) .image-banner__content { color: var(--ink); }
.image-banner:not(:has(.image-banner__media)) .image-banner__scrim { display: none; }
.image-banner:not(:has(.image-banner__media)) .button--ghost { color: var(--ink); border-color: var(--line); }

/* Collection list ----------------------------------------------------------- */

.collection-list__grid {
  display: grid; gap: var(--space-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media screen and (min-width: 750px) {
  .collection-list__grid { grid-template-columns: repeat(var(--cot, 3), minmax(0, 1fr)); }
}

.collection-tile {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; padding: var(--space-5);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  text-align: center; text-decoration: none; font-weight: 600;
  transition: box-shadow var(--duration-short) ease, transform var(--duration-short) ease;
}
.collection-tile:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); }

/* Image with text ----------------------------------------------------------- */

.image-with-text { display: grid; gap: var(--space-6); align-items: center; }

@media screen and (min-width: 750px) {
  .image-with-text { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-7); }
  /* order on the MEDIA, not a separate rule per side: one property flips the layout, so the two
     arrangements cannot drift apart. */
  .image-with-text--phai .image-with-text__media { order: 2; }
  /* No photo chosen yet: one centred column, rather than text shoved into one half with the other half
     blank — which reads as a broken page, not as a section awaiting an image. */
  .image-with-text--khong-anh { grid-template-columns: minmax(0, 720px); justify-content: center; text-align: center; }
}

.image-with-text__media {
  border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
.image-with-text__media img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.image-with-text__body h2 { margin: 0 0 var(--space-3); font-size: clamp(24px, 3vw, 34px); }
.image-with-text__text { color: var(--muted); line-height: 1.8; white-space: pre-line; }

/* Multicolumn --------------------------------------------------------------- */

.multicolumn__grid {
  display: grid; gap: var(--space-5);
  grid-template-columns: 1fr;
}
@media screen and (min-width: 750px) {
  .multicolumn__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.multicolumn__item { text-align: center; }
.multicolumn__icon { width: 48px; height: 48px; object-fit: contain; margin-bottom: var(--space-3); }
.multicolumn__item h3 { margin: 0 0 var(--space-2); font-size: 18px; }
.multicolumn__item p { margin: 0; }

/* FAQ ----------------------------------------------------------------------- */

.faq { max-width: 760px; margin-left: auto; margin-right: auto; }
.faq .accordion { margin-top: 0; }

/* Newsletter ---------------------------------------------------------------- */

.newsletter {
  padding: var(--space-7) var(--space-5);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.newsletter__inner { max-width: 560px; margin: 0 auto; }
.newsletter h2 { margin: 0 0 var(--space-2); font-size: clamp(22px, 3vw, 30px); }
.newsletter p { margin: 0 0 var(--space-5); }

.newsletter__form { display: flex; gap: var(--space-2); }
.newsletter__form input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 var(--space-4);
  border: 1px solid var(--line); border-radius: var(--button-radius);
  background: var(--page-bg); color: var(--ink); font: inherit;
}
.newsletter__form button {
  min-height: 48px; padding: 0 var(--space-5); border: 0; border-radius: var(--button-radius);
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
/* The outcome message is inside a centred block, so it must not keep the left-aligned form margins. */
.newsletter .form-success, .newsletter .form-error { text-align: center; }

@media screen and (max-width: 560px) {
  .newsletter__form { flex-direction: column; }
}

/* Slideshow ---------------------------------------------------------------- */

.slideshow {
  position: relative; overflow: hidden;
  margin-bottom: var(--space-7);
  border-radius: var(--radius);
  background: var(--surface);
}
.slideshow--thap { min-height: 320px; }
.slideshow--vua { min-height: 460px; }
.slideshow--cao { min-height: 620px; }
.slideshow__track { position: absolute; inset: 0; }

/* The slides are STACKED and cross-faded. The old version toggled display:none, and `display` cannot be
   transitioned at all — which is exactly why it cut rather than moved. Stacking also means the section
   keeps one height instead of jumping as photos of different shapes come round. */
.slideshow__slide {
  position: absolute; inset: 0;
  opacity: 0;
  /* visibility, not display: it still cannot be tabbed into or read out while hidden, but it CAN be
     transitioned — visibility waits out the whole fade before applying. */
  visibility: hidden;
  transition: opacity var(--duration-long) var(--ease-out-slow), visibility var(--duration-long);
}
.slideshow__slide.is-active { opacity: 1; visibility: visible; }

.slideshow__media {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center;
}
.slideshow__scrim { position: absolute; inset: 0; background: #000; }

.slideshow__content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: center;
  height: 100%;
  padding: var(--space-7) 0;
  color: #fff;
}
/* Room for the arrows. Without it the left arrow sits on top of the subtitle whenever the text is
   left-aligned — the content column starts at the page gutter (50px) and the arrow ends at 60px.
   :has(), so a single-slide show (which draws no arrows) keeps the full width. */
@media screen and (min-width: 750px) {
  .slideshow:has(.slideshow__arrow) .slideshow__content {
    padding-left: 56px;
    padding-right: 56px;
  }
}

.slideshow__content--trai { align-items: flex-start; text-align: left; }
.slideshow__content--giua { align-items: center; text-align: center; }
.slideshow__content--phai { align-items: flex-end; text-align: right; }

.slideshow__heading { margin: 0 0 var(--space-3); font-size: clamp(28px, 5vw, 52px); line-height: 1.15; max-width: 22ch; }
.slideshow__text { margin: 0; font-size: 17px; opacity: .92; max-width: 46ch; }
.slideshow__actions { margin-top: var(--space-5); }
.slideshow__actions .button { margin-top: 0; }

/* On a darkened photo the accent button is near-black on near-black. Inverting it — white plate, dark
   text — is the only version that stays readable whatever the merchant's photo and scrim happen to be,
   and it is what a banner button looks like on every shop that sells anything. */
.slideshow__actions .button,
.image-banner:has(.image-banner__media) .image-banner__buttons .button:not(.button--ghost) {
  background: #fff;
  color: #111;
  border-color: #fff;
}
.slideshow__actions .button:hover,
.image-banner:has(.image-banner__media) .image-banner__buttons .button:not(.button--ghost):hover {
  opacity: .9;
}

/* The text effect the slideshow had none of. It runs ONLY on the slide that is showing, and --thu-tu
   staggers the three pieces so they arrive in reading order rather than all at once.
   Inside prefers-reduced-motion: no-preference — a visitor who asked their device for less movement
   gets the text placed, not flown in. */
@media (prefers-reduced-motion: no-preference) {
  .slideshow__heading,
  .slideshow__text,
  .slideshow__actions {
    opacity: 0;
    transform: translateY(16px);
  }
  .slideshow__slide.is-active .slideshow__heading,
  .slideshow__slide.is-active .slideshow__text,
  .slideshow__slide.is-active .slideshow__actions {
    animation: jposSlideText var(--duration-reveal) var(--ease-out-slow) forwards;
    /* Starts after the photo has begun to appear, or the text arrives over the previous image. */
    animation-delay: calc(var(--duration-default) + var(--thu-tu, 0) * 120ms);
  }

  @keyframes jposSlideText {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

.slideshow__arrow {
  position: absolute; top: 50%; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-top: -22px;
  border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .35); color: #fff; cursor: pointer;
  transition: background-color var(--duration-short) ease, opacity var(--duration-short) ease;
  opacity: 0;
}
.slideshow__arrow svg { width: 10px; height: 16px; }
.slideshow__arrow--prev { left: var(--space-4); }
.slideshow__arrow--next { right: var(--space-4); }
.slideshow__arrow:hover { background: rgba(0, 0, 0, .6); }
/* Hidden until the pointer is over the slideshow — but always visible to a keyboard, or the control
   would be unreachable for anyone not using a mouse. On touch there is no hover, so they stay shown. */
.slideshow:hover .slideshow__arrow,
.slideshow__arrow:focus-visible { opacity: 1; }
@media (hover: none) {
  .slideshow__arrow { opacity: 1; }
}

.slideshow__dots {
  position: absolute; left: 0; right: 0; bottom: var(--space-4); z-index: 2;
  display: flex; justify-content: center; gap: var(--space-2);
}
.slideshow__dot {
  width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .55); cursor: pointer;
  transition: transform var(--duration-short) ease, background-color var(--duration-short) ease;
}
.slideshow__dot.is-active { background: #fff; transform: scale(1.2); }

@media screen and (max-width: 749px) {
  .slideshow--cao { min-height: 480px; }
  .slideshow__arrow { width: 36px; height: 36px; margin-top: -18px; }
}

/* Desktop dropdown --------------------------------------------------------- */

.site-nav__group { position: relative; }
.site-nav__dropdown {
  position: absolute; top: 100%; left: 0; z-index: 20;
  display: none; flex-direction: column; min-width: 190px; padding: var(--space-2) 0;
  border: 1px solid var(--line); border-radius: var(--button-radius); background: var(--page-bg);
  box-shadow: var(--shadow-float);
}
/* Hover for a mouse, focus-within so a keyboard can reach it too. */
.site-nav__group:hover .site-nav__dropdown,
.site-nav__group:focus-within .site-nav__dropdown { display: flex; }
.site-nav__dropdown a { padding: var(--space-2) var(--space-4); white-space: nowrap; text-decoration: none; }
.site-nav__dropdown a:hover { background: var(--surface); }

/* Customer account --------------------------------------------------------- */

.account-page { padding: var(--space-6) 0 var(--space-8); }
.account-page--narrow { max-width: 480px; margin: 0 auto; }

.account-nav {
  display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap;
  margin-bottom: var(--space-6); padding-bottom: var(--space-3); border-bottom: 1px solid var(--line); font-size: 15px;
}
.account-nav a { text-decoration: none; color: var(--muted); }
.account-nav a:hover { color: var(--ink); }
.account-nav form { margin-left: auto; }

.account-form { display: flex; flex-direction: column; gap: var(--space-1); }
.account-form label { margin-top: var(--space-3); font-size: 14px; font-weight: 600; }
.account-form input, .account-form select {
  min-height: 46px; padding: 0 var(--space-4); border: 1px solid var(--line);
  border-radius: var(--button-radius); background: var(--page-bg); color: var(--ink); font: inherit;
}
.account-form button[type="submit"] {
  margin-top: var(--space-5); min-height: 48px; border: 0; border-radius: var(--button-radius);
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}

.account-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
.account-card { padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.account-card h2 { margin: 0 0 var(--space-3); font-size: 18px; }
.account-card .button { margin-top: var(--space-4); }

.account-orders { margin: 0; padding: 0; list-style: none; }
.account-orders li {
  display: flex; justify-content: space-between; gap: var(--space-3);
  padding: 10px 0; border-bottom: 1px solid var(--line);
}

.account-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.account-table th, .account-table td { padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--line); text-align: left; }
.account-table th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.account-total {
  display: flex; justify-content: space-between; gap: var(--space-4);
  max-width: 320px; margin-left: auto; padding-top: var(--space-3); font-size: 16px;
}

.account-link { text-decoration: none; }

/* Scroll reveal ------------------------------------------------------------ */

/* Resting state is VISIBLE on purpose. theme.js adds .scroll-trigger--offscreen to whatever is below the
   fold; anything it never reaches — scripts blocked, observer unsupported — keeps the :not(...) rule and
   animates in immediately on load. A reveal effect must never be the reason a page is blank.
   The whole block sits inside prefers-reduced-motion: no-preference, so a visitor who asked their device
   for less movement gets the page with none of it. */
@media (prefers-reduced-motion: no-preference) {
  .anim-scroll .scroll-trigger.animate--fade-in,
  .anim-scroll .scroll-trigger.animate--slide-in { opacity: .01; }

  .anim-scroll .scroll-trigger.animate--slide-in { transform: translateY(2rem); }

  .anim-scroll .scroll-trigger:not(.scroll-trigger--offscreen).animate--fade-in {
    animation: jposFadeIn var(--duration-reveal) var(--ease-out-slow) forwards;
  }

  .anim-scroll .scroll-trigger:not(.scroll-trigger--offscreen).animate--slide-in {
    animation: jposSlideIn var(--duration-reveal) var(--ease-out-slow) forwards;
    /* --animation-order is set per card by theme.js, so a grid reveals left-to-right instead of all at
       once. Falls back to 0 for anything that is not part of a cascade. */
    animation-delay: calc(var(--animation-order, 0) * 75ms);
  }

  @keyframes jposSlideIn {
    from { transform: translateY(2rem); opacity: .01; }
    to { transform: translateY(0); opacity: 1; }
  }

  @keyframes jposFadeIn {
    from { opacity: .01; }
    to { opacity: 1; }
  }
}

/* Narrow ------------------------------------------------------------------- */

@media screen and (max-width: 989px) {
  .site-nav { display: none; }
}

@media screen and (max-width: 860px) {
  .checkout-layout { grid-template-columns: 1fr; gap: var(--space-6); }
  .checkout-summary { order: -1; }
}

@media screen and (max-width: 760px) {
  .product-page { grid-template-columns: 1fr; gap: var(--space-6); }
  .product-info { position: static; }
  .cart-item { grid-template-columns: 72px minmax(0, 1fr); }
  .cart-item__media { width: 72px; }
  .cart-item__actions { grid-column: 1 / -1; justify-items: stretch; }
  .cart-item__actions .cart-item__total { text-align: right; }
  .product-gallery__slide img { max-height: none; }
}

@media screen and (max-width: 720px) {
  .account-cards { grid-template-columns: 1fr; }
}

@media screen and (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
}
