/* PixelCam — template styles: Front page (is_front_page).
   Loaded after pixel-cam.css by ThemeHook (handle pixel-cam-template).
   Rules here are used ONLY on these screens; anything shared stays in pixel-cam.css.
   See templates/README.md before moving rules between files. */
.hero-grid{display:grid;grid-template-columns:1fr 320px;gap:16px;align-items:stretch}
.slider-controls{position:absolute;right:16px;bottom:14px;z-index:2;display:flex;align-items:center;gap:10px}
.slider-toggle{width:44px;height:44px;border:1px solid rgba(255,255,255,.55);border-radius:50%;background:rgba(20,20,20,.38);color:#fff;display:grid;place-items:center;cursor:pointer;backdrop-filter:blur(6px)}
.slider-toggle:hover{background:rgba(20,20,20,.62)}
.slider-toggle svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;grid-area:1/1}
.slider-toggle .icon-play{display:none}
/* Side banners define the hero height: each is a fixed 4:3, so two of them
   plus the gap set the column height — the slider then stretches to match. */
.hero-side{display:grid;grid-template-columns:1fr;gap:16px}
@media(max-width:900px){.hero-grid{grid-template-columns:1fr;gap:18px}.hero-side{grid-template-rows:none;grid-template-columns:1fr 1fr;gap:12px}
}
@media(max-width:560px){.hero-side{gap:10px}
}
/* Tiny phones: stack side banners 1-col so each gets full width + impact. */
@media(max-width:380px){.hero-side{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
}

/* ===== CATEGORY TILES ===== */
/* Section vertical rhythm is owned by `main > * { margin-block: 24px }`
   further down. A bare `section{padding:36-56px 0}` used to live here and
   silently broke that rhythm for every unclassed <section> (categories,
   blog, CTA) — those blocks were rendering with 56+24+56 ≈ 136px of total
   vertical air between them instead of the 24px the rest of the page
   sits on. The rule is removed; if a particular section ever needs more
   internal padding, add it scoped to that section's class. */
/* Top padding restores the air the section used to get from the old
   `section{padding:36-56px 0}` rule (since removed to fix the rhythm
   for unclassed sections). The vertical gap from the previous section
   to the heading now reads as: 24px (section margin) + this padding. */
.sec-head{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:24px;gap:16px;padding-top:clamp(24px,4vw,40px)}
.sec-head h2{font-size:clamp(20px,3vw,28px);font-weight:700;letter-spacing:-.01em}
.sec-head a{display:inline-flex;align-items:center;min-height:44px;font-size:14px;color:var(--accent);font-weight:600}
.sec-head a::after{content:" \2192"}
.sec-head a:hover{text-decoration:underline}
.tile{display:block;border:1px solid var(--border);border-radius:12px;overflow:hidden;background:var(--surface);transition:.15s;color:inherit;text-decoration:none}
.tile:hover{border-color:var(--accent);transform:translateY(-2px)}
.tile img{width:100%;height:150px;object-fit:contain;display:block;background:#fff}

/* ----- Category slider (home: "Danh mục nổi bật") ----- */
.cat-slider{position:relative;padding-inline:36px}
.cat-slider__track .tile{
  flex:0 0 220px
}
.cat-slider__nav{
  position:absolute;
  top:50%;
  width:44px;height:44px;
  border-radius:50%;
  background:var(--surface);
  border:1px solid var(--border);
  box-shadow:0 2px 8px rgba(0,0,0,.08);
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  color:var(--fg);
  /* Centred on the track at every breakpoint, no jump on hover.
     `top:50%` + `translateY(-50%)` keeps the button at the vertical
     middle of the slider regardless of tile height; the previous
     `top:90px` was a hardcoded offset that only lined up for one
     specific tile height, and the redundant `translateY(-50%)` on
     the :hover / --prev / --next rules caused the button to "jump"
     on hover because :hover (0,2,0) outranks --prev/--next (0,1,0)
     even when the transform value is the same. */
  transform:translateY(-50%);
  transition:opacity .15s,box-shadow .15s;
  z-index:2
}
.cat-slider__nav svg{width:18px;height:18px}
.cat-slider__nav:hover{box-shadow:0 4px 12px rgba(0,0,0,.12)}
/* Half-outside the slider so the button doesn't sit on top of the first
   / last card image. The 36px inline padding leaves a precise 4px gap after
   the 44px button's inside edge. */
.cat-slider__nav--prev{left:-12px}
.cat-slider__nav--next{right:-12px}
.cat-slider__nav{box-shadow:0 2px 8px rgba(0,0,0,.12)}
.cat-slider__nav[disabled]{opacity:0;pointer-events:none}
@media(max-width:640px){
  .cat-slider{padding:0}
  .cat-slider__nav{display:none}
  .cat-slider__track{gap:10px}
  .cat-slider__track .tile{flex:0 0 130px}
  .cat-slider__track .tile img{height:100px}
}
/* "Sản phẩm bán chạy" front-page grid — 5 cards per row on PC,
   2 per row on mobile (per product spec). Generic `.grid` rules
   above still handle the archive / search / shop loops. */
#productGrid{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:780px){#productGrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
}
@media(max-width:560px){#productGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
.brands-head{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:16px}
.brands-head .sec-head{margin-bottom:0}
.brand-carousel__viewport{overflow:hidden;margin-inline:-2px;padding:2px}
.brand-carousel__controls{display:none;align-items:center;gap:8px}
.brand-carousel__controls.is-visible{display:flex}
.brand-carousel__controls button{display:grid;place-items:center;width:40px;height:40px;padding:0;border:1px solid rgba(255,255,255,.48);border-radius:50%;background:transparent;color:#fff;cursor:pointer;transition:background-color .15s ease-out,border-color .15s ease-out,transform .15s ease-out}
.brand-carousel__controls button:hover{border-color:#fff;background:rgba(255,255,255,.12);transform:translateY(-1px)}
.brand-carousel__controls button:focus-visible{outline:2px solid #fff;outline-offset:3px}
.brand-carousel__controls button:active{transform:translateY(0)}
.brand-carousel__controls svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.8}
.brand-carousel.is-ready .brand-grid{display:flex;gap:var(--brand-gap);transform:translate3d(0,0,0);transition:transform .42s cubic-bezier(.22,.61,.36,1);will-change:transform}
.brand-carousel.is-ready:not(.is-overflowing) .brand-grid{justify-content:flex-start}
.brand-carousel__controls button[disabled]{opacity:.45;cursor:default;pointer-events:none}
@media(max-width:560px){
  .brands-head{align-items:flex-end;gap:12px}
  .brand-carousel__controls{gap:6px}
  .brand-carousel__controls button{width:36px;height:36px}
}
@media(prefers-reduced-motion:reduce){
  .brand-carousel.is-ready .brand-grid{transition:none}
}

/* ===== HOMEPAGE STORE NETWORK ===== */
.home-stores{--store-visible:3;background:var(--brand-secondary);border:0;color:#fff;padding-block:clamp(28px,4vw,48px)}
.home-stores__top{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:28px}
.home-stores__head{flex:1;max-width:760px;margin:0 auto;text-align:center}
.home-stores__eyebrow{font-family:var(--mono);font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:rgba(255,255,255,.72);margin-bottom:8px}
.home-stores__head h2{font-size:clamp(24px,3.2vw,36px);font-weight:700;letter-spacing:-.02em;line-height:1.15;color:#fff}
.home-stores__head p{max-width:66ch;margin:12px auto 0;color:rgba(255,255,255,.78);font-size:15px;line-height:1.6}
.home-stores__controls{display:none;align-items:center;gap:8px;flex-shrink:0}
.home-stores__controls.is-visible{display:flex}
.home-stores__controls button{display:grid;place-items:center;width:40px;height:40px;padding:0;border:1px solid rgba(255,255,255,.48);border-radius:50%;background:transparent;color:#fff;cursor:pointer;transition:background-color .15s ease-out,border-color .15s ease-out,transform .15s ease-out}
.home-stores__controls button:hover{border-color:#fff;background:rgba(255,255,255,.12);transform:translateY(-1px)}
.home-stores__controls button:focus-visible{outline:2px solid #fff;outline-offset:3px}
.home-stores__controls button:active{transform:translateY(0)}
.home-stores__controls button[disabled]{opacity:.45;cursor:default;pointer-events:none}
.home-stores__controls svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.8}
.home-stores__viewport{overflow:hidden;margin-inline:-2px;padding:2px}
.home-stores__grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}
.home-stores__carousel.is-ready .home-stores__grid{display:flex;gap:24px;transform:translate3d(0,0,0);transition:transform .42s cubic-bezier(.22,.61,.36,1);will-change:transform}
.home-stores__carousel.is-ready .home-store-card{flex:0 0 var(--home-store-slide-width);min-width:0}
.home-store-card{display:flex;min-width:0;flex-direction:column;overflow:hidden;border:1px solid rgba(255,255,255,.28);border-radius:12px;background:var(--surface);color:var(--fg);box-shadow:0 8px 24px rgba(0,0,0,.12)}
.home-store-card__image{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;background:#f2f2f2}
.home-store-card__body{display:flex;flex:1;flex-direction:column;gap:16px;padding:20px}
.home-store-card h3{font-size:18px;font-weight:700;line-height:1.3;letter-spacing:-.01em}
.home-store-card__info{display:flex;flex-direction:column;gap:11px;color:#3d3d3d;font-size:14px;line-height:1.5}
.home-store-card__row{display:grid;grid-template-columns:20px minmax(0,1fr);gap:9px;align-items:start}
.home-store-card__row svg{width:18px;height:18px;margin-top:1px;fill:none;stroke:var(--brand-secondary);stroke-linecap:round;stroke-linejoin:round;stroke-width:1.6}
.home-store-card__row a{color:var(--brand-secondary);font-weight:600;text-decoration:none}
.home-store-card__row a:hover{text-decoration:underline;text-underline-offset:3px}
.home-store-card__actions{margin-top:auto;padding-top:16px;border-top:1px solid var(--border)}
.home-store-card__map{display:inline-flex;align-items:center;gap:7px;color:var(--accent);font-size:13px;font-weight:700;text-decoration:none}
.home-store-card__map:hover{text-decoration:underline;text-underline-offset:3px}
.home-store-card__map svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.8}
@media(max-width:1024px){
  .home-stores{--store-visible:2}
  .home-stores__grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .home-stores__carousel.is-ready .home-stores__grid{gap:20px}
}
@media(max-width:640px){
  .home-stores{--store-visible:1}
  .home-stores__top{align-items:flex-end;margin-bottom:22px}
  .home-stores__grid{grid-template-columns:minmax(0,1fr);gap:16px}
  .home-stores__carousel.is-ready .home-stores__grid{gap:16px}
  .home-store-card__body{padding:18px}
}
@media(prefers-reduced-motion:reduce){
  .home-stores__carousel.is-ready .home-stores__grid,.home-stores__controls button{transition:none}
}

/* ===== HOMEPAGE BLOG TEASER ===== */
.home-blog{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:28px;align-items:stretch}
@media(max-width:900px){.home-blog{grid-template-columns:minmax(0,1fr);gap:22px}
}

.hb-lead{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--border);border-radius:14px;overflow:hidden;transition:.15s}
.hb-lead:hover{border-color:var(--accent)}
/* Lead image: 16:9 wrapper holds the aspect, img fills it. Consistent with
   blog archive featured + post-cover so the whole site has one rhythm. */
.hb-lead__img{display:block;aspect-ratio:16/9;overflow:hidden;background:#f2f2f2}
.hb-lead__img img{width:100%;height:100%;object-fit:cover;display:block}
.hb-lead h3{font-size:22px;font-weight:700;line-height:1.28;letter-spacing:-.01em;margin:0}
.hb-lead h3 a{color:var(--fg);text-decoration:none}
.hb-lead h3 a:hover{color:var(--accent)}
.hb-lead p{color:var(--muted);font-size:14.5px;line-height:1.6;margin:0}

.hb-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:14px;height:100%;justify-content:space-between}
.hb-list li{display:grid;grid-template-columns:130px minmax(0,1fr);gap:0;background:var(--surface);border:1px solid var(--border);border-radius:12px;overflow:hidden;transition:.15s;align-items:stretch}
.hb-list li:hover{border-color:var(--accent)}
/* List post thumbnail: fills the 130px column, cover, full row height. */
.hb-list li img{grid-row:1;grid-column:1;width:130px;height:100%;min-height:96px;object-fit:cover;display:block;background:#f2f2f2}
/* Keep the text block in column 2 even when a post has no thumbnail. */
.hb-list li .meta-block{grid-column:2}
.hb-list .meta-block{padding:13px 16px;display:flex;flex-direction:column;gap:6px;min-width:0;justify-content:center}
.hb-list h4{font-size:14.5px;font-weight:600;line-height:1.38;margin:0}
.hb-list h4 a{color:var(--fg);text-decoration:none;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.hb-list h4 a:hover{color:var(--accent)}
.hb-list small{color:var(--muted);font-size:12px;font-family:var(--mono)}
@media(max-width:600px){.hb-list li{grid-template-columns:100px minmax(0,1fr)}.hb-list h4{font-size:14px}
}
.homepage-cb-slot{position:relative;min-height:320px;contain:layout style}
.homepage-cb-slot[data-loaded="1"]{min-height:0;contain:content}
.homepage-cb-skeleton{margin-block:32px}
.homepage-cb-skeleton-head{height:32px;width:clamp(180px,30%,320px);border-radius:8px;background:linear-gradient(90deg,var(--bg,#f5f5f5) 0%,var(--border,#e6e6e6) 50%,var(--bg,#f5f5f5) 100%);background-size:200% 100%;margin-bottom:24px}
.homepage-cb-skeleton-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px}
.homepage-cb-skeleton-card{aspect-ratio:1/1.4;border-radius:12px;background:linear-gradient(90deg,var(--bg,#f5f5f5) 0%,var(--border,#e6e6e6) 50%,var(--bg,#f5f5f5) 100%);background-size:200% 100%}
.homepage-cb-slot.is-loading .homepage-cb-skeleton-head,.homepage-cb-slot.is-loading .homepage-cb-skeleton-card{animation:pxc-hcb-shimmer 1.4s linear infinite}
.homepage-cb-slot.is-loading::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.04) 50%,transparent 100%);background-size:200% 100%;animation:pxc-hcb-shimmer 1.4s linear infinite}
.homepage-cb-block{margin-block-end:56px}
.homepage-cb-block .sec-head h2{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.homepage-cb-icon{width:32px;height:32px;object-fit:contain;flex-shrink:0;border-radius:6px}
.homepage-cb-heading-text{flex:0 1 auto}
.homepage-cb-error{padding:32px 24px;text-align:center;border:1px solid var(--border,#e6e6e6);border-radius:12px;color:var(--accent,#666);background:var(--bg,#fafafa)}
.homepage-cb-error p{margin:0 0 12px}
.homepage-cb-retry{padding:8px 16px;border:1px solid var(--border,#d4d4d4);border-radius:8px;background:#fff;color:inherit;cursor:pointer;font:inherit}
.homepage-cb-retry:hover{background:var(--bg,#f5f5f5)}
@media (prefers-reduced-motion:reduce){.homepage-cb-skeleton-head,.homepage-cb-skeleton-card,.homepage-cb-slot.is-loading::after{animation:none}
}
@media (max-width:1024px){.homepage-cb-skeleton-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:640px){.homepage-custom-blocks{margin-block:32px}.homepage-cb-slot{min-height:240px}.homepage-cb-skeleton-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.homepage-cb-block{margin-block-end:40px}.homepage-cb-icon{width:24px;height:24px}
}

/* ====================================================================
 * Section banner (full-width marketing image below each front-page
 * section, except Hero). Banner.php is the only writer; this is the
 * matching presentation.
 * ==================================================================== */
.sec-banner{display:block;margin-block:32px;line-height:0}
.sec-banner picture{display:block}.sec-banner img{width:100%;height:auto;display:block;border-radius:12px}
a.sec-banner{cursor:pointer;transition:transform .2s var(--motion-fast, ease),opacity .2s var(--motion-fast, ease)}
a.sec-banner:hover{opacity:.92;transform:translateY(-1px)}
a.sec-banner:focus-visible{outline:2px solid var(--brand-primary, currentColor);outline-offset:4px;border-radius:12px}
@media (max-width:640px){.sec-banner{margin-block:20px}.sec-banner img{border-radius:8px}
}