/* ══════════════════════════════════════════════════════════
   CATEGORY PAGE
══════════════════════════════════════════════════════════ */

/* ── Variables (extend root vars from header) ── */
:root {
    --cat-sidebar-w: 260px;
    --cat-gap: 16px;
    --cat-radius: 10px;
    --cat-tr: .2s ease;
    --cat-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    --cat-border: #e8ecf0;
    --bg-page: #f4f6f8;
    --bg-card: #ffffff;
    --tx-main: #010F1C;
    --tx-muted: #7a8fa0;
}

/* ══════════════════════════════════════════
   HERO BANNER
══════════════════════════════════════════ */
.cat-hero {
    position: relative;
    min-height: 180px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--az-navy, #1a2b3c);
}

.cat-hero__bg {
    position: absolute;
    inset: 0;
}

.cat-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .35;
    filter: blur(2px);
    transform: scale(1.04);
}

.cat-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(15, 25, 35, .92) 0%,
            rgba(26, 43, 60, .75) 60%,
            rgba(26, 43, 60, .5) 100%);
}

.cat-hero .container {
    position: relative;
    z-index: 1;
}

.cat-hero__body {
    padding: 32px 0 28px;
}

/* Breadcrumb */
.cat-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.cat-breadcrumb__item {
    color: rgba(255, 255, 255, .65);
    font-size: 13px;
    transition: color var(--cat-tr);
    text-decoration: none;
}

