/* Category listing — advanced / app-style */
.cat-page {
    background: #f3f4f6;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0));
}

.cat-hero-app {
    position: relative;
    min-height: 140px;
    background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #4b5563 100%);
    overflow: hidden;
}

.cat-hero-app.has-image {
    min-height: 180px;
}

.cat-hero-app .cat-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-hero-app .cat-hero-overlay-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(17, 24, 39, .88) 0%, rgba(17, 24, 39, .55) 60%, rgba(249, 168, 37, .25) 100%);
}

.cat-hero-inner {
    position: relative;
    z-index: 2;
    padding: 16px 0 20px;
}

.cat-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-bottom: 10px;
}

.cat-breadcrumb a {
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
}

.cat-breadcrumb a:hover {
    color: #F9A825;
}

.cat-breadcrumb span {
    color: rgba(255, 255, 255, .45);
}

.cat-breadcrumb .active {
    color: #fff;
    font-weight: 600;
}

.cat-hero-title {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.cat-hero-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #F9A825, #FF6F00);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #1e293b;
    box-shadow: 0 4px 16px rgba(249, 168, 37, .4);
}

.cat-hero-title h1 {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.02em;
}

.cat-hero-title p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, .85);
    line-height: 1.45;
    max-width: 520px;
}

.cat-hero-meta {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.cat-hero-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .2);
}

.cat-hero-pill.highlight {
    background: linear-gradient(135deg, #F9A825, #FF6F00);
    color: #1e293b;
    border: none;
}

/* Subcategory scroll */
.cat-sub-scroll-wrap {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
}

.cat-sub-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.cat-sub-scroll::-webkit-scrollbar {
    display: none;
}

.cat-sub-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    transition: all .15s;
}

.cat-sub-pill i {
    font-size: 14px;
    color: #F9A825;
}

.cat-sub-pill:hover {
    border-color: #F9A825;
    color: #111827;
}

.cat-sub-pill.active {
    background: linear-gradient(135deg, #F9A825, #FF6F00);
    color: #1e293b;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(249, 168, 37, .35);
}

.cat-sub-pill.active i {
    color: #1e293b;
}

/* Toolbar */
.cat-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    flex-wrap: wrap;
}

.cat-toolbar-count {
    font-size: 14px;
    color: #6b7280;
    margin-right: auto;
}

.cat-toolbar-count strong {
    color: #111827;
}

.cat-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    cursor: pointer;
}

.cat-tool-btn:hover {
    border-color: #F9A825;
}

.cat-tool-btn.has-filters {
    background: #fffbeb;
    border-color: #F9A825;
    color: #92400e;
}

.cat-sort-select {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 36px 10px 14px;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    min-width: 160px;
}

.cat-view-toggle {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.cat-view-toggle button {
    border: none;
    background: transparent;
    padding: 10px 12px;
    color: #9ca3af;
    cursor: pointer;
}

.cat-view-toggle button.active {
    background: #1f2937;
    color: #fff;
}

/* Active filters */
.cat-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 12px;
}

.cat-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    text-decoration: none;
}

.cat-filter-chip:hover {
    background: #fffbeb;
    color: #92400e;
}

.cat-clear-all {
    font-size: 12px;
    font-weight: 700;
    color: #ef4444;
    text-decoration: none;
    padding: 6px 10px;
}

/* Layout */
.cat-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    padding: 0 16px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 991.98px) {
    .cat-layout {
        grid-template-columns: 1fr;
        padding: 0 0 24px;
    }

    .cat-filter-desktop {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .cat-filter-mobile-trigger {
        display: none !important;
    }
}

/* Filter panel desktop */
.cat-filter-panel {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    padding: 20px;
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
}

.cat-filter-panel h5 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cat-filter-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.cat-filter-section:last-of-type {
    border-bottom: none;
    margin-bottom: 12px;
}

.cat-filter-section h6 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9ca3af;
    font-weight: 700;
    margin-bottom: 12px;
}

.cat-brand-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cat-brand-chip {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    cursor: pointer;
    transition: all .15s;
}

.cat-brand-chip input {
    display: none;
}

.cat-brand-chip:has(input:checked) {
    background: #fffbeb;
    border-color: #F9A825;
    color: #92400e;
}

.cat-price-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.cat-price-preset {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
}

.cat-price-preset:hover {
    border-color: #F9A825;
}

.cat-rating-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    cursor: pointer;
}

.cat-rating-opt input {
    accent-color: #F9A825;
}

.cat-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.cat-filter-actions .btn-apply {
    flex: 1;
    background: linear-gradient(135deg, #F9A825, #FF6F00);
    border: none;
    color: #1e293b;
    font-weight: 700;
    padding: 12px;
    border-radius: 12px;
}

.cat-filter-actions .btn-reset {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    color: #6b7280;
}

/* Product area */
.cat-products-wrap {
    min-width: 0;
}

.cat-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.cat-product-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.cat-product-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
    .cat-product-grid.cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .cat-product-grid,
    .cat-product-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cat-hero-title h1 {
        font-size: 1.25rem;
    }
}

.cat-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    background: #fff;
    border-radius: 16px;
    border: 1px dashed #d1d5db;
}

.cat-empty i {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 12px;
}

/* Mobile filter drawer */
.cat-filter-drawer {
    position: fixed;
    inset: 0;
    z-index: 1050;
    pointer-events: none;
    visibility: hidden;
}

.cat-filter-drawer.open {
    pointer-events: auto;
    visibility: visible;
}

.cat-filter-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    transition: opacity .25s;
}

.cat-filter-drawer.open .cat-filter-backdrop {
    opacity: 1;
}

.cat-filter-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 88vh;
    background: #fff;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform .3s ease;
    display: flex;
    flex-direction: column;
}

.cat-filter-drawer.open .cat-filter-sheet {
    transform: translateY(0);
}

.cat-filter-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.cat-filter-sheet-body {
    overflow-y: auto;
    padding: 20px;
    flex: 1;
}

.cat-filter-sheet-foot {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
}

/* Promo strip */
.cat-promo-strip {
    margin: 0 16px 12px;
    padding: 12px 16px;
    background: linear-gradient(90deg, #fffbeb, #fef3c7);
    border: 1px solid #fde68a;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cat-promo-strip i {
    font-size: 18px;
    color: #F9A825;
}

/* Hero fallback gradients (no banner image) */
.cat-hero-app.cat-bg-fans { background: linear-gradient(135deg, #4e342e, #8d6e63); }
.cat-hero-app.cat-bg-lighting { background: linear-gradient(135deg, #f57f17, #ffb300); }
.cat-hero-app.cat-bg-switches-accessories { background: linear-gradient(135deg, #455a64, #78909c); }
.cat-hero-app.cat-bg-home-appliances { background: linear-gradient(135deg, #1565c0, #42a5f5); }
.cat-hero-app.cat-bg-home-electricals { background: linear-gradient(135deg, #2e7d32, #66bb6a); }
.cat-hero-app.cat-bg-switchgears { background: linear-gradient(135deg, #37474f, #607d8b); }
.cat-hero-app.cat-bg-offers { background: linear-gradient(135deg, #e65100, #ff9800); }
.cat-hero-app[class*="cat-bg-"]:not(.has-image) .cat-hero-overlay-gradient { display: none; }
