/* ═══════════════════════════════════════════════════════════════════════
   PAGE-SPECIFIC — Index.cshtml (home page) only
   Hero slider (promotional banners) + benefits strip. Loaded after
   components.css and layout.css (see _Layout.cshtml's
   @RenderSection("Styles") position), so these rules compose the same
   tokens without ever redeclaring them. Additive only — the existing
   catalog grid/filters/pagination in layout.css are untouched.
   Store-redesign S1 (2026-08-24) + S2 banner-to-hero move (2026-08-25),
   founder-supplied MIZA comp.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Hero slider — MERCHANT-MANAGED banners (D493, ط-25/ط-9), read live from
   ECM.StoreBanners (Index.cshtml.cs → IErpCatalogClient.GetBannersAsync). Rewritten
   2026-08-25 from the old fixed-3-slide keyframe crossfade to a class-toggle
   transition, because the slide COUNT is now merchant-chosen (0/1/N) — keyframe
   percentages can only express a count baked in at build time. hero-banner.js adds
   `.is-active` to exactly one `.hero-slider__slide` (and one `.hero-slider__dot`) at
   a time; this stylesheet only defines what that class LOOKS like. Zero banners ⇒
   Index.cshtml renders no <section> at all — nothing here fires. One banner ⇒
   the section renders one slide with `.is-active` and no dots; hero-banner.js no-ops.
   ─────────────────────────────────────────────────────────────────────────── */

/* Vertical rhythm, tightened 2026-08-25 on founder feedback ("الهوامش كبيره").
   ONE ladder for the whole page: section top = --space-4, section bottom = --space-2,
   card interior = --space-4. */
.hero-slider { padding-block: 0; }

/* Ratio matches the founder's supplied banner artwork (measured 2026-08-25:
   1518x350 to 1519x329, i.e. ~4.3:1-4.6:1) — a merchant uploading a different
   aspect ratio still gets object-fit:cover inside this same frame rather than a
   frame that resizes per-slide (which would jump the layout on every rotation).
   max-height caps it on ultra-wide screens; the banner is a strip, not a stage. */
.hero-slider__frame {
    position: relative;
    display: grid;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1518 / 350;
    max-height: 340px;
    background: var(--neutral-150);
}

.hero-slider__slide {
    grid-area: 1 / 1;
    position: relative;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity .6s ease-in-out;
}
.hero-slider__slide.is-active {
    opacity: 1;
    visibility: visible;
}
@media (prefers-reduced-motion: reduce) {
    .hero-slider__slide { transition: none; }
}

.hero-slider__photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Stretched link — covers the whole slide, ABOVE the image, so the entire banner is
   clickable when it has a destination (§12). Absent entirely when ClickTargetType is
   None (Index.cshtml renders no <a> at all) — no dead "#" href, no cursor:pointer
   promising a click that does nothing (Q46). */
.hero-slider__link {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
}

/* Overlay call-outs — positioned in IMAGE-physical coordinates (left/top, not
   inset-inline-start/end): an overlay's x/y percentage is authored against the pixels
   of the banner artwork, which does not mirror when the page direction is RTL. */
.hero-slider__overlay {
    position: absolute;
    z-index: 2;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .85rem;
    border-radius: var(--radius-full, 999px);
    background: var(--neutral-0);
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
    white-space: nowrap;
}
a.hero-slider__overlay:hover { background: var(--gold); color: var(--neutral-900); }
/* Icon glyph font loaded once in _Layout.cshtml — renders StoreBannerOverlay.Icon
   ("optional material icon name", D493) by name, the same way Google's own Material
   Symbols reference markup does. direction:ltr is required even on this RTL page: a
   ligature name like "local_offer" must never be bidi-reordered as if it were Arabic. */
.hero-slider__overlay-icon {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 18px;
    line-height: 1;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}

/* Dots — decorative sync indicators only (no href/button/JS click handler behind
   them; a dot that LOOKS clickable but isn't would be a lie, matching the prior
   CSS-only slider's contract). hero-banner.js toggles `.is-active` in step with the
   visible slide. Rendered only when there are 2+ banners (Index.cshtml). */
.hero-slider__dots {
    position: absolute;
    inset-inline: 0;
    bottom: var(--space-4);
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: var(--space-2);
}
.hero-slider__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full, 999px);
    background: var(--neutral-0);
    opacity: .35;
    transition: opacity .3s ease-in-out;
}
.hero-slider__dot.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .hero-slider__dot { transition: none; }
}

@media (max-width: 640px) { /* --bp-sm */
    .hero-slider__overlay {
        padding: .3rem .6rem;
        font-size: var(--text-xs, .75rem);
        gap: .25rem;
    }
    .hero-slider__overlay-icon { font-size: 15px; }
}

/* ── Benefits strip — one white card, 5 equal cells ──────────────────────
   Static merchant copy pending merchant configuration — see the HTML
   comment above this section's markup in Index.cshtml for why these five
   captions are literals today, not data read from the ERP. ────────────── */

