/* ==========================================================
   Allfood Design System v1 — Catalog integration
   Shop, Category & Search Sales Engine. Values should prefer design tokens
   from assets/css/design-tokens.css; legacy fallbacks remain safe.
========================================================== */
.af-catalog-page{
    background:linear-gradient(180deg,#fbfdff 0,#fff 240px);
}
.af-catalog-hero{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:28px;
    padding:30px 34px;
    margin-bottom:20px;
    border:1px solid var(--af-line);
    border-radius:var(--af-radius-large,28px);
    background:
        radial-gradient(circle at 8% 10%,rgba(103,183,228,.18),transparent 30%),
        radial-gradient(circle at 92% 0%,rgba(242,92,46,.11),transparent 28%),
        #fff;
    box-shadow:var(--af-shadow-elevated,0 18px 50px rgba(15,23,42,.06));
}
.af-catalog-eyebrow{
    display:inline-flex;
    align-items:center;
    gap:7px;
    margin-bottom:8px;
    color:var(--af-blue-dark);
    font-size:12px;
    font-weight:900;
    letter-spacing:.35px;
    text-transform:uppercase;
}
.af-catalog-hero h1{
    margin:0 0 8px;
    color:#0f172a;
    font-size:clamp(28px,3vw,42px);
    line-height:1.05;
    font-weight:900;
    letter-spacing:-.9px;
}
.af-catalog-hero p{
    max-width:720px;
    margin:0;
    color:var(--af-muted);
    font-size:14px;
    line-height:1.7;
}
.af-catalog-count{
    flex:0 0 auto;
    min-width:110px;
    text-align:center;
    padding:16px 18px;
    border-radius:20px;
    background:#fff;
    border:1px solid var(--af-line);
}
.af-catalog-count strong{display:block;font-size:28px;line-height:1;color:#0f172a;font-weight:900}
.af-catalog-count span{display:block;margin-top:6px;color:var(--af-muted);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.5px}
.af-catalog-shell{
    display:grid;
    grid-template-columns:260px minmax(0,1fr);
    gap:24px;
    align-items:start;
}
.af-catalog-filters{
    position:sticky;
    top:118px;
    min-width:0;
    padding:20px;
    border:1px solid var(--af-line);
    border-radius:var(--af-radius-panel,24px);
    background:#fff;
    box-shadow:var(--af-shadow-elevated,0 14px 36px rgba(15,23,42,.055));
}
.af-filter-drawer-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding-bottom:15px;
    margin-bottom:16px;
    border-bottom:1px solid var(--af-line);
}
.af-filter-drawer-head strong{display:block;color:#0f172a;font-size:16px;font-weight:900}
.af-filter-drawer-head small{display:block;margin-top:2px;color:var(--af-muted);font-size:11px}
.af-filter-drawer-head button{
    display:none;
    width:38px;
    height:38px;
    border:0;
    border-radius:12px;
    background:#f1f5f9;
    color:#0f172a;
}
.af-filter-form{display:grid;gap:16px}
.af-filter-field{display:grid;gap:6px}
.af-filter-field label,
.af-filter-price-grid label{
    color:#475569;
    font-size:11px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.35px;
}
.af-filter-form .form-control,
.af-filter-form .form-select{
    min-height:var(--af-control-height,44px);
    border-radius:var(--af-radius-control,14px);
    border-color:#e5eaf0;
    font-size:13px;
}
.af-filter-checks{display:grid;gap:9px}
.af-filter-checks label{
    display:flex;
    align-items:center;
    gap:9px;
    min-height:38px;
    padding:8px 10px;
    border-radius:12px;
    background:#f8fafc;
    color:#334155;
    font-size:13px;
    font-weight:800;
    cursor:pointer;
}
.af-filter-checks input{width:16px;height:16px;accent-color:var(--af-blue-dark)}
.af-filter-price-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.af-filter-price-grid>div{display:grid;gap:6px;min-width:0}
.af-filter-actions{display:grid;gap:8px;padding-top:3px}
.af-filter-actions .btn{min-height:43px}
.af-catalog-results{min-width:0}
.af-results-bar{
    min-height:54px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:14px;
    padding:8px 4px;
}
.af-results-bar strong{display:block;color:#0f172a;font-size:15px;font-weight:900}
.af-results-bar span{display:block;color:var(--af-muted);font-size:11px;margin-top:2px}
.af-per-page-form label{display:flex;align-items:center;gap:7px;color:var(--af-muted);font-size:12px;font-weight:800}
.af-per-page-form select{height:36px;border:1px solid var(--af-line);border-radius:10px;background:#fff;padding:0 9px;color:#334155;font-weight:800}
.af-catalog-product-grid{
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
    gap:14px !important;
}
.af-catalog-product-grid .af-product-card{
    border-radius:var(--af-radius-card,18px);
    overflow:hidden;
    box-shadow:var(--af-shadow-card,0 10px 28px rgba(15,23,42,.05));
}
.af-product-sku{margin-top:3px;color:#94a3b8;font-size:10px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.af-badge.case{background:#eef8ff;color:#1f6f9d}
.af-stock.out{color:#dc2626 !important}
.af-product-view-btn{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:38px;
    border:1px solid var(--af-line);
    border-radius:12px;
    color:#334155;
    font-size:12px;
    font-weight:900;
}
.af-stock-warning{
    padding:10px 12px;
    border-radius:12px;
    background:#fff7ed;
    border:1px solid #fed7aa;
    color:#9a3412;
    font-size:12px;
    font-weight:800;
    line-height:1.45;
}
.af-active-filters{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:0 0 16px;
}
.af-filter-chip{
    display:inline-flex;
    align-items:center;
    gap:5px;
    min-height:34px;
    padding:6px 11px;
    border-radius:999px;
    background:#eef8ff;
    color:#17648f;
    border:1px solid #d8effc;
    font-size:11px;
    font-weight:900;
}
.af-filter-chip-clear{background:#fff;color:#64748b;border-color:#e2e8f0}
.af-catalog-mobile-toolbar{display:none}
.af-filter-overlay{display:none;border:0;padding:0;margin:0}
.af-filter-chip:focus-visible,
.af-catalog-mobile-toolbar .btn:focus-visible,
.af-filter-drawer-head button:focus-visible{
    outline:3px solid rgba(43,143,202,.24);
    outline-offset:2px;
}
.af-smart-empty{
    grid-column:1/-1;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    min-height:360px;
    padding:42px 22px;
    text-align:center;
    border:1px dashed #cbd5e1;
    border-radius:26px;
    background:#fff;
}
.af-smart-empty-icon{
    width:68px;
    height:68px;
    display:flex;
    align-items:center;
    justify-content:center;
    margin-bottom:14px;
    border-radius:22px;
    background:#eef8ff;
    color:var(--af-blue-dark);
    font-size:28px;
}
.af-smart-empty h1,.af-smart-empty h2{margin:0 0 8px;color:#0f172a;font-size:23px;font-weight:900}
.af-smart-empty p{max-width:560px;margin:0 0 18px;color:var(--af-muted);font-size:13px;line-height:1.7}
.af-empty-search-form{width:min(560px,100%);display:grid;grid-template-columns:1fr auto;gap:8px}
.af-empty-category-links{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:22px}
.af-empty-category-links a{padding:7px 10px;border-radius:999px;background:#f8fafc;border:1px solid var(--af-line);font-size:11px;font-weight:800;color:#475569}
.af-breadcrumbs{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:#64748b;font-size:11px;font-weight:700}
.af-breadcrumbs a:hover{color:var(--af-blue-dark)}
.af-breadcrumbs strong{color:#334155}
.af-category-hero{align-items:center}
.af-category-hero-copy{min-width:0}
.af-category-hero-image{flex:0 0 130px;width:130px;height:130px;object-fit:contain;filter:drop-shadow(0 12px 22px rgba(15,23,42,.1))}
.af-category-seo-panel{margin-top:36px;padding:30px;border-radius:24px;border:1px solid var(--af-line);background:#fbfdff;color:#64748b;line-height:1.8}
.af-category-seo-panel h2{margin:0 0 14px;color:#0f172a;font-size:21px;font-weight:900}

.af-catalog-breadcrumbs{
    margin:0 0 12px;
}
.af-filter-context{
    display:grid;
    gap:4px;
    padding:12px 13px;
    border:1px solid #e5eaf0;
    border-radius:var(--af-radius-control,14px);
    background:#f8fafc;
}
.af-filter-context span{
    color:#64748b;
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.4px;
}
.af-filter-context strong{
    color:#0f172a;
    font-size:13px;
    font-weight:900;
    line-height:1.3;
}
.af-filter-context a{
    width:max-content;
    margin-top:2px;
    color:var(--af-blue-dark);
    font-size:11px;
    font-weight:800;
}
.af-search-hero{
    background:
        radial-gradient(circle at 8% 10%,rgba(103,183,228,.20),transparent 30%),
        radial-gradient(circle at 92% 0%,rgba(242,92,46,.10),transparent 28%),
        #fff;
}
.af-search-start{
    min-height:430px;
}
.af-empty-actions{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:8px;
}
.af-category-catalog .af-category-hero-image{
    border-radius:var(--af-radius-card,18px);
    background:rgba(255,255,255,.76);
    padding:8px;
}


@media(max-width:1199px){
    .af-catalog-shell{grid-template-columns:230px minmax(0,1fr);gap:18px}
    .af-catalog-product-grid{grid-template-columns:repeat(3,minmax(0,1fr)) !important}
}



/* ==========================================================================
   Phase 7.5 — High-visibility offer badges on product imagery
   ========================================================================== */

.af-product-card.has-live-offer{
    border-color:rgba(242,92,46,.28);
    box-shadow:0 12px 32px rgba(242,92,46,.08);
}
.af-product-card.has-live-offer:hover{
    border-color:rgba(242,92,46,.42);
    box-shadow:0 18px 44px rgba(242,92,46,.13);
}

.af-product-card .af-product-image{
    position:relative;
    overflow:hidden;
}

.af-card-offer-flag{
    position:absolute;
    top:12px;
    left:0;
    z-index:6;
    display:flex;
    align-items:stretch;
    max-width:calc(100% - 52px);
    min-height:42px;
    color:#fff;
    text-decoration:none;
    pointer-events:none;
    filter:drop-shadow(0 7px 12px rgba(15,23,42,.16));
}

.af-card-offer-icon{
    width:32px;
    min-width:32px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--af-yellow,#F7BD2B);
    color:#1e293b;
    font-size:14px;
}

.af-card-offer-copy{
    min-width:0;
    display:flex;
    flex-direction:column;
    justify-content:center;
    padding:6px 11px 6px 9px;
    border-radius:0 10px 10px 0;
    background:var(--af-orange,#F25C2E);
    color:#fff;
    line-height:1.05;
}

.af-card-offer-copy small,
.af-card-offer-copy strong{
    display:block;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.af-card-offer-copy small{
    color:rgba(255,255,255,.82);
    font-size:8px;
    font-weight:900;
    letter-spacing:.55px;
}

.af-card-offer-copy strong{
    margin-top:3px;
    color:#fff;
    font-size:11px;
    font-weight:1000;
    letter-spacing:.1px;
}

.af-card-offer-flag.discount .af-card-offer-copy{
    background:#dc2626;
}

.af-card-offer-flag.special .af-card-offer-copy{
    background:#0f172a;
}

.af-card-offer-flag.special .af-card-offer-icon{
    background:var(--af-blue,#67B7E4);
    color:#0f172a;
}

/* Move small secondary badges below the main promotion so they do not overlap it. */
.af-product-card.has-live-offer .af-product-badges{
    top:62px;
}

/* Keep wishlist on the opposite top corner. */
.af-product-card.has-live-offer .af-wishlist{
    z-index:7;
}

@media(max-width:767px){
    .af-card-offer-flag{
        top:8px;
        min-height:34px;
        max-width:calc(100% - 42px);
    }
    .af-card-offer-icon{
        width:26px;
        min-width:26px;
        font-size:11px;
    }
    .af-card-offer-copy{
        padding:5px 8px 5px 7px;
        border-radius:0 8px 8px 0;
    }
    .af-card-offer-copy small{
        font-size:7px;
        letter-spacing:.35px;
    }
    .af-card-offer-copy strong{
        margin-top:2px;
        font-size:9px;
    }
    .af-product-card.has-live-offer .af-product-badges{
        top:49px;
    }
}

@media(max-width:390px){
    .af-card-offer-copy strong{
        font-size:8.5px;
    }
}


/* ==========================================================================
   Phase 7.8 — Main category → Subcategory navigation
   ========================================================================== */

.af-subcategory-section{
    margin:18px 0 22px;
    padding:20px;
    border:1px solid var(--af-line,#EDF1F5);
    border-radius:22px;
    background:#fff;
    box-shadow:0 10px 30px rgba(15,23,42,.045);
}

.af-subcategory-head{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:16px;
    margin-bottom:14px;
}

.af-subcategory-head h2{
    margin:4px 0 0;
    color:var(--af-ink,#1E293B);
    font-size:18px;
    line-height:1.2;
    font-weight:900;
}

.af-subcategory-clear{
    color:var(--af-blue-dark,#2B8FCA);
    font-size:10px;
    font-weight:900;
    white-space:nowrap;
}

.af-subcategory-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;
}

.af-subcategory-card{
    min-width:0;
    min-height:72px;
    display:grid;
    grid-template-columns:40px minmax(0,1fr) auto;
    gap:10px;
    align-items:center;
    padding:11px 12px;
    border:1px solid #E5EAF0;
    border-radius:16px;
    background:#FBFDFF;
    color:var(--af-ink,#1E293B);
    text-decoration:none;
    transition:
        transform .16s ease,
        border-color .16s ease,
        box-shadow .16s ease,
        background .16s ease;
}

.af-subcategory-card:hover{
    transform:translateY(-2px);
    border-color:#BAE6FD;
    background:#F7FCFF;
    box-shadow:0 10px 24px rgba(43,143,202,.08);
}

.af-subcategory-card.active{
    border-color:var(--af-blue-dark,#2B8FCA);
    background:#EEF8FF;
    box-shadow:0 0 0 2px rgba(43,143,202,.07);
}

.af-subcategory-icon{
    width:40px;
    height:40px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:13px;
    background:#EEF8FF;
    color:var(--af-blue-dark,#2B8FCA);
    font-size:17px;
}

.af-subcategory-card.active .af-subcategory-icon{
    background:var(--af-blue-dark,#2B8FCA);
    color:#fff;
}

.af-subcategory-copy{
    min-width:0;
}

.af-subcategory-copy strong,
.af-subcategory-copy small{
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
}

.af-subcategory-copy strong{
    color:inherit;
    font-size:11px;
    line-height:1.25;
    font-weight:900;
    white-space:nowrap;
}

.af-subcategory-copy small{
    margin-top:3px;
    color:var(--af-muted,#64748B);
    font-size:9px;
    white-space:nowrap;
}

.af-subcategory-arrow{
    color:#94A3B8;
    font-size:11px;
}

.af-subcategory-card.active .af-subcategory-arrow{
    color:var(--af-blue-dark,#2B8FCA);
}

.af-filter-subcategory-current{
    display:block;
    margin-top:4px;
    color:var(--af-blue-dark,#2B8FCA);
    font-size:10px;
    font-weight:900;
}

@media(max-width:1199px){
    .af-subcategory-grid{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
}

@media(max-width:767px){
    .af-subcategory-section{
        margin:14px 0 16px;
        padding:15px 0 15px 14px;
        border-radius:18px;
        overflow:hidden;
    }

    .af-subcategory-head{
        padding-right:14px;
        align-items:flex-start;
    }

    .af-subcategory-head h2{
        font-size:16px;
    }

    .af-subcategory-grid{
        display:flex;
        gap:9px;
        overflow-x:auto;
        padding-right:14px;
        padding-bottom:3px;
        scrollbar-width:none;
        scroll-snap-type:x proximity;
    }

    .af-subcategory-grid::-webkit-scrollbar{
        display:none;
    }

    .af-subcategory-card{
        flex:0 0 205px;
        min-height:66px;
        scroll-snap-align:start;
    }
}

@media(max-width:390px){
    .af-subcategory-card{
        flex-basis:185px;
    }
}


/* ==========================================================================
   Phase 7.8.2 — Simple subcategory links
   ========================================================================== */

.af-subcategory-link-strip{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:7px 10px;
    margin:14px 0 18px;
    padding:0 4px;
    min-height:28px;
}

.af-subcategory-link-label{
    color:var(--af-muted,#64748B);
    font-size:11px;
    font-weight:800;
}

.af-subcategory-link-strip a{
    display:inline-flex;
    align-items:center;
    min-height:30px;
    padding:4px 10px;
    border:1px solid #DCE7EF;
    border-radius:999px;
    background:#fff;
    color:var(--af-blue-dark,#2B8FCA);
    font-size:11px;
    font-weight:900;
    line-height:1;
    text-decoration:none;
    transition:.15s ease;
}

.af-subcategory-link-strip a:hover{
    border-color:var(--af-blue,#67B7E4);
    background:#F3FAFF;
}

.af-subcategory-link-strip a.active{
    border-color:var(--af-blue-dark,#2B8FCA);
    background:var(--af-blue-dark,#2B8FCA);
    color:#fff;
}

@media(max-width:767px){
    .af-subcategory-link-strip{
        flex-wrap:nowrap;
        overflow-x:auto;
        gap:7px;
        margin:10px 0 14px;
        padding:2px 0 5px;
        scrollbar-width:none;
    }
    .af-subcategory-link-strip::-webkit-scrollbar{
        display:none;
    }
    .af-subcategory-link-label,
    .af-subcategory-link-strip a{
        flex:0 0 auto;
    }
}
