/* ============================
   Container
   ============================ */
.container { max-width: 1320px; margin: 0 auto; }

/* ============================
   Breadcrumb
   ============================ */
.breadcrumb-wrap { background: var(--white); border-bottom: 1px solid var(--gray); padding: 10px 0; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text3); max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.breadcrumb a { color: var(--text2); transition: color .2s; }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* ============================
   Category Header
   ============================ */
.category-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding: 20px; background: var(--white); border-radius: var(--rl); border: 1px solid var(--gray); }
.cat-header-info { display: flex; align-items: center; gap: 14px; }
.cat-header-emoji { font-size: 40px; }
.cat-header-info h1 { font-size: 22px; font-weight: 900; color: var(--navy); }
.cat-header-info p { font-size: 13.5px; color: var(--text3); margin-top: 3px; }
.cat-header-count { font-size: 14px; font-weight: 700; color: var(--text3); background: var(--off); padding: 6px 16px; border-radius: 20px; border: 1px solid var(--gray); }

/* ============================
   Subcategories
   ============================ */
.subcategories { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.subcat-chip { padding: 7px 16px; border-radius: 20px; background: var(--white); border: 1.5px solid var(--gray); font-size: 13px; font-weight: 600; color: var(--text2); transition: all .2s; }
.subcat-chip:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-light); }

/* ============================
   Layout
   ============================ */
.category-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }

/* ============================
   Sidebar
   ============================ */
.cat-sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
.filter-card { background: var(--white); border-radius: var(--rl); border: 1px solid var(--gray); overflow: hidden; }
.filter-head { padding: 12px 16px; font-size: 13.5px; font-weight: 800; color: var(--navy); border-bottom: 1px solid var(--gray); background: var(--off); }
.filter-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.filter-check, .filter-radio { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text2); }
.filter-check input, .filter-radio input { accent-color: var(--orange); width: 16px; height: 16px; }
.filter-check:hover span, .filter-radio:hover span { color: var(--orange); }
.price-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.price-range .form-group { display: flex; flex-direction: column; gap: 4px; }
.price-range label { font-size: 11.5px; color: var(--text3); font-weight: 600; }
.price-input { padding: 8px 10px; border: 1.5px solid var(--gray); border-radius: var(--r); font-family: 'Tajawal', sans-serif; font-size: 13px; outline: none; width: 100%; transition: border-color .2s; }
.price-input:focus { border-color: var(--orange); }
.btn-apply-filter { width: 100%; background: var(--navy); color: #fff; padding: 9px; border-radius: var(--r); font-size: 13px; font-weight: 700; border: none; cursor: pointer; transition: background .2s; font-family: 'Tajawal', sans-serif; }
.btn-apply-filter:hover { background: var(--orange); }

/* ============================
   Results Bar
   ============================ */
.results-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.results-count { font-size: 14px; font-weight: 700; color: var(--text2); }
.view-toggle { display: flex; gap: 4px; }
.view-btn { width: 34px; height: 34px; border-radius: var(--r); border: 1.5px solid var(--gray); background: var(--white); cursor: pointer; font-size: 16px; transition: all .2s; }
.view-btn.active, .view-btn:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-light); }

/* ============================
   Products Grid
   ============================ */
.products-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.products-grid.list-view { grid-template-columns: 1fr; }

/* ============================
   Pagination
   ============================ */
.pagination-wrap { margin-top: 32px; display: flex; justify-content: center; }

/* ============================
   Empty State
   ============================ */
