/* ============================================================
   ShopKit 2026 — home.css
   Front page sections only (is_front_page). Loaded last.

   Contents
   01. Scroll reveal (.sk-section → .is-inview)
   02. Hero (.sk-hero)
   03. Trust row (.sk-trust)
   04. Section scaffolding (.sk-section / .sk-section-head)
   05. Categories (.sk-cats)
   06. Featured / Best sellers (.sk-featured)
   07. Reviews (.sk-reviews)
   08. FAQ accordion (.sk-faq)
   09. CTA banner (.sk-cta)
   10. Story (.sk-story)
   11. Responsive
   12. Reduced motion
   ============================================================ */

/* ============================================================
   01. SCROLL REVEAL
   Sections start hidden + nudged down; theme.js adds .is-inview
   ============================================================ */
.sk-section {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s var(--sk-ease), transform .55s var(--sk-ease);
  will-change: opacity, transform;
}
.sk-section.is-inview {
  opacity: 1;
  transform: none;
}

/* ============================================================
   02. HERO — two columns, left copy / right framed image
   ============================================================ */
.sk-hero {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(196, 86, 46, .08), transparent 60%),
    var(--sk-bg);
  padding: 64px 0 72px;
}
.sk-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}
.sk-hero-content,
.sk-cta-content,
.sk-story-content { min-width: 0; }

.sk-hero-eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sk-primary);
  margin: 0 0 14px;
}
.sk-hero-title {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.12;
  margin: 0 0 18px;
}
.sk-hero-subtitle {
  font-size: 17px;
  line-height: 1.7;
  color: var(--sk-muted);
  margin: 0 0 28px;
  max-width: 32em;
}
.sk-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.sk-hero-badges {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.sk-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sk-muted);
}
.sk-hero-badge svg { stroke: var(--sk-primary); fill: none; }

/* Visual side — image in a big rounded terracotta-gradient frame */
.sk-hero-visual { position: relative; min-width: 0; }
.sk-hero-frame {
  border-radius: 28px;
  padding: 14px;
  background: linear-gradient(155deg, var(--sk-primary) 0%, #D97A45 55%, var(--sk-accent-2) 115%);
  box-shadow: 0 24px 60px rgba(168, 69, 31, .28);
}
.sk-hero-frame img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 18px;
  display: block;
}

/* Floating white chip, tucked under the frame's left edge */
.sk-hero-chip {
  position: absolute;
  left: -14px;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--sk-surface);
  border: 1px solid var(--sk-border);
  border-radius: var(--sk-radius);
  box-shadow: var(--sk-shadow);
  padding: 13px 18px;
}
.sk-hero-chip svg {
  width: 26px;
  height: 26px;
  fill: var(--sk-accent-2);
  stroke: none;
  flex-shrink: 0;
}
.sk-hero-chip strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--sk-ink);
  line-height: 1.2;
}
.sk-hero-chip span {
  font-size: 12px;
  color: var(--sk-muted);
}

/* Placeholder when no hero image is configured */
.sk-hero-placeholder {
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  border: 2px dashed var(--sk-border);
  background: var(--sk-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--sk-muted);
  font-size: 13px;
}
.sk-hero-placeholder svg {
  width: 54px;
  height: 54px;
  stroke: var(--sk-border);
  fill: none;
}

/* ============================================================
   03. TRUST ROW (under hero)
   ============================================================ */
.sk-trust { padding: 8px 0 4px; }
.sk-trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  background: var(--sk-surface);
  border: 1px solid var(--sk-border);
  border-radius: var(--sk-radius);
  box-shadow: var(--sk-shadow);
  padding: 10px 22px;
}
.sk-trust-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}
.sk-trust-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F7ECDF;
  color: var(--sk-primary);
}
.sk-trust-icon svg { stroke: currentColor; fill: none; }
.sk-trust-item strong {
  display: block;
  font-family: var(--sk-font-display);
  font-size: 14.5px;
  color: var(--sk-ink);
  margin-bottom: 2px;
}
.sk-trust-item span:last-child {
  font-size: 12.5px;
  color: var(--sk-muted);
}

/* ============================================================
   04. SECTION SCAFFOLDING
   ============================================================ */
