/* ==========================================================================
   PC KUMAR — CATEGORY PAGE FULLY RESPONSIVE STYLESHEET (category.css)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GLOBAL PAGE LAYOUT & TYPOGRAPHY
   -------------------------------------------------------------------------- */
.category-page-body {
    color: #0f172a;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
}

/* --------------------------------------------------------------------------
   2. HERO CATEGORY BANNER & BREADCRUMBS
   -------------------------------------------------------------------------- */
.cat-hero-banner {
    position: relative;
    background: #f4f5f8;
    border-bottom: 1px solid #e2e8f0;
    padding: 36px 0 30px;
    text-align: center;
}

.cat-hero-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
}

.cat-hero-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cat-hero-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    color: #1e293b;
}

.cat-breadcrumb-strip {
    padding-top: 10px;
    font-size: 13px;
    font-weight: 500;
}

.bc-path {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #64748b;
}

.bc-link {
    color: #334155;
    text-decoration: none;
    transition: color 0.2s ease;
}

.bc-link:hover {
    color: #dc2626;
}

.bc-sep {
    color: #94a3b8;
}

.bc-current {
    color: #dc2626;
    font-weight: 700;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   3. MAIN CATALOG LAYOUT
   -------------------------------------------------------------------------- */
.cat-main-layout {
    padding: 40px 0 60px;
    overflow: visible !important;
}

.cat-layout-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start !important; /* CRITICAL FOR STICKY WORK */
}

.cat-sidebar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
    /* Sticky Position Engine */
    position: sticky !important;
    top: 90px !important; /* Pins 90px below header */
    align-self: start !important;
    z-index: 90;
    /* Spans Screen Height + Internal Scroll */
    height: auto !important;
    max-height: calc(100vh - 110px) !important;
    overflow-y: auto !important;
    box-sizing: border-box;
}

