/**
 * Category Archive Page Styles
 *
 * Handles non-sidebar styles for category archive pages:
 * - Main content area layout
 * - Category header styling
 * - Child category cards grid
 * - Product display styles
 * - Filter Section
 * - Grid/Table Views
 *
 * Sidebar functionality is handled by sidebar.css module
 *
 * @version 2.0.0
 * @package Kadence_Child
 */

/* ============================================
   MAIN LAYOUT CONTAINER
   ============================================ */

.category-archive-container {
    display: grid;
    grid-template-columns: 20% 60% 20%;
    width: 100%;
    min-height: calc(100vh - 200px);
    margin: 0;
    padding: 20px 0;
    margin-top: 20px;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.category-main-content {
    padding: 35px 20px;
    display: flex;
    flex-direction: column;
}

/* ============================================
   CATEGORY HEADER
   ============================================ */

.parent-category-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #FFC773;
}

.category-title {
    font-size: 42px;
    font-weight: 800;
    /* Extra bold */
    letter-spacing: -2px;
    /* Tight tracking */
    color: #007BFF;
    margin-bottom: 6px;
    text-transform: uppercase;
    /* Industrial confidence */
}

.category-description {
    font-size: 16px;
    line-height: 1.6;
    color: #0b1611;
    max-width: 800px;
    margin: 0 auto;
}

/* ============================================
   FILTER ERROR STATE
   ============================================ */

.filter-error {
    text-align: center;
    padding: 40px 20px;
    background: #fef3f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
}

.filter-error p {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 500;
}

.filter-error button {
    padding: 10px 20px;
    background: #991b1b;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.filter-error button:hover {
    background: #7f1d1d;
}

/* ============================================
   PRODUCT SEARCH BOX
   ============================================ */

.product-search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 0 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-wrapper:focus-within {
    border-color: #007BFF;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-icon {
    color: #999;
    flex-shrink: 0;
}

.product-search-input {
    flex: 1;
    border: none;
    padding: 12px 10px;
    font-size: 14px;
    background: transparent;
    outline: none;
}

.product-search-input::placeholder {
    color: #999;
}

.search-clear-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: #333;
}

/* Search Results Panel */
.search-results-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    z-index: 200;
    max-height: 400px;
    overflow-y: auto;
}

.search-results-list {
    padding: 8px 0;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    transition: all 0.1s ease;
}

.search-result-item:hover {
    background: #f5f5f5;
    transform: scale(1.02);
}

.search-result-item:hover .search-result-name {
    font-weight: 700;
    color: #000;
}

.search-result-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background: #f0f0f0;
    flex-shrink: 0;
}

.search-result-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
    transition: font-weight 0.1s ease, color 0.1s ease;
}

.search-result-category {
    flex-shrink: 0;
    font-size: 12px;
    color: #888;
    text-align: right;
    white-space: nowrap;
    margin-left: auto;
    padding-left: 12px;
}

.search-no-results {
    padding: 20px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.search-loading {
    padding: 20px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ============================================
   FILTER SECTION - BASE
   ============================================ */

.filter-section {
    background: #fff;
    /* Clean white */
    border: 1px solid #E0E0E0;
    /* Neo-Modernist Border */
    border-radius: 6px;
    /* Engineered look */
    padding: 20px;
    margin-bottom: 20px;
}

.filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #E0E0E0;
    /* Stronger divider */
}

.filter-title {
    font-size: 18px;
    font-weight: 800;
    /* Bold */
    letter-spacing: -0.5px;
    color: #333;
    margin: 0;
    text-transform: uppercase;
}


.filter-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Desktop Collapse Toggle - Sibling to Clear All */
.filter-collapse-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid #6c757d;
    color: #6c757d;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-collapse-toggle:hover {
    background: #6c757d;
    color: white;
}

.filter-collapse-toggle:hover .toggle-icon {
    stroke: white;
}

.toggle-text {
    font-weight: 500;
}