.sk-section { padding: 64px 0; }
.sk-section-head { margin-bottom: 34px; }
.sk-section-head--row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.sk-section-title {
  font-size: clamp(24px, 3.2vw, 34px);
  margin: 0 0 6px;
}
.sk-section-sub {
  font-size: 14.5px;
  color: var(--sk-muted);
  margin: 0;
}
.sk-section-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--sk-primary);
  white-space: nowrap;
  padding-bottom: 4px;
}
.sk-section-link:hover { color: var(--sk-primary-ink); }

/* ============================================================
   05. CATEGORIES
   Desktop: 4 columns (auto-fit when fewer); image above,
   arrow nudges right on hover
   ============================================================ */
.sk-cats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
/* Fewer categories → stretch to fill, still one row */
.sk-cats-grid:has(:nth-child(3)) { grid-template-columns: repeat(3, 1fr); }
.sk-cats-grid:has(:nth-child(2)):not(:has(:nth-child(3))) { grid-template-columns: repeat(2, 1fr); }

/* Fallback for browsers without :has — auto-fit balances any count */
@supports not selector(:has(*)) {
  .sk-cats-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

/* ---------- Desktop mosaic: first category becomes a large tile ---------- */
@media (min-width: 901px) {
  /* exactly 4 → 2x2 hero tile + small tile + wide tile */
  .sk-cats-grid:has(:nth-child(4)):not(:has(:nth-child(5))) {
    grid-template-columns: 2fr 1fr 1fr;
  }
  .sk-cats-grid:has(:nth-child(4)):not(:has(:nth-child(5))) .sk-cat-card--1 { grid-column: 1; grid-row: 1 / 3; }
  .sk-cats-grid:has(:nth-child(4)):not(:has(:nth-child(5))) .sk-cat-card--4 { grid-column: 2 / 4; }

  /* 5-6 → 4 columns, first tile spans 2x2 */
  .sk-cats-grid:has(:nth-child(5)) {
    grid-template-columns: repeat(4, 1fr);
  }
  .sk-cats-grid:has(:nth-child(5)) .sk-cat-card--1 {
    grid-column: span 2;
    grid-row: span 2;
  }

  .sk-cats-grid .sk-cat-card--1 .sk-cat-thumb {
    aspect-ratio: auto;
    flex: 1 1 auto;
  }
  .sk-cats-grid .sk-cat-card--1 .sk-cat-name { font-size: 20px; }
}

.sk-cat-card {
  display: flex;
  flex-direction: column;
  background: var(--sk-surface);
  border: 1px solid var(--sk-border);
  border-radius: var(--sk-radius);
  overflow: hidden;
  transition: transform .2s var(--sk-ease), box-shadow .2s var(--sk-ease), border-color .2s;
}
.sk-cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sk-shadow);
  border-color: #DFD3C3;
}
.sk-cat-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #F3EDE4;
}
.sk-cat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--sk-ease);
}
.sk-cat-card:hover .sk-cat-thumb img { transform: scale(1.06); }
.sk-cat-thumb-placeholder {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(196, 86, 46, .18), transparent 55%),
    radial-gradient(120% 120% at 100% 100%, rgba(245, 158, 11, .2), transparent 55%),
    #F1E8DC;
}
/* Position modifiers — slight warm hue shift per card */
.sk-cat-card--1 .sk-cat-thumb-placeholder {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(196, 86, 46, .22), transparent 55%),
    #F2E9DD;
}
.sk-cat-card--2 .sk-cat-thumb-placeholder {
  background:
    radial-gradient(120% 120% at 0% 100%, rgba(245, 158, 11, .25), transparent 55%),
    #F4EBDD;
}
.sk-cat-card--3 .sk-cat-thumb-placeholder {
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(47, 125, 91, .16), transparent 55%),
    #F0E9DF;
}
.sk-cat-card--4 .sk-cat-thumb-placeholder {
  background:
    radial-gradient(120% 120% at 100% 100%, rgba(196, 86, 46, .2), transparent 50%),
    radial-gradient(90% 90% at 0% 0%, rgba(245, 158, 11, .14), transparent 55%),
    #F1E7D9;
}
.sk-cat-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  min-width: 0;
}
.sk-cat-name {
  font-size: 16.5px;
  margin: 0;
  color: var(--sk-ink);
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sk-cat-card:hover .sk-cat-name { color: var(--sk-primary-ink); }
.sk-cat-count {
  font-size: 12px;
  color: var(--sk-muted);
  white-space: nowrap;
}
.sk-cat-arrow {
  margin-left: auto;
  color: var(--sk-primary);
  font-size: 16px;
  line-height: 1;
  transition: transform .2s var(--sk-ease);
  flex-shrink: 0;
}
.sk-cat-card:hover .sk-cat-arrow { transform: translateX(5px); }

/* ============================================================
   06. FEATURED / BEST SELLERS
   ul.products is the Woo grid → 4 cols desktop / 2 cols mobile
   ============================================================ */
/*
 * auto-fit + 240px 下限：列数由可用宽度决定，而不是固定 3/4 列。
 *
 * 之前是固定 repeat(3) → :has(4个以上) 时 repeat(4)，没有宽度下限：
 * 窗口在 ~900-1100px 时 4 列会把卡片压到 ~200px，卡内正文只剩 ~160px，
 * 放不下 "Select options"（≈154px），于是按钮文字换行、border-radius:999px
 * 的胶囊被撑成椭圆"blob"，分类标签也跟着换两行 —— 就是截图里的错位变形。
 *
 * 240px 下限保证卡内正文 ≥ 200px，按钮一行放得下；商品不足一行时
 * auto-fit 自动收成实际列数（原来的 :has 那套不再需要）。
 */
.sk-featured-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)) !important;
  gap: 22px !important;
}
.sk-featured .product-body { padding: 16px 18px 18px; }
.sk-featured .product-price { margin-top: auto; }
.sk-featured .product-rating { min-height: 18px; }