.benefits { padding-block: var(--space-2) 0; }
.benefits__card {
    background: var(--paper);
    border: var(--card-border, 1px solid var(--line));
    border-radius: var(--card-radius, var(--radius-md));
    box-shadow: var(--card-shadow, var(--shadow-sm));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
}
@media (max-width: 768px) { /* --bp-md */
    .benefits__card { grid-template-columns: repeat(2, 1fr); }
    .benefits__cell { border-inline-end: none; } /* divider only reads correctly in the single-row 5-up layout */
}
@media (max-width: 480px) { /* --bp-xs */
    /* Two columns, not one. At 1fr the five benefit cells stacked into five
       full-width rows that consumed the entire first screen on a 390px phone,
       pushing the categories and products below two folds — MEASURED. */
    .benefits__card {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
        padding: var(--space-3);
    }
    .benefits__cell:last-child { grid-column: 1 / -1; }
}

.benefits__cell {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    border-inline-end: 1px solid var(--neutral-200);
}
.benefits__cell:last-child { border-inline-end: none; }
.benefits__icon {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    color: var(--brand);
}
.benefits__title {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--weight-bold);
    color: var(--ink);
}
.benefits__caption {
    margin: .15rem 0 0;
    font-size: var(--text-sm);
    color: var(--ink-soft);
}

/* ── Category cards — founder comp, replaces the old gradient "showcase"
   tiles (layout.css's .showcase__* rules are left untouched — this section
   simply stops referencing them). Equal-width row on desktop; below 900px
   it becomes a horizontal scroller instead of wrapping, per the comp.
   Each card's <img> is a drop-in photo slot — see Index.cshtml's
   img/catalog/categories/{slug}.png + onerror fallback, and the mirrored
   pattern on the product-grid cards below (store-redesign S1 revision). ── */

.category-cards { padding-block: var(--space-4) var(--space-2); }

.category-cards__heading {
    text-align: center;
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    margin: 0 0 var(--space-3);
}

.category-cards__row {
    display: flex;
    gap: var(--space-3);
}
@media (max-width: 900px) { /* --bp-lg */
    .category-cards__row {
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        padding-block-end: var(--space-2);
    }
    /* Scoped through the parent ON PURPOSE. The unconditional
       `.category-cards__card { flex: 1 1 0 }` rule below sits LATER in this file at
       equal specificity, so an unscoped override here loses the cascade and every
       card kept flexing — MEASURED at 375px: nine cards ~35px wide with the labels
       rendered one glyph per line. One extra class beats relying on source order. */
    .category-cards__row .category-cards__card {
        flex: 0 0 auto;
        width: 140px;
        scroll-snap-align: start;
    }
}

.category-cards__card {
    flex: 1 1 0;
    min-width: 0;
    background: var(--neutral-0);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-2);
    text-align: center;
    text-decoration: none;
    transition: border-color var(--duration-fast) var(--ease-standard),
                box-shadow var(--duration-fast) var(--ease-standard),
                transform var(--duration-fast) var(--ease-standard);
}
.category-cards__card:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}

.category-cards__card img {
    display: block;
    height: 64px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin-inline: auto;
}

.category-cards__label {
    display: block;
    margin-block-start: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink);
}

.category-cards__more {
    text-align: center;
    margin-block-start: var(--space-3);
}
.category-cards__more a {
    font-size: var(--text-sm);
    color: var(--brand);
    text-decoration: none;
}
.category-cards__more a:hover { text-decoration: underline; }

/* ── Home single column — category cards + featured row. Full container
   width now that the promotional banners render as the page hero above
   instead of a side rail (store-redesign S2 — rail removed). ───────────── */

.home-columns {
    padding-block: var(--space-2) var(--space-2);
}

.home-columns__main { min-width: 0; }

/* ── "منتجات مميزة" — featured row, first 6 of the same product list the
   catalog grid below renders, wrapped in its own explicit column-count grid
   (6 → 3 → 2) rather than the catalog's auto-fill .product-grid, because the
   main column here is narrower than the full-width catalog section. Cards
   reuse .product-card/components.css as-is — nothing here redeclares card
   styling. ──────────────────────────────────────────────────────────────── */

.featured-row { padding-block: var(--space-4) var(--space-2); }

.featured-row__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    margin-block-end: var(--space-4);
}
.featured-row__title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    color: var(--ink);
}
.featured-row__more {
    font-size: var(--text-sm);
    color: var(--brand);
    text-decoration: none;
    white-space: nowrap;
}
.featured-row__more:hover { text-decoration: underline; }

.featured-row__grid {
    display: grid;
    /* 6 at full container width — the 23rem rail that used to force this down
       to 5 is gone now that the banners moved to the hero slot above
       (store-redesign S2). */
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-3);
}
@media (max-width: 1200px) {
    .featured-row__grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) { /* --bp-lg */
    .featured-row__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) { /* --bp-xs */
    .featured-row__grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
}

