/* =====================================================================
   Home Page (首页) - home.css  v1.0.0
   ---------------------------------------------------------------------
   Scope:  .home-page  (wraps the whole homepage in home/index.blade.php)
   Authority: DESIGN_SPEC.md (全站 UI 设计规范)
     - 零 Bootstrap 类（§2-2 红线）：容器/网格/工具类全部作用域类 + 原生
       Grid/Flex 手写，Bootstrap 的 .container/.row/.col-* 已从 blade 移除
     - 页面背景 --o-bg（§2-8 红线）
     - 容器几何 content-box + 三档 max-width（§2-9 红线）
     - 商品卡严格按 §6.4（白卡 / 1px --o-line / 移动圆角 / 轻阴影 / 图
       aspect 1:1 + 白底 §6.16 / title 14px·600 两行 / price 18px·700
       --o-accent + 划线原价 12px / 加购 44×44 圆钮 active 蓝底白字）
   Tokens: --o-* from base-tokens.css (global, single source).
   Mobile (≤991px): §6.4 compliant borderless white card, --o-* tokens only.
   Card styling is the SHARED standard in product-card.css (.product-card).
   ZERO Bootstrap classes. ZERO legacy class names (§2-11). ZERO --cr-* tokens.
   ===================================================================== */

/* ---------- 1. scope root: tokens + reset + bg (§2-8) ---------- */
.home-page {
  /* tokens now from base-tokens.css (:root) — do not redefine */
  background: var(--o-bg);          /* §2-8 页面背景统一 */
}
.home-page *,
.home-page *::before,
.home-page *::after { box-sizing: border-box; }

/* ---------- 2. container geometry (§2-9: content-box + 3-tier max-width) ---------- */
.home-page__inner {
  width: 100%;
  margin: 0 auto;
  padding: 36px 10px 48px;          /* §2-9 基准 padding */
  max-width: 1180px;                /* ≥1200 */
}
@media (min-width: 1300px) { .home-page__inner { max-width: 1280px; } }
@media (min-width: 1400px) { .home-page__inner { max-width: 1380px; } }

/* sections already carry their own vertical padding (.section / .hero-area /
   .trending-product / .shipping-info); the inner only handles horizontal
   centering, so zero out its vertical padding inside those sections. */
.home-page .hero-area > .home-page__inner,
.home-page .trending-product > .home-page__inner,
.home-page .shipping-info > .home-page__inner {
  padding-top: 0;
  padding-bottom: 0;
}

/* ---------- 3. Trending product grid (native Grid, replaces col-*) ---------- */
/* desktop 4 cols  |  ≤991 2 cols (matches col-lg-3 / col-md-6 / col-sm-6) */
.product-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 20px;
  row-gap: 30px;                    /* main.css card margin-bottom:30px */
}
@media (max-width: 991px) {
  .product-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 10px;               /* mobile.css col padding 5px*2 */
    row-gap: 8px;                   /* mobile.css card margin-top:8px */
  }
}

/* =====================================================================
   5. MOBILE (≤991px) - §6.4 compliant product card
   Borderless white card, --o-* tokens only (no --cr-*).
   ===================================================================== */
@media (max-width: 991px) {
  /* container horizontal padding (replicates mobile.css .container) */
  .home-page__inner { padding-left: 12px; padding-right: 12px; }

  /* trending section-title mobile tweaks (replicates mobile.css) */
  .home-page .trending-product .section-title {
    padding: 0;
    margin: 0 0 12px;
  }
  .home-page .trending-product .section-title h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0;
    padding: 0;
  }
  .home-page .trending-product .section-title h2::before { display: none; }

  /* staggered fade-in on cards (replaces .home-prod-cell crFadeUp) */
  .home-page .product-card-grid > .product-card {
    animation: productCardFadeUp .4s cubic-bezier(.4, 0, .2, 1) both;
  }
  .home-page .product-card-grid > .product-card:nth-child(1) { animation-delay: .04s; }
  .home-page .product-card-grid > .product-card:nth-child(2) { animation-delay: .08s; }
  .home-page .product-card-grid > .product-card:nth-child(3) { animation-delay: .12s; }
  .home-page .product-card-grid > .product-card:nth-child(4) { animation-delay: .16s; }
  .home-page .product-card-grid > .product-card:nth-child(5) { animation-delay: .20s; }
  .home-page .product-card-grid > .product-card:nth-child(6) { animation-delay: .24s; }
  .home-page .product-card-grid > .product-card:nth-child(7) { animation-delay: .28s; }
  .home-page .product-card-grid > .product-card:nth-child(8) { animation-delay: .32s; }

  /* card styling (shell, image, title, price, cart) is the SHARED standard
     in product-card.css (.product-card + .product-card-*). */

/* =====================================================================
   6. REDUCED MOTION
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .home-page .product-card,
  .home-page .product-card__img img,
  .home-page .product-card-grid > .product-card {
    transition: none !important;
    animation: none !important;
  }
  .home-page .product-card:hover .product-card__img img { transform: none; }
}