.toggle-icon {
    width: 12px;
    height: 12px;
    stroke: #6c757d;
    transition: transform 0.3s ease, stroke 0.2s ease;
}

.filter-section.collapsed .toggle-icon {
    transform: rotate(180deg);
}

/* Mobile Filter Trigger (Hidden on Desktop) */
.mobile-filter-trigger {
    display: none;
}

/* Drawer Header (Hidden on Desktop) */
.filter-drawer-header {
    display: none;
}



/* Filter Body (Collapsible Container) */
.filter-body {
    max-height: 1000px;
    opacity: 1;
    overflow: visible;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.filter-section.collapsed .filter-body {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
}

/* Filter Drawer Footer (Hidden on Desktop) */
.filter-drawer-footer {
    display: none;
}

/* Filter Reset Button */
.filter-reset-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #FF6B00;
    /* High-Voltage Orange - Solid */
    border: none;
    color: white;
    padding: 8px 14px;
    /* More substantial */
    border-radius: 4px;
    /* Engineered */
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-reset-btn:focus {
    outline: none;
    background: #FF6B00;
    /* Force Default Orange */
    color: white;
}

.filter-reset-btn:hover {
    background: #333;
    /* Sudden inversion */
    color: white;
    transform: translateY(-2px);
}

.filter-reset-btn:active {
    transform: scale(0.95);
    /* Tactile Feedback */
}

.reset-icon {
    font-size: 16px;
    font-weight: bold;
}

/* Filter Row Containers */
.filter-dropdowns-row,
.filter-sliders-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.filter-sliders-row {
    margin-bottom: 0;
}

/* ============================================
   MOBILE FILTER DRAWER - Apple Style
   ============================================ */

@media (max-width: 767px) {
    .filter-section {
        padding: 0;
        background: transparent;
        border: none;
        margin-bottom: 0;
    }

    .filter-section-header {
        display: none;
    }

    /* Filters Trigger - Compact Pill Tool Style */
    .mobile-filter-trigger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: auto;
        padding: 10px 16px;
        background: #f0f0f0;
        color: #333;
        border: 1px solid #333;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0;
        cursor: pointer;
        transition:
            transform 0.15s ease,
            background 0.15s ease;
        -webkit-tap-highlight-color: transparent;
        position: relative;
    }

    .mobile-filter-trigger:active {
        transform: scale(0.97);
        background: #e0e0e0;
    }

    /* Add border for visibility - no duplicate icon */

    /* Active Filter Indicator - Blue Dot */
    .active-filter-count {
        display: none;
        width: 8px;
        height: 8px;
        background: #007aff;
        border-radius: 50%;
        position: absolute;
        top: 6px;
        right: 6px;
        padding: 0;
    }

    .active-filter-count.has-filters {
        display: block;
    }

    /* Drag Handle - Apple Style */
    .filter-drawer-handle {
        display: none;
        padding: 12px 0 4px;
        text-align: center;
        cursor: grab;
        touch-action: none;
    }

    .filter-drawer-handle:active {
        cursor: grabbing;
    }

    .drag-handle-bar {
        display: inline-block;
        width: 36px;
        height: 5px;
        background: rgba(0, 0, 0, 0.15);
        border-radius: 3px;
        transition: background 0.2s, width 0.2s;
    }

    .filter-drawer-handle:active .drag-handle-bar {
        background: rgba(0, 0, 0, 0.3);
        width: 40px;
    }

    /* Drawer Header - Apple Large Title */
    .filter-drawer-header {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 8px 20px 16px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        background: transparent;
    }

    .drawer-title {
        font-size: 20px;
        font-weight: 700;
        color: #1c1c1e;
        letter-spacing: -0.4px;
        margin: 0;
        text-align: center;
    }

    /* Hide reset button in header - use footer instead */
    .drawer-reset {
        display: none;
    }

    /* Filter Drawer Container - Frosted Glass */
    .filter-body {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 85vh;
        max-height: 85vh;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: 24px 24px 0 0;
        z-index: 50000;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
        box-shadow:
            0 -10px 40px rgba(0, 0, 0, 0.12),
            0 -2px 10px rgba(0, 0, 0, 0.08);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Static Header */
    .drawer-static-header {
        flex-shrink: 0;
        background: transparent;
        z-index: 10;
        border-radius: 24px 24px 0 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        touch-action: none;
        cursor: grab;
    }

    /* Scrollable Content */
    .drawer-scrollable-content {
        flex-grow: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        padding: 16px 20px;
        touch-action: pan-y;
    }

    /* Hide scrollbar */
    .drawer-scrollable-content::-webkit-scrollbar {
        width: 0;
        display: none;
    }

    /* Footer with safe area */
    .filter-drawer-footer {
        flex-shrink: 0;
        background: rgba(255, 255, 255, 0.95);
        padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(0, 0, 0, 0.06);
    }

    .filter-body.drawer-open {
        display: flex;
    }

    .filter-body.drawer-open .filter-drawer-handle {
        display: block;
    }

    .filter-body.is-open {
        transform: translateY(0);
    }

    .filter-body.is-dragging {
        transition: none;
    }

    /* Overlay - Frosted Glass */
    .filter-drawer-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 49999;
        opacity: 0;
        transition: opacity 0.35s ease;
    }

    .filter-drawer-overlay.is-open {
        opacity: 1;
    }

    /* Body Scroll Lock */
    body.filter-drawer-active {
        overflow: hidden;
        position: fixed;
        width: 100%;
        overscroll-behavior: none;
    }

    /* Done Button - Apple Style */
    .filter-drawer-done {
        width: 100%;
        padding: 16px 20px;
        background: #007aff;
        color: white;
        border: none;
        border-radius: 14px;
        font-size: 17px;
        font-weight: 600;
        letter-spacing: -0.2px;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25);
        transition:
            transform 0.15s ease,
            background 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .filter-drawer-done:active {
        transform: scale(0.97);
        background: #0062cc;
    }

    /* Dropdowns/Sliders Layout */
    .filter-dropdowns-row,
    .filter-sliders-row {
        flex-direction: column;
        gap: 12px;
    }

    .filter-dropdown {
        max-width: none;
    }

    /* Filter Dropdown - Apple Style */
    .filter-dropdown-header {
        padding: 14px 16px;
        background: rgba(118, 118, 128, 0.08);
        border: none;
        border-radius: 12px;
        transition:
            background 0.15s ease,
            transform 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .filter-dropdown-header:active {
        background: rgba(118, 118, 128, 0.16);
        transform: scale(0.98);
    }

    .filter-label {
        font-size: 16px;
        font-weight: 500;
        color: #1c1c1e;
    }

    /* Range Filter - Apple Style */
    .filter-range {
        background: rgba(118, 118, 128, 0.08);
        border: none;
        border-radius: 12px;
        padding: 14px 16px;
    }
}

/* Hide collapse toggle on mobile */
@media (max-width: 767px) {
    .filter-collapse-toggle {
        display: none;
    }
}


/* Dropdown Filters */
.filter-dropdown {
    position: relative;
    min-width: 180px;
    flex: 1;
    max-width: 250px;
}

.filter-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-dropdown-header:hover {
    border-color: #007bff;
}


.filter-dropdown-header:active {
    transform: scale(0.98);
    /* Tactile Feedback */
}

.filter-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.dropdown-arrow {
    font-size: 10px;
    color: #666;
    transition: transform 0.3s ease;
}

.dropdown-arrow.rotated {
    transform: rotate(180deg);
}

/* Desktop Hover Interaction (min-width: 992px) */
@media (min-width: 992px) {

    /* 1. Show options on hover */
    .filter-dropdown:hover .filter-dropdown-options {
        max-height: 280px;
        overflow-y: auto;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    /* 2. Rotate arrow on hover */
    .filter-dropdown:hover .dropdown-arrow {
        transform: rotate(180deg);
    }

    /* 3. Bridge the gap (fix for hover stability) */
    .filter-dropdown::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: 10px;
        /* Adjust based on margin-top of .filter-dropdown-options */
        background: transparent;
    }
}

.filter-dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    padding: 0;
    list-style: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease;
}

