/*
  Yalla Souq — product listing / filters (product_listing.blade.php)
  Loaded after ys-platform-pages.css
*/

html.ys-reference-shell .ys-page-category .ys-subcategory-nav {
    display: flex;
    gap: 8px;
    margin-top: 22px;
    padding-bottom: 3px;
    overflow-x: auto;
}

html.ys-reference-shell .ys-page-category .ys-subcategory-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid var(--ys-line-light, #e2e8f0);
    border-radius: 999px;
    background: #fff;
    color: var(--ys-ink-on-paper, #0f172a);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

html.ys-reference-shell .ys-page-category .ys-subcategory-nav a:hover {
    border-color: var(--ys-gold, #ffb800);
    background: var(--ys-ink-on-paper, #0f172a);
    color: #fff;
}

html.ys-reference-shell .ys-page-category .ys-filter-bar,
html.ys-reference-shell .ys-page-category .collapse-sidebar,
html.ys-reference-shell .ys-page-category .border-bottom-listing-sidebar {
    border-color: var(--ys-line-light, #e2e8f0) !important;
    background: #fff !important;
}

html.ys-reference-shell .ys-page-category .ys-filter-bar {
    overflow: hidden;
    border: 1px solid var(--ys-line-light, #e2e8f0);
    border-radius: 8px;
}

html.ys-reference-shell .ys-page-category .ys-products-grid > [class*="col"] {
    padding: 8px;
    border: 0 !important;
}

html.ys-reference-shell .ys-page-category .ys-products-grid .aiz-card-box {
    overflow: hidden;
    border: 1px solid var(--ys-line-light, #e2e8f0);
    border-radius: 8px;
    background: #fff;
}

html.ys-reference-shell .ys-page-category #products-row.ys-listing-ref-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px !important;
    align-items: stretch !important;
    width: 100% !important;
}

html.ys-reference-shell .ys-page-category #products-row.ys-grid-comfortable {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

html.ys-reference-shell .ys-page-category #products-row .ys-listing-product-item,
html.ys-reference-shell .ys-page-category #products-row .ys-ref-product-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

html.ys-reference-shell .ys-page-category #products-row .ys-ref-product-card {
    height: 100% !important;
}

html.ys-reference-shell .ys-page-category .ys-filter-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 14px !important;
    background: #fff !important;
}

html.ys-reference-shell .ys-page-category .ys-filter-summary-label {
    display: block !important;
    color: var(--ys-muted-on-paper, #64748b) !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
}

html.ys-reference-shell .ys-page-category .ys-filter-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

html.ys-reference-shell .ys-page-category .ys-select-wrap,
html.ys-reference-shell .ys-page-category .ys-meta-action {
    min-height: 38px !important;
    border: 1px solid var(--ys-line-light, #e2e8f0) !important;
    border-radius: 999px !important;
    background: #fff !important;
}

html.ys-reference-shell .ys-page-category .ys-select-wrap {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 0 10px !important;
}

html.ys-reference-shell .ys-page-category .ys-select-wrap select,
html.ys-reference-shell .ys-page-category .ys-select-wrap .btn {
    min-width: 132px !important;
    height: 36px !important;
    padding: 0 6px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--ys-ink-on-paper, #0f172a) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

html.ys-reference-shell .ys-page-category .ys-view-toggle {
    display: inline-flex !important;
    overflow: hidden !important;
    min-height: 38px !important;
    border: 1px solid var(--ys-line-light, #e2e8f0) !important;
    border-radius: 999px !important;
    background: #fff !important;
}

html.ys-reference-shell .ys-page-category .ys-view-btn {
    min-width: 82px !important;
    height: 38px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--ys-muted-on-paper, #64748b) !important;
    font-size: 12px !important;
    font-weight: 800 !important;
}

html.ys-reference-shell .ys-page-category .ys-view-btn.active-cols {
    background: var(--ys-ink-on-paper, #0f172a) !important;
    color: #fff !important;
}

html.ys-reference-shell .ys-page-category .ys-meta-action {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 0 14px !important;
    color: var(--ys-ink-on-paper, #0f172a) !important;
    font-size: 12px !important;
    font-weight: 800 !important;
}

html.ys-reference-shell .ys-digital-sections {
    display: grid;
    gap: 18px;
    margin: 0 0 22px;
}

html.ys-reference-shell .ys-digital-section {
    overflow: hidden;
    border: 1px solid var(--ys-line-light, #e2e8f0);
    border-radius: 8px;
    background: #fff;
}

html.ys-reference-shell .ys-digital-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--ys-line-light, #e2e8f0);
    background: rgba(255, 184, 0, 0.06);
}

html.ys-reference-shell .ys-digital-section-head h2 {
    margin: 0;
    color: var(--ys-ink-on-paper, #0f172a);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.1;
}

html.ys-reference-shell .ys-digital-section-head span {
    display: block;
    margin-top: 4px;
    color: var(--ys-muted-on-paper, #64748b);
    font-size: 12px;
    font-weight: 700;
}

html.ys-reference-shell .ys-digital-section-head a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--ys-ink-on-paper, #0f172a);
    color: #fff !important;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

html.ys-reference-shell .ys-digital-section-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 16px;
}

@media (max-width: 1199px) {
    html.ys-reference-shell .ys-page-category #products-row.ys-listing-ref-grid,
    html.ys-reference-shell .ys-page-category #products-row.ys-grid-comfortable {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    html.ys-reference-shell .ys-digital-section-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    html.ys-reference-shell .ys-page-category {
        padding-top: 14px !important;
    }

    html.ys-reference-shell .ys-page-category #products-row.ys-listing-ref-grid,
    html.ys-reference-shell .ys-page-category #products-row.ys-grid-comfortable,
    html.ys-reference-shell .ys-page-category #products-row.ys-grid-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    html.ys-reference-shell .ys-page-category .ys-filter-toolbar {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    html.ys-reference-shell .ys-page-category .ys-filter-actions {
        justify-content: flex-start !important;
    }

    html.ys-reference-shell .ys-digital-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    html.ys-reference-shell .ys-digital-section-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 12px;
    }
}

/* Active filter chips + denser toolbar */
html.ys-reference-shell .ys-page-category .ys-filter-chips,
html.ys-reference-shell .ys-page-category .aiz-filter-sidebar .list-group-item.active,
html.ys-reference-shell .ys-page-category .ys-subcategory-nav a.is-active {
    border-color: var(--ys-gold, #ffb800) !important;
    background: rgba(255, 184, 0, 0.12) !important;
    color: var(--ys-ink-on-paper, #0f172a) !important;
}

html.ys-reference-shell .ys-page-category .ys-filter-toolbar {
    border: 1px solid var(--ys-line-light, #e2e8f0);
    border-radius: var(--ys-radius, 16px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    margin-bottom: var(--ys-space-3, 12px);
}

html.ys-reference-shell .ys-page-category .ys-filter-summary-label {
    font-size: var(--ys-text-sm, 13px) !important;
}

html.ys-reference-shell .ys-page-category .ys-filter-actions {
    gap: var(--ys-space-2, 8px) !important;
}