/* ============================================================
   07. REVIEWS — three cards
   ============================================================ */
.sk-reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.sk-review-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--sk-surface);
  border: 1px solid var(--sk-border);
  border-radius: var(--sk-radius);
  padding: 26px 24px;
  transition: transform .2s var(--sk-ease), box-shadow .2s var(--sk-ease);
}
.sk-review-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sk-shadow);
}
.sk-review-quote-icon {
  color: var(--sk-primary);
  opacity: .35;
  margin-bottom: 10px;
}
.sk-review-quote-icon svg { fill: currentColor; stroke: none; }
.sk-review-card .stars { margin-bottom: 12px; }
.sk-review-text {
  margin: 0 0 18px;
  font-family: var(--sk-font-display);
  font-size: 15.5px;
  line-height: 1.7;
  color: #4A4239;
  flex: 1;
}
.sk-review-meta {
  display: flex;
  align-items: center;
  gap: 11px;
}
.sk-review-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--sk-primary);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sk-review-meta strong {
  display: block;
  font-size: 14px;
  color: var(--sk-ink);
  line-height: 1.3;
}
.sk-review-meta em {
  font-style: normal;
  font-size: 12px;
  color: var(--sk-muted);
}

/* ============================================================
   08. FAQ — centered column, details/summary accordion
   ============================================================ */
.sk-faq-wrap { max-width: 820px; }
.sk-faq .sk-section-head { text-align: center; }
.sk-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sk-faq-item {
  background: var(--sk-surface);
  border: 1px solid var(--sk-border);
  border-radius: var(--sk-radius-sm);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.sk-faq-item[open] {
  border-color: rgba(196, 86, 46, .4);
  box-shadow: var(--sk-shadow);
}
.sk-faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  cursor: pointer;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--sk-ink);
  list-style: none;
}
.sk-faq-question::-webkit-details-marker { display: none; }
.sk-faq-question:hover { color: var(--sk-primary-ink); }
.sk-faq-chevron {
  stroke: var(--sk-muted);
  fill: none;
  flex-shrink: 0;
  transition: transform .25s var(--sk-ease), stroke .2s;
}
.sk-faq-item[open] .sk-faq-question { color: var(--sk-primary-ink); }
.sk-faq-item[open] .sk-faq-chevron {
  transform: rotate(180deg);
  stroke: var(--sk-primary);
}
.sk-faq-answer {
  padding: 0 20px 18px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--sk-muted);
}
.sk-faq-answer p { margin: 0 0 .8em; }
.sk-faq-answer p:last-child { margin-bottom: 0; }
.sk-faq-answer a {
  color: var(--sk-primary-ink);
  text-decoration: underline;
}