.cat-breadcrumb__item:hover {
    color: var(--az-cta, #f0a500);
}

.cat-breadcrumb__item--active {
    color: rgba(255, 255, 255, .9);
    font-weight: 600;
}

.cat-breadcrumb__sep {
    color: rgba(255, 255, 255, .3);
    font-size: 10px;
}

.cat-hero__title {

    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px;
    letter-spacing: -.5px;
}

.cat-hero__count {
    color: var(--az-cta, #f0a500);
    font-size: 13px;
    font-weight: 600;
    margin: 0;
}

/* ══════════════════════════════════════════
   TRUST BADGES BAR
══════════════════════════════════════════ */
.cat-badges {
    background: var(--az-navy, #1a2b3c);
    border-top: 1px solid rgba(255, 255, 255, .07);
    border-bottom: 3px solid var(--az-cta, #f0a500);
    padding: 12px 0;
}

.cat-badges__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.cat-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 28px;
    border-inline-end: 1px solid rgba(255, 255, 255, .1);
    flex: 1;
    min-width: 180px;
}

.cat-badge:last-child {
    border-inline-end: none;
}

.cat-badge__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.cat-badge__icon i,
.cat-badge__icon .fa,
.cat-badge__icon .fas,
.cat-badge__icon .fa-solid {
    color: #fff;
    font-size: 16px;
}

.cat-badge__title {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.cat-badge__sub {
    color: rgba(255, 255, 255, .5);
    font-size: 11px;
    line-height: 1.3;
}

/* ══════════════════════════════════════════
   PAGE SHELL
══════════════════════════════════════════ */
.cat-page {
    background: var(--bg-page);
    min-height: 60vh;
    padding: 20px 0 40px;
}

.cat-page__inner {
    display: flex;
    align-items: flex-start;
    gap: var(--cat-gap);
    padding-inline: 16px;
}

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.cat-sidebar {
    flex-shrink: 0;
    width: var(--cat-sidebar-w);
    background: var(--bg-card);
    border-radius: var(--cat-radius);
    box-shadow: var(--cat-shadow);
    overflow: hidden;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d0d8e0 transparent;
}

.cat-sidebar::-webkit-scrollbar {
    width: 4px;
}

.cat-sidebar::-webkit-scrollbar-thumb {
    background: #d0d8e0;
    border-radius: 4px;
}

.cat-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--az-navy, #1a2b3c);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .3px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.cat-sidebar__head i {
    color: var(--az-cta, #f0a500);
    margin-inline-end: 6px;
}

.cat-sidebar__close {
    display: none;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, .6);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    transition: color var(--cat-tr);
}

.cat-sidebar__close:hover {
    color: #fff;
}

/* Filter Form */
.cat-filter-form {
    padding: 14px;
}

.cat-filter-block {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--cat-border);
}

.cat-filter-block:last-of-type {
    border-bottom: none;
}

.cat-filter-block__title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--tx-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cat-filter-block__title i {
    color: var(--az-cta, #f0a500);
    font-size: 13px;
}

.cat-filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--cat-border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--tx-main);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: border-color var(--cat-tr), box-shadow var(--cat-tr);
    appearance: auto;
}

.cat-filter-select:focus {
    border-color: var(--az-cta, #f0a500);
    box-shadow: 0 0 0 3px rgba(240, 165, 0, .12);
}

/* Price Range */
.cat-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-price-input {
    flex: 1;
    padding: 8px 10px;
    border: 1.5px solid var(--cat-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--tx-main);
    background: #f8fafc;
    outline: none;
    min-width: 0;
    transition: border-color var(--cat-tr), box-shadow var(--cat-tr);
}

.cat-price-input:focus {
    border-color: var(--az-cta, #f0a500);
    box-shadow: 0 0 0 3px rgba(240, 165, 0, .12);
}

.cat-price-sep {
    color: var(--tx-muted);
    font-weight: 700;
    flex-shrink: 0;
}

/* Toggle Checkbox */
.cat-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.cat-toggle-label input[type="checkbox"] {
    display: none;
}

.cat-toggle-track {
    width: 38px;
    height: 20px;
    background: #d8dfe8;
    border-radius: 20px;
    position: relative;
    flex-shrink: 0;
    transition: background var(--cat-tr);
}

.cat-toggle-thumb {
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
    transition: inset-inline-start var(--cat-tr);
}

.cat-toggle-label input:checked~.cat-toggle-track {
    background: var(--az-cta, #f0a500);
}

.cat-toggle-label input:checked~.cat-toggle-track .cat-toggle-thumb {
    inset-inline-start: 20px;
}

.cat-toggle-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--tx-main);
}

/* Apply button */
.cat-apply-btn {
    width: 100%;
    padding: 10px;
    background: var(--az-navy, #1a2b3c);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background var(--cat-tr), transform .15s;
    margin-top: 4px;
}

.cat-apply-btn:hover {
    background: var(--az-cta, #f0a500);
    color: var(--az-navy, #1a2b3c);
    transform: translateY(-1px);
}

.cat-apply-btn i {
    font-size: 12px;
}

/* ══════════════════════════════════════════
   MAIN PRODUCTS AREA
══════════════════════════════════════════ */
.cat-main {
    flex: 1;
    min-width: 0;
}

/* Toolbar */
.cat-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border-radius: var(--cat-radius);
    padding: 10px 14px;
    margin-bottom: 14px;
    box-shadow: var(--cat-shadow);
    flex-wrap: wrap;
}

.cat-toolbar__filter-btn {
    display: none;
    align-items: center;
    gap: 7px;
    background: var(--az-navy, #1a2b3c);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--cat-tr);
}

.cat-toolbar__filter-btn i {
    color: var(--az-cta, #f0a500);
}

.cat-toolbar__filter-btn:hover {
    background: var(--navy, #010F1C);
}

.cat-toolbar__count {
    color: var(--tx-muted);
    font-size: 13px;
    margin-inline-end: auto;
}

.cat-toolbar__count strong {
    color: var(--tx-main);
}

/* Grid buttons */
.cat-grid-btns {
    display: flex;
    gap: 4px;
}

.cat-grid-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--cat-border);
    border-radius: 8px;
    background: transparent;
    color: var(--tx-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--cat-tr);
}

.cat-grid-btn i,
.cat-grid-btn .fa,
.cat-grid-btn .fas,
.cat-grid-btn .fa-solid {
    transition: all 0.3s ease !important;
}

.cat-grid-btn:hover {
    border-color: var(--az-cta, #f0a500);
    color: var(--az-cta, #f0a500);
}

.cat-grid-btn.active {
    background: var(--az-navy, #1a2b3c);
    border-color: var(--az-navy, #1a2b3c);
    color: #fff;
}

.cat-grid-btn.active i,
.cat-grid-btn.active .fa,
.cat-grid-btn.active .fas,
.cat-grid-btn.active .fa-solid {
    color: #fff !important;
}

/* Loader */
.cat-loader {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(244, 246, 248, .7);
    z-index: 900;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.cat-loader[style*="block"],
.cat-loader[style*="inline"] {
    display: flex !important;
}

.cat-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(26, 43, 60, .12);
    border-top-color: var(--az-cta, #f0a500);
    border-radius: 50%;
    animation: cat-spin .7s linear infinite;
}

@keyframes cat-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Pagination ── */
.cat-pagination {
    margin-top: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: var(--bg-card);
    border-radius: var(--cat-radius);
    box-shadow: var(--cat-shadow);
    border: 1px solid var(--cat-border);
}

/* ===== COMPLETELY FIX BLUE BACKGROUND ON INPUT NUMBER ===== */
input[type="number"] {
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    appearance: none !important;
    background-color: #fafafa !important;
}

input[type="number"]:hover,
input[type="number"]:focus,
input[type="number"]:active {
    outline: none !important;
    background-color: #fafafa !important;
    -webkit-box-shadow: 0 0 0 2000px #fafafa inset !important;
    box-shadow: 0 0 0 2000px #fafafa inset !important;
}

/* Remove spinner buttons in WebKit browsers */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* For WebKit browsers (Chrome, Safari, Edge) - strongest possible */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    input[type="number"] {
        -webkit-appearance: none !important;
        -moz-appearance: textfield !important;
        appearance: none !important;
        background-color: #fafafa !important;
    }
    input[type="number"]:hover,
    input[type="number"]:focus,
    input[type="number"]:active {
        -webkit-appearance: none !important;
        background-color: #fafafa !important;
        -webkit-box-shadow: 0 0 0 2000px #fafafa inset !important;
        box-shadow: 0 0 0 2000px #fafafa inset !important;
    }
}

/* نص الصفحة — يسار */
.cat-pagination__info {
    font-size: 13px;
    color: var(--tx-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.cat-pagination__info strong {
    color: var(--tx-main);
    font-weight: 700;
}

/* أزرار — يمين */
.cat-pagination__btns {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.cat-pagination .pagination {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.cat-pagination .page-item {
    list-style: none;
    display: block;
}

.cat-pagination .page-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border-radius: 8px !important;
    border: 1.5px solid var(--cat-border);
    color: var(--tx-main);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--cat-tr);
    background: var(--bg-card);
    padding: 0 10px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.cat-pagination .page-link:hover {
    background: var(--az-navy, #1a2b3c);
    border-color: var(--az-navy, #1a2b3c);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(26, 43, 60, .18);
}

.cat-pagination .page-item.active .page-link {
    background: var(--az-cta, #f0a500);
    border-color: var(--az-cta, #f0a500);
    color: var(--az-navy, #1a2b3c);
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(240, 165, 0, .3);
    transform: translateY(-1px);
}

.cat-pagination .page-item.disabled .page-link {
    opacity: .35;
    cursor: default;
    pointer-events: none;
    box-shadow: none;
    transform: none;
}

/* سهم السابق والتالي */
.cat-pagination .page-item:first-child .page-link,
.cat-pagination .page-item:last-child .page-link {
    background: var(--az-navy, #1a2b3c);
    border-color: var(--az-navy, #1a2b3c);
    color: #fff;
    font-size: 13px;
    padding: 0 14px;
    gap: 6px;
    font-weight: 700;
}

.cat-pagination .page-item:first-child .page-link:hover,
.cat-pagination .page-item:last-child .page-link:hover {
    background: var(--az-cta, #f0a500);
    border-color: var(--az-cta, #f0a500);
    color: var(--az-navy, #1a2b3c);
}

/* نقاط الفاصل ... */
.cat-pagination .page-item.disabled .page-link[aria-label] {
    opacity: 1;
    background: transparent;
    border-color: transparent;
    color: var(--tx-muted);
    box-shadow: none;
    pointer-events: none;
}

@media (max-width: 576px) {
    .cat-pagination {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cat-pagination__btns,
    .cat-pagination .pagination {
        justify-content: center;
        width: 100%;
    }
}

/* ══════════════════════════════════════════
   Grid System
══════════════════════════════════════════ */
.cat-grid-btns {
    display: flex;
    gap: 4px;
}

.cat-grid-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid var(--cat-border);
    border-radius: 8px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    transition: all 0.3s ease;
}

.cat-grid-btn:hover {
    border-color: var(--az-cta, #f0a500);
    color: var(--az-cta, #f0a500);
}

.cat-grid-btn.active {
    background: var(--az-navy, #1a2b3c);
    border-color: var(--az-navy, #1a2b3c);
    color: #fff;
}

.cat-grid-btn.active i,
.cat-grid-btn.active .fa,
.cat-grid-btn.active .fas,
.cat-grid-btn.active .fa-solid {
    color: #fff !important;
}

.product-grid-item .p-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-grid-item .p-body {
    flex: 1;
}

/* ══════════════════════════════════════════
   MOBILE SIDEBAR OVERLAY
══════════════════════════════════════════ */
.cat-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 1199;
    backdrop-filter: blur(2px);
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 991px) {

    /* Hide desktop sidebar, show as drawer */
    .cat-sidebar {
        position: fixed;
        top: 0;
        inset-inline-start: -100%;
        width: min(var(--cat-sidebar-w), 85vw);
        height: 100%;
        max-height: 100%;
        z-index: 1200;
        border-radius: 0;
        transition: inset-inline-start .3s ease;
        overflow-y: auto;
    }

    .cat-sidebar--open {
        inset-inline-start: 0;
    }

    .cat-sidebar-active .cat-sidebar-overlay {
        display: block;
    }

    .cat-sidebar__close {
        display: flex;
    }

    /* Show filter button in toolbar */
    .cat-toolbar__filter-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    .cat-hero {
        min-height: 130px;
    }

    .cat-hero__body {
        padding: 22px 0 18px;
    }

    .cat-hero__title {
        font-size: 1.4rem;
    }

    .cat-badges__inner {
        gap: 0;
    }

    .cat-badge {
        padding: 10px 14px;
        min-width: 140px;
        border-inline-end: none;
        border-bottom: 1px solid rgba(255, 255, 255, .08);
    }

    .cat-badge:last-child {
        border-bottom: none;
    }

    .cat-page__inner {
        padding-inline: 10px;
    }

    .cat-toolbar {
        padding: 8px 10px;
    }

    .cat-toolbar__count {
        display: none;
    }
}

@media (max-width: 480px) {
    .cat-badges__inner {
        flex-direction: column;
    }

    .cat-badge {
        width: 100%;
    }
}

/* ══════════════════════════════════════════
   RTL SUPPORT
══════════════════════════════════════════ */
[dir="rtl"] .cat-sidebar--open {
    inset-inline-start: 0;
}

[dir="rtl"] .cat-breadcrumb__sep i {
    transform: scaleX(-1);
}