.filter-dropdown.expanded .filter-dropdown-options {
    max-height: 280px;
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0);
}

.filter-option {
    padding: 12px 20px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: none;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Custom Checkbox */
.filter-option::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.filter-option:last-child {
    border-bottom: none;
}

.filter-option:hover {
    background: #f5f5f5;
    color: #003366;
    /* Brand Blue */
    border-left-color: #003366;
}

.filter-option:hover::before {
    border-color: #003366;
}

.filter-option.selected {
    background: #e8f0fe;
    color: #003366;
    font-weight: 600;
    border-left-color: #003366;
}

.filter-option.selected::before {
    background: #003366;
    border-color: #003366;
    content: '✓';
    /* Simple checkmark */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.option-count {
    color: #999;
    font-size: 12px;
    margin-left: 5px;
}

/* Range Filters */
.filter-range {
    min-width: 200px;
    flex: 1;
    max-width: 280px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 15px;
}

.filter-range-header {
    margin-bottom: 10px;
}

.filter-range-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.range-inputs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.range-input-min,
.range-input-max {
    width: 70px;
    max-width: 70px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    box-sizing: border-box;
    appearance: textfield;
    -moz-appearance: textfield;
}


.range-input-min::-webkit-outer-spin-button,
.range-input-min::-webkit-inner-spin-button,
.range-input-max::-webkit-outer-spin-button,
.range-input-max::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.range-separator {
    color: #999;
}

.range-slider {
    margin-top: 5px;
}

/* ============================================
   RANGE SLIDER STYLES
   ============================================ */

/* noUiSlider Custom Styles */
.noUi-target {
    background: #e0e0e0;
    border: none;
    border-radius: 4px;
    height: 8px;
}

.noUi-connect {
    background: #FF6B00;
    /* Brand Orange */
}

.noUi-handle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid #FF6B00;
    /* Brand Orange */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: grab;
    top: -5px;
    right: -9px;
}

.noUi-handle:before,
.noUi-handle:after {
    display: none;
}

.noUi-handle:active {
    cursor: grabbing;
    transform: scale(1.1);
    /* Slight enlarge on grab */
    border-width: 3px;
}


/* ============================================
   DISPLAY CONTROLS
   ============================================ */

.display-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
}

.filter-result-count {
    font-size: 14px;
    color: #666;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-toggle-btn {
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #E0E0E0;
    /* Neo-Modernist */
    border-radius: 4px;
    /* Engineered */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    color: #666;
}

.view-toggle-btn:hover {
    background: #f8f9fa;
    border-color: #ccc;
    color: #333;
}

.view-toggle-btn.active {
    background: #FF6B00;
    /* Brand Orange */
    border-color: #FF6B00;
    color: white;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
    /* Sharp shadow */
}

.view-toggle-btn:active {
    transform: scale(0.95);
    /* Tactile Feedback */
}

.view-toggle-btn svg {
    display: block;
}


/* ============================================
   CHILD CATEGORY CARDS GRID (Parent Page)
   ============================================ */

.child-category-cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8%;
    row-gap: 50px;
    margin: 0 auto;
    max-width: 100%;
}

.child-category-card {
    display: block;
    width: 20%;
    text-decoration: none;
    color: #0b1611;
    border: 1px solid #E0E0E0;
    /* Neo-Modernist Border */
    border-radius: 6px;
    /* Engineered look */
    background: #fff;
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.child-category-card:hover {
    transform: translateY(-4px);
    /* Physical reaction */
    border-color: #FF6B00;
    /* High-Voltage Orange */
    text-decoration: none;
    color: inherit;
    /* Optional: crisp shadow for lift, not soft blur */
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.05);
}