.empty-products { text-align: center; padding: 60px 20px; background: var(--white); border-radius: var(--rl); border: 1px solid var(--gray); }
.ep-icon { font-size: 56px; margin-bottom: 14px; }
.empty-products h3 { font-size: 18px; font-weight: 900; color: var(--navy); margin-bottom: 8px; }
.empty-products p { font-size: 14px; color: var(--text3); margin-bottom: 20px; }
.btn-go-home { background: var(--orange); color: #fff; padding: 11px 28px; border-radius: var(--r); font-size: 14px; font-weight: 700; display: inline-block; transition: all .2s; }
.btn-go-home:hover { background: var(--navy); }
/* ============================
   الروبي ستور — category.css
   Mobile Filter Bottom Sheet — إضافة في نهاية الملف
   ============================ */

/* ============================
   Mobile Filter Bar — شريط فوق المنتجات
   ============================ */
.mobile-filter-bar {
    display: none; /* بيظهر على الموبايل بس */
}

/* ============================
   Filter Bottom Sheet
   ============================ */
.filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}
.filter-overlay.active { display: block; }

.filter-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 20px 20px 0 0;
    z-index: 999;
    transition: bottom .3s ease;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.filter-sheet.active { bottom: 0; }

.filter-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray);
}
.filter-sheet-head strong { font-size: 16px; font-weight: 900; color: var(--navy); }
.filter-sheet-head button {
    background: var(--off);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    color: var(--text2);
}

.filter-sheet-body {
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.filter-sheet-footer {
    padding: 16px;
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--gray);
}
.filter-sheet-footer .btn-apply-filter { flex: 1; }
.btn-reset-filter {
    padding: 9px 16px;
    border-radius: var(--r);
    border: 1.5px solid var(--gray);
    background: var(--white);
    font-size: 13px;
    font-weight: 700;
    color: var(--text2);
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
}

/* ============================
   Tablet & Mobile — 768px فأقل
   ============================ */
@media (max-width: 768px) {

    .container { padding: 0 12px !important; }

    /* --- Category Header --- */
    .category-header {
        padding: 12px 14px;
        margin-bottom: 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .cat-header-emoji { font-size: 28px; }
    .cat-header-info h1 { font-size: 17px; }
    .cat-header-count { font-size: 12px; padding: 4px 10px; }

    /* --- Subcategories --- */
    .subcategories { gap: 6px; margin-bottom: 12px; }
    .subcat-chip { padding: 5px 12px; font-size: 12px; }

    /* --- Mobile Filter Bar --- */
    .mobile-filter-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
        background: var(--white);
        padding: 10px 12px;
        border-radius: var(--r);
        border: 1px solid var(--gray);
    }

    .mobile-filter-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 7px 14px;
        background: var(--navy);
        color: #fff;
        border: none;
        border-radius: var(--r);
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        font-family: 'Tajawal', sans-serif;
        flex-shrink: 0;
    }

    .mobile-sort-wrap { flex: 1; }
    .mobile-sort-select {
        width: 100%;
        padding: 7px 10px;
        border: 1.5px solid var(--gray);
        border-radius: var(--r);
        font-family: 'Tajawal', sans-serif;
        font-size: 12.5px;
        color: var(--text);
        background: var(--off);
        outline: none;
    }

    /* --- Layout — نخبي الـ Sidebar على الموبايل --- */
    .category-layout { grid-template-columns: 1fr; gap: 0; }
    .cat-sidebar { display: none; } /* الفلتر بيظهر في الـ Bottom Sheet */

    /* --- Results Bar --- */
    .results-bar { margin-bottom: 10px; }
    .results-count { font-size: 13px; }
    .view-toggle { display: flex; gap: 4px; }

    /* --- Products Grid --- */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* --- Pagination --- */
    .pagination-wrap { margin-top: 20px; }

    /* --- Empty State --- */
    .empty-products { padding: 40px 16px; }
    .ep-icon { font-size: 44px; }
    .empty-products h3 { font-size: 16px; }
}

@media (max-width: 480px) {
    .category-header { padding: 10px 12px; }
    .cat-header-info h1 { font-size: 15px; }
    .products-grid { gap: 8px; }
    .mobile-filter-btn { padding: 7px 10px; font-size: 12px; }
}
/* ============================
   Container الصفحة — padding مناسب
   ============================ */
.category-layout-wrap {
    padding: 28px 20px;
}

@media (max-width: 768px) {
    .category-layout-wrap {
        padding: 12px 0;
    }
}