/* ============================================================
   09. CTA BANNER — dark ink rounded banner with inline form
   ============================================================ */
.sk-cta { padding: 12px 0 36px; }
.sk-cta-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 36px;
  align-items: center;
  background:
    radial-gradient(700px 300px at 90% 0%, rgba(196, 86, 46, .35), transparent 60%),
    var(--sk-ink);
  border-radius: 24px;
  padding: 48px 52px;
  box-shadow: 0 24px 60px rgba(31, 27, 22, .25);
}
.sk-cta-title {
  font-size: clamp(22px, 2.8vw, 30px);
  color: var(--sk-footer-head);
  margin: 0 0 8px;
}
.sk-cta-sub {
  font-size: 14.5px;
  color: var(--sk-footer-text);
  margin: 0;
}
.sk-cta-form {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  margin-left: auto;
}
.sk-cta-form input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 15px 20px;
  border-radius: 999px;
  border: 1px solid rgba(233, 225, 214, .25);
  background: rgba(255, 255, 255, .07);
  color: #fff;
  font-size: 14.5px;
}
.sk-cta-form input[type="email"]::placeholder { color: rgba(207, 196, 182, .65); }
.sk-cta-form input[type="email"]:focus {
  outline: none;
  border-color: var(--sk-accent-2);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .18);
}
.sk-cta-form button {
  padding: 15px 28px;
  border: none;
  border-radius: 999px;
  background: var(--sk-primary);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.sk-cta-form button:hover { background: var(--sk-primary-ink); }

/* ============================================================
   10. STORY — image left, copy right
   ============================================================ */
.sk-story-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 56px;
  align-items: center;
}
.sk-story-visual img,
.sk-story-placeholder {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: var(--sk-shadow);
}
.sk-story-placeholder {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(196, 86, 46, .22), transparent 55%),
    radial-gradient(120% 120% at 100% 100%, rgba(245, 158, 11, .25), transparent 55%),
    #EFE5D8;
}
.sk-story-eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sk-primary);
  margin: 0 0 12px;
}
.sk-story-heading {
  font-size: clamp(24px, 3.4vw, 36px);
  margin: 0 0 14px;
}
.sk-story-body {
  font-size: 16px;
  line-height: 1.8;
  color: var(--sk-muted);
  margin: 0 0 24px;
}

/* ============================================================
   11. RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sk-hero { padding: 40px 0 64px; }
  .sk-hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .sk-hero-visual { max-width: 480px; margin: 0 auto; }
  .sk-hero-chip { left: 8px; }
  .sk-story-inner { grid-template-columns: 1fr; gap: 36px; }
  .sk-featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .sk-cats-grid,
  .sk-cats-grid:has(:nth-child(3)) { grid-template-columns: repeat(2, 1fr); }
  .sk-reviews-grid { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
  .sk-section { padding: 48px 0; }
  .sk-cta-inner { padding: 36px 28px; }
}

@media (max-width: 600px) {
  .sk-cta-inner { grid-template-columns: 1fr; gap: 24px; }
  .sk-cta-form { margin-left: 0; flex-direction: column; }
  .sk-cta-form button { width: 100%; }
  .sk-hero-actions .sk-btn { flex: 1 1 auto; justify-content: center; }
  .sk-trust-grid { padding: 4px 16px; }
  .sk-featured-grid { gap: 12px !important; }
  .sk-cats-grid { gap: 12px; }
}

/* ============================================================
   12. REDUCED MOTION — switch everything off
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sk-section {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .sk-section.is-inview { transform: none; }
  .sk-hero-frame img,
  .sk-cat-card,
  .sk-cat-thumb img,
  .sk-cat-arrow,
  .sk-review-card,
  .sk-faq-chevron,
  .free-ship-fill,
  .sk-btn,
  .sk-btn--primary svg {
    transition: none !important;
  }
  .sk-cat-card:hover,
  .sk-review-card:hover,
  .sk-cat-card:hover .sk-cat-thumb img,
  .sk-cat-card:hover .sk-cat-arrow,
  .sk-btn--primary:hover svg,
  .sk-faq-item[open] .sk-faq-chevron {
    transform: none !important;
  }
}