/* Smooth Custom Scrollbar */
.cat-sidebar::-webkit-scrollbar {
    width: 5px;
}
.cat-sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.cat-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.cat-sidebar::-webkit-scrollbar-thumb:hover {
    background: #dc2626;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.sidebar-title {
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-clear-filters {
    background: transparent;
    border: none;
    color: #dc2626;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-clear-filters:hover {
    text-decoration: underline;
}

.sidebar-close-btn {
    display: none; /* Hidden on Desktop */
}

.mobile-filter-btn {
    display: none; /* Hidden on Desktop */
}

.filter-backdrop {
    display: none; /* Hidden on Desktop */
}

/* Sidebar Groups */
.filter-group {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-group-title {
    font-size: 11.5px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Radio & Checkbox Styling */
.filter-options-list, 
.filter-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-radio-label, 
.filter-check-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    user-select: none;
    transition: color 0.2s;
}

.filter-radio-label:hover, 
.filter-check-label:hover {
    color: #dc2626;
}

.filter-radio-label input, 
.filter-check-label input {
    display: none;
}

.radio-custom, 
.check-custom {
    width: 16px;
    height: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    flex-shrink: 0;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.check-custom {
    border-radius: 4px;
}

.filter-radio-label input:checked + .radio-custom {
    border-color: #dc2626;
    background: #dc2626;
}

.filter-radio-label input:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
}

.filter-check-label input:checked + .check-custom {
    border-color: #dc2626;
    background: #dc2626;
}

.filter-check-label input:checked + .check-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: #ffffff;
    position: absolute;
    top: 1px;
    left: 2px;
}

.filter-name {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-count {
    font-size: 11px;
    color: #64748b;
    background: #f4f5f8;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   5. TOOLBAR & CONTENT AREA
   -------------------------------------------------------------------------- */
.cat-content-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cat-toolbar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-grow: 1;
}

.cat-search-box {
    position: relative;
    flex-grow: 1;
    max-width: 380px;
}

.search-ic {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.cat-search-input {
    width: 100%;
    background: #f4f5f8;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px 14px 9px 38px;
    color: #0f172a;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.cat-search-input:focus {
    border-color: #dc2626;
    background: #ffffff;
}

.showing-count-text {
    font-size: 13px;
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sort-dropdown-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #475569;
    font-weight: 600;
}

.sort-select {
    background: #f4f5f8;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.view-mode-buttons {
    display: flex;
    gap: 4px;
    background: #f4f5f8;
    border: 1px solid #cbd5e1;
    padding: 3px;
    border-radius: 8px;
}

.view-btn {
    background: transparent;
    border: none;
    color: #64748b;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.view-btn.active, 
.view-btn:hover {
    background: #ffffff;
    color: #dc2626;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* --------------------------------------------------------------------------
   6. PRODUCT CARDS GRID SYSTEM
   -------------------------------------------------------------------------- */
.cat-products-grid {
    display: grid;
    gap: 20px;
}

.cat-products-grid.grid-3-col {
    grid-template-columns: repeat(3, 1fr);
}

.cat-products-grid.grid-4-col {
    grid-template-columns: repeat(4, 1fr);
}

/* --------------------------------------------------------------------------
   LIST VIEW ENGINE (.cat-products-grid.list-view)
   -------------------------------------------------------------------------- */

/* Force single column grid */
.cat-products-grid.list-view {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
}

/* Horizontal card container */
.cat-products-grid.list-view .cat-prod-card {
    flex-direction: row !important;
    align-items: stretch !important;
    min-height: 200px !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    overflow: hidden !important;
}

/* Left image stage */
.cat-products-grid.list-view .card-img-stage {
    width: 220px !important;
    height: 100% !important;
    min-height: 200px !important;
    aspect-ratio: auto !important;
    flex-shrink: 0 !important;
    background: #f8fafc !important;
    border-bottom: none !important;
    border-right: 1px solid #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.cat-products-grid.list-view .card-prod-img {
    max-width: 100% !important;

    object-fit: contain !important;
}

/* Right content details stage */
.cat-products-grid.list-view .card-info-stage {
    padding: 20px 24px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    gap: 8px !important;
    justify-content: center !important;
}

.cat-products-grid.list-view .card-prod-title {
    font-size: 17px !important;
    font-weight: 700 !important;
    height: auto !important;
    line-height: 1.35 !important;
    margin-bottom: 2px !important;
}

/* Product specs summary description */
.cat-products-grid.list-view .card-summary-text {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    font-size: 13px !important;
    color: #64748b !important;
    line-height: 1.5 !important;
    margin: 4px 0 8px !important;
}

/* Price row */
.cat-products-grid.list-view .card-price-row {
    margin-top: auto !important;
    margin-bottom: 0 !important;
    padding-top: 6px !important;
    gap: 12px !important;
    align-items: center !important;
}

.cat-products-grid.list-view .price-current {
    font-size: 24px !important;
    font-weight: 700 !important;
}

/* Action buttons row */
.cat-products-grid.list-view .card-actions-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 12px !important;
    max-width: 480px !important;
}

.cat-products-grid.list-view .btn-card-details,
.cat-products-grid.list-view .btn-card-wa {
    flex: 1 !important;
    padding: 10px 16px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
    height: 40px !important;
}

/* Mobile responsive collapse */
@media (max-width: 600px) {
    .cat-products-grid.list-view .cat-prod-card {
        flex-direction: column !important;
    }
    .cat-products-grid.list-view .card-img-stage {
        width: 100% !important;
        height: 200px !important;
        border-right: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }
}
/* Product Card Styling */
.cat-prod-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.cat-prod-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.card-img-stage {
    position: relative;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-prod-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.cat-prod-card:hover .card-prod-img {
    transform: scale(1.06);
}

.card-info-stage {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 8px;
}

.card-cat-tag {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-prod-title {
    font-size: 14.5px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-prod-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.card-prod-title a:hover {
    color: #dc2626;
}

.card-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
}

.price-current {
    font-size: 20px;
    font-weight: 700;
    color: #dc2626;
}

.price-original {
    font-size: 12.5px;
    color: #94a3b8;
    text-decoration: line-through;
}

.card-actions-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-card-details {
    background: #f4f5f8;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-card-details:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.btn-card-wa {
    flex: 1;
    gap: 6px;
    background: #25d366;
    color: #ffffff;
    padding: 9px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease;
}

.btn-card-wa:hover {
    background: #20ba5a;
}

.hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   7. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */

/* Large Laptops & Small Desktops (1025px to 1200px) */
@media (max-width: 1200px) {
    .cat-layout-container {
        padding: 0 24px;
        grid-template-columns: 250px 1fr;
        gap: 24px;
    }

    .cat-products-grid.grid-3-col,
    .cat-products-grid.grid-4-col {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablets & Small Laptops (<= 1024px) — DRAWER CONVERSION */
@media (max-width: 1024px) {
    .cat-layout-container {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }

    /* Show Mobile Filter Button */
    .mobile-filter-btn {
        display: inline-flex !important;
        align-items: center;
        gap: 8px;
        background: #dc2626;
        color: #ffffff;
        padding: 8px 16px;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 700;
        border: none;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .mobile-filter-btn:hover {
        background: #b91c1c;
    }

    /* Convert Sidebar into Slide-Out Drawer */
    .cat-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 320px;
        max-width: 85vw;
        height: 100vh !important;
        max-height: 100vh !important;
        background: #ffffff;
        z-index: 1250 !important;
        box-shadow: 8px 0 32px rgba(15, 23, 42, 0.25);
        overflow-y: auto;
        transform: translateX(-100%) !important;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
        padding: 24px 20px 40px;
        margin: 0;
        border-radius: 0 !important;
        border: none !important;
    }

    .cat-sidebar.active {
        transform: translateX(0) !important;
    }

    .sidebar-close-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 6px;
        background: #f1f5f9;
        border: 1px solid #cbd5e1;
        color: #0f172a;
        font-size: 15px;
        cursor: pointer;
    }

    .sidebar-close-btn:hover {
        background: #fee2e2;
        color: #dc2626;
    }

    /* Dimmed Backdrop Overlay */
    .filter-backdrop {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1240;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .filter-backdrop.active {
        opacity: 1 !important;
        visibility: visible !important;
    }

    .cat-products-grid.grid-3-col,
    .cat-products-grid.grid-4-col {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets (<= 768px) */
@media (max-width: 768px) {
    .cat-hero-title {
        font-size: 32px;
    }

    .cat-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left {
        justify-content: space-between;
    }

    .cat-search-box {
        max-width: none;
    }

    .toolbar-right {
        justify-content: space-between;
    }

    .sort-select {
        flex-grow: 1;
    }
}

/* Mobile Phones (<= 600px) */
@media (max-width: 600px) {
    .cat-layout-container {
        padding: 0 12px;
    }

    .cat-products-grid.grid-3-col,
    .cat-products-grid.grid-4-col {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .card-info-stage {
        padding: 12px;
    }

    .card-prod-title {
        font-size: 12.5px;
        height: 34px;
    }

    .price-current {
        font-size: 16px;
    }

    .card-actions-row {
        flex-direction: column;
        gap: 6px;
    }

    .btn-card-details,
    .btn-card-wa {
        width: 100%;
        padding: 8px 6px;
        font-size: 10px;
    }
}

/* Extra Small Phones (<= 480px) */
@media (max-width: 480px) {
    .cat-hero-banner {
        padding: 24px 0 20px;
    }

    .cat-hero-title {
        font-size: 26px;
    }

    .bc-path {
        font-size: 11px;
    }

    .showing-count-text {
        font-size: 11px;
    }
}