.card-title {
    font-size: 20px;
    font-weight: 800;
    /* Bold & Confident */
    letter-spacing: -0.5px;
    /* Tight tracking */
    color: #333;
    text-align: center;
    line-height: 1.4;
    transition: color 0.2s ease;
    padding: 15px 10px;
}

/* Removed previous ::after underline in favor of border interaction */
.card-title::after {
    display: none;
}

.child-category-card:hover .card-title {
    color: #FF6B00;
}

.card-image {
    width: 100%;
    padding-bottom: 100%;
    position: relative;
    background: #f8f9fa;
    border-radius: 0;
    /* Square edges inside for precision */
    overflow: hidden;
    margin-bottom: 0;
    border-bottom: 1px solid #f0f0f0;
}


.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.child-category-card:hover .card-image img {
    transform: scale(1.05);
    /* Snappy zoom */
}

.placeholder-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #e9ecef 25%, transparent 25%),
        linear-gradient(-45deg, #e9ecef 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e9ecef 75%),
        linear-gradient(-45deg, transparent 75%, #e9ecef 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* ============================================
   PRODUCT DISPLAY - GRID VIEW
   ============================================ */

.child-category-products {
    position: relative;
    min-height: 200px;
}

.child-category-products.view-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 6px;
    /* Engineered look */
    border: 1px solid #E0E0E0;
    /* Neo-Modernist Border */
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.25s ease, box-shadow 0.25s ease;
    /* Removed default soft shadow */
    box-shadow: none;
}

.product-card:hover {
    transform: translateY(-4px);
    /* Physical reaction */
    border-color: #FF6B00;
    /* High-Voltage Orange */
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.05);
    /* Engineered shadow */
}

.product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-card-image {
    width: 100%;
    padding-bottom: 100%;
    position: relative;
    background: #f5f5f5;
    border-bottom: 1px solid #f0f0f0;
    /* internal divider */
}

.product-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
    /* Snappy zoom */
}

.product-card-title {
    padding: 15px;
    font-size: 15px;
    font-weight: 700;
    color: #333;
    line-height: 1.4;
    text-align: center;
    letter-spacing: -0.3px;
}

.product-card-alias {
    padding: 0 15px 15px;
    font-size: 13px;
    font-weight: 400;
    color: #666;
    line-height: 1.3;
    text-align: center;
    font-style: italic;
}

/* Product Alias Column (Table View) */
.product-alias-cell {
    font-size: 13px;
    color: #666;
    font-style: italic;
    white-space: nowrap;
}

/* ============================================
   PRODUCT DISPLAY - TABLE VIEW
   ============================================ */

/* When in table mode, container uses block layout for table scroll */
.child-category-products.view-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}



/* Native HTML Table */
.product-table {
    width: 100%;
    min-width: max-content;
    border-collapse: collapse;
    table-layout: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    /* Slightly tighter */
}

/* Table Header */
.product-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #E0E0E0;
    /* crisper header border */
}

.product-table th {
    padding: 14px 20px;
    font-weight: 700;
    /* Bolder headers */
    font-size: 13px;
    color: #333;
    text-align: center;
    white-space: nowrap;
    text-transform: uppercase;
    /* Industrial label style */
    letter-spacing: 0.5px;
    border-bottom: none;
}

.product-table th.product-name-cell {
    text-align: left;
    position: sticky;
    left: 0;
    background: #f8f9fa;
    z-index: 11;
    box-shadow: 3px 0 0px rgba(0, 0, 0, 0.05);
    /* sharper shadow line */
}

/* Table Body */
.product-table tbody tr {
    transition: background 0.15s ease;
    border-bottom: 1px solid #eee;
}

.product-table tbody tr:hover {
    background: #fff8f0;
    /* Subtle orange tint on hover */
}

.product-table tbody tr:hover td.product-name-cell {
    background: #fff8f0;
}

.product-table td {
    padding: 12px 20px;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    text-align: left;
    /* Changed from center */
    font-family: 'Courier New', Courier, monospace;
    /* Monospace for specs */
}


.product-table tbody tr:last-child td {
    border-bottom: none;
}

/* Sticky First Column (Product Name) */
.product-table td.product-name-cell {
    position: sticky;
    left: 0;
    background: white;
    z-index: 10;
    min-width: 180px;
    text-align: center !important;
    vertical-align: middle !important;
    box-shadow: 3px 0 6px rgba(0, 0, 0, 0.06);
    font-family: inherit;
    /* Remove padding - link handles it */
    padding: 0 !important;
}

/* Product Name Link - Stretched to Fill Entire Cell */
.product-name-cell a {
    /* Fill entire cell */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 48px;
    padding: 12px 20px;
    /* Typography */
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* Hover State */
.product-name-cell a:hover {
    color: #FF6B00;
    background-color: #fff8f0;
}

/* Active/Focus State */
.product-name-cell a:active {
    opacity: 0.8;
}

.product-name-cell a:focus {
    outline: 2px solid #FF6B00;
    outline-offset: -2px;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination-container {
    margin-top: 30px;
}

.product-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.pagination-list {
    display: flex;
    gap: 5px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-item button {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-item button:hover {
    background: #f0f0f0;
    border-color: #007bff;
}

.pagination-item.active button {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.pagination-ellipsis span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: #999;
}

.pagination-info {
    font-size: 13px;
    color: #666;
}

/* ============================================
   LOADING STATE
   ============================================ */

.child-category-products.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

.products-loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* No Products */
.no-products-found,
.filter-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.filter-error {
    color: #dc3545;
}

/* ============================================
   RIGHT SIDEBAR AREA - CATEGORY DESCRIPTION
   ============================================ */

.category-right-area {
    padding: 20px;
    padding-top: 28px;
    /* Align with main content header */
}

.sidebar-category-description {
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    padding: 20px;
    position: sticky;
    top: 20px;
    /* Sticky positioning for long pages */
}

.sidebar-description-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #FFC773;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-description-content {
    font-size: 14px;
    line-height: 1.7;
    color: #555;
}

.sidebar-description-content p {
    margin: 0 0 12px 0;
}

.sidebar-description-content p:last-child {
    margin-bottom: 0;
}

/* Mobile Description - Hidden on Desktop */
.category-description-mobile {
    display: none;
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    padding: 15px 20px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.7;
    color: #555;
}

.category-description-mobile p {
    margin: 0 0 10px 0;
}

.category-description-mobile p:last-child {
    margin-bottom: 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (768px-1199px) */
@media (max-width: 1199px) and (min-width: 768px) {
    .category-archive-container {
        grid-template-columns: 25% 75%;
    }

    .category-right-area {
        display: none;
    }

    /* Show mobile description when sidebar is hidden */
    .category-description-mobile {
        display: block;
    }

    .child-category-products.view-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .child-category-card {
        width: 18%;
    }

    .filter-dropdown,
    .filter-range {
        max-width: 200px;
    }
}

/* Mobile (<768px) */
@media (max-width: 767px) {
    .category-archive-container {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .category-right-area {
        display: none;
    }

    /* Show mobile description when sidebar is hidden */
    .category-description-mobile {
        display: block;
    }

    .category-main-content {
        padding: 0 10px;
    }

    .category-title {
        font-size: 24px;
    }

    /* Filter adjustments */
    .filter-section {
        padding: 15px;
    }

    .filter-controls {
        flex-direction: column;
    }

    .filter-dropdown,
    .filter-range {
        max-width: 100%;
    }

    /* Grid adjustments */
    .child-category-products.view-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .child-category-cards-grid {
        gap: 4%;
        row-gap: 20px;
    }

    .child-category-card {
        width: 30%;
    }

    /* Pagination */
    .pagination-item button {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* Small mobile (<480px) */
@media (max-width: 479px) {
    .child-category-card {
        width: 48%;
    }

    .card-title {
        font-size: 12px;
    }
}