/* ============================================================
   Homepage catalog grid

   Loaded ONLY on "/" — shop.css (which owns the global reset and
   its own .card/.price rules) is deliberately not linked there.

   Tokens live on :root and card rules are scoped to .hs-grid, NOT
   to #home-shop. The homepage now renders product grids in three
   places (catalog, Top Ranking, New Arrival) and only the first is
   inside #home-shop — scoping to the section left the other two
   completely unstyled.
   Palette mirrors shop.css / the landing page.
   ============================================================ */

:root {
    --hs-ink:    #0f172a;
    --hs-slate:  #475569;
    --hs-muted:  #94a3b8;
    --hs-line:   #e2e8f0;
    --hs-white:  #ffffff;
    --hs-accent: #a56565;
    --hs-warn:   #d97706;
    --hs-bad:    #dc2626;
    --hs-radius: 16px;
    --hs-shadow-md: 0 8px 24px rgba(15, 23, 42, .08);
}

/* --- product grid --- */
.hs-grid {
    display: grid; gap: 1.4rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* --- card (mirrors shop.css, scoped to the grid so it cannot clash) --- */
.hs-grid .card {
    background: var(--hs-white); border: 1px solid var(--hs-line);
    border-radius: var(--hs-radius); overflow: hidden; margin: 0;
    display: flex; flex-direction: column; transition: .22s;
}
.hs-grid .card:hover {
    border-color: var(--hs-accent);
    transform: translateY(-4px);
    box-shadow: var(--hs-shadow-md);
}
.hs-grid .card-media {
    aspect-ratio: 4 / 3;
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
    display: grid; place-items: center; position: relative; overflow: hidden;
}
.hs-grid .card-media img { width: 100%; height: 100%; object-fit: cover; }
.hs-grid .card-flag {
    position: absolute; top: .7rem; left: .7rem; z-index: 1;
    background: var(--hs-ink); color: #fff; font-size: .66rem; font-weight: 700;
    padding: .22rem .6rem; border-radius: 30px;
    letter-spacing: .05em; text-transform: uppercase;
}
.hs-grid .card-flag.sale { background: var(--hs-accent); }
.hs-grid .card-body {
    padding: 1.1rem 1.1rem 1.2rem; display: flex; flex-direction: column;
    gap: .5rem; flex: 1;
}
.hs-grid .card-cat {
    font-size: .7rem; font-weight: 600; color: var(--hs-accent);
    letter-spacing: .07em; text-transform: uppercase;
}
.hs-grid .card-title { font-size: .98rem; font-weight: 600; line-height: 1.35; margin: 0; }
.hs-grid .card-title a { color: var(--hs-ink); }
.hs-grid .card-title a:hover { color: var(--hs-accent); }
.hs-grid .card-desc { font-size: .82rem; color: var(--hs-slate); flex: 1; margin: 0; }
.hs-grid .card-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: .6rem; margin-top: .3rem; flex-wrap: wrap;
}
.hs-grid .price { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; }
.hs-grid .price-now { font-size: 1.15rem; font-weight: 700; color: var(--hs-ink); }
.hs-grid .price-was { font-size: .82rem; color: var(--hs-muted); text-decoration: line-through; }
.hs-grid .badge {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .72rem; font-weight: 600; padding: .25rem .65rem; border-radius: 30px;
}
.hs-grid .badge-low { background: #fffbeb; color: var(--hs-warn); }
.hs-grid .badge-out { background: #fef2f2; color: var(--hs-bad); }

/* the landing page already defines .btn / .btn-primary — only add sizes.
   Scoped to the grid so it never reaches the contact / hero buttons. */
.hs-grid .btn-sm { padding: .42rem .9rem; font-size: .8rem; border-radius: 8px; }

/* --- responsive --- */
@media (max-width: 900px) {
    .hs-grid { gap: 1.1rem; }
}
@media (max-width: 620px) {
    .hs-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
    .hs-grid .card-body { padding: .85rem .85rem .95rem; gap: .4rem; }
    .hs-grid .card-title { font-size: .9rem; }
    .hs-grid .price-now { font-size: 1.02rem; }
    .hs-grid .btn-sm { padding: .45rem .75rem; font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
    .hs-grid .card { transition: none; }
    .hs-grid .card:hover { transform: none; }
}
