/**
 * Category Tabs CSS - Loaded only on product category pages
 * Extracted from main style.css for conditional loading
 */

/* ===========================================
   CATEGORY NAVIGATION TABS
   Horizontal pill tabs for product categories
   =========================================== */

.mclean-category-tabs {
    width: 100%;
    margin-bottom: 32px;
    position: relative;
    padding: 0;
    box-sizing: border-box;
}

.mclean-category-tabs .tabs-scroll-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 4px 0;
    overflow: visible !important;
    overflow-x: visible !important;
    white-space: normal !important;
}

/* ===========================================
   HIDE SIDEBAR ON PRODUCT CATEGORY PAGES
   =========================================== */

/* Hide the left sidebar/widget area on product category archives */
.tax-product_cat #secondary,
.tax-product_cat .sidebar,
.tax-product_cat .widget-area,
.tax-product_cat aside#secondary,
.tax-product_cat .ast-sidebar-layout-configuration,
.woocommerce.tax-product_cat .widget_product_categories,
.woocommerce.tax-product_cat .woocommerce-widget-layered-nav,
body.tax-product_cat .elementor-widget-woocommerce-product-categories {
    display: none !important;
}

/* Make the content full width when sidebar is hidden */
.tax-product_cat #primary,
.tax-product_cat .ast-primary-content,
.tax-product_cat .content-area {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
}

/* Astra specific - force no sidebar layout */
.tax-product_cat.ast-separate-container #primary {
    margin: 0 auto;
}

/* For Elementor-based layouts */
.tax-product_cat .elementor-section.elementor-section-boxed > .elementor-container {
    max-width: 1200px;
}

/* Tab Styling */
.mclean-category-tabs .category-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 0;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
    flex-grow: 0;
    position: relative;
}

.mclean-category-tabs .category-tab .tab-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #b0b0b0;
    transition: color 0.2s ease;
}

.mclean-category-tabs .category-tab .tab-count {
    font-size: 10px;
    color: #808080;
    font-family: -apple-system, system-ui, sans-serif;
}

/* Hover State */
.mclean-category-tabs .category-tab:hover {
    border-color: #fcb316;
    background: #1a1a1a;
}

.mclean-category-tabs .category-tab:hover .tab-label {
    color: #ffffff;
}

/* Active State */
.mclean-category-tabs .category-tab.active {
    border: 2px solid #fcb316;
    background: transparent;
    padding-left: 17px; /* Adjust for border width change + accent bar */
}

.mclean-category-tabs .category-tab.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #fcb316;
}

.mclean-category-tabs .category-tab.active .tab-label {
    color: #fcb316;
}

.mclean-category-tabs .category-tab.active .tab-count {
    color: #fcb316;
    opacity: 0.7;
}

/* Featured/Flagship Category Tab - McLean DRS */
.mclean-category-tabs .category-tab.featured {
    background: #1a1a1a;
    border: 2px solid #fcb316;
    border-left: 4px solid #fcb316;
    order: -1; /* Always first via flexbox */
}

.mclean-category-tabs .category-tab.featured .tab-label {
    color: #fcb316;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.mclean-category-tabs .category-tab.featured .tab-count {
    color: #fcb316;
    opacity: 0.8;
}

.mclean-category-tabs .category-tab.featured:hover {
    background: #fcb316;
    border-color: #fcb316;
}

.mclean-category-tabs .category-tab.featured:hover .tab-label,
.mclean-category-tabs .category-tab.featured:hover .tab-count {
    color: #0a0a0a;
}

/* Featured + Active state */
.mclean-category-tabs .category-tab.featured.active {
    background: #fcb316;
    border: 2px solid #fcb316;
    border-left: 4px solid #0a0a0a;
    box-shadow: 0 0 15px rgba(252, 179, 22, 0.4);
}

.mclean-category-tabs .category-tab.featured.active::before {
    display: none;
}

.mclean-category-tabs .category-tab.featured.active .tab-label,
.mclean-category-tabs .category-tab.featured.active .tab-count {
    color: #0a0a0a;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .mclean-category-tabs {
        margin-bottom: 24px;
    }

    .mclean-category-tabs .tabs-scroll-container {
        gap: 8px;
    }

    .mclean-category-tabs .category-tab {
        padding: 10px 14px;
        min-height: 44px; /* Touch target */
    }

    .mclean-category-tabs .category-tab .tab-label {
        font-size: 10px;
    }

    .mclean-category-tabs .category-tab .tab-count {
        font-size: 9px;
    }

    .mclean-category-tabs .category-tab.active {
        padding-left: 11px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .mclean-category-tabs .category-tab {
        padding: 8px 10px;
    }

    .mclean-category-tabs .category-tab .tab-label {
        font-size: 9px;
        letter-spacing: 0.05em;
    }
}

/* Mobile Dropdown Alternative (hidden by default, enable via class) */
.mclean-category-tabs-dropdown {
    display: none;
}

.mclean-category-tabs-dropdown .mobile-filter-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 16px;
    background: #141414;
    border: 1px solid #2a2a2a;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #b0b0b0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mclean-category-tabs-dropdown .mobile-filter-trigger:hover,
.mclean-category-tabs-dropdown .mobile-filter-trigger.open {
    border-color: #fcb316;
    color: #fcb316;
}

.mclean-category-tabs-dropdown .mobile-filter-trigger .chevron {
    transition: transform 0.2s ease;
    border: solid #b0b0b0;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
}

.mclean-category-tabs-dropdown .mobile-filter-trigger.open .chevron {
    transform: rotate(-135deg);
}

.mclean-category-tabs-dropdown .mobile-filter-trigger:hover .chevron,
.mclean-category-tabs-dropdown .mobile-filter-trigger.open .chevron {
    border-color: #fcb316;
}

.mclean-category-tabs-dropdown .dropdown-list {
    display: none;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-top: none;
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

.mclean-category-tabs-dropdown .dropdown-list.open {
    display: block;
}

.mclean-category-tabs-dropdown .dropdown-item {
    margin: 0;
}

.mclean-category-tabs-dropdown .dropdown-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    color: #b0b0b0;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.mclean-category-tabs-dropdown .dropdown-item a:hover {
    background: #1a1a1a;
    border-left-color: #fcb316;
    color: #fcb316;
}

.mclean-category-tabs-dropdown .dropdown-item.active a {
    background: #1a1a1a;
    border-left-color: #fcb316;
    color: #ffffff;
}

.mclean-category-tabs-dropdown .dropdown-item .cat-count {
    font-size: 10px;
    color: #808080;
    font-family: -apple-system, system-ui, sans-serif;
}

/* WooCommerce Widget Overrides (for sidebar if needed) */
.woocommerce-widget-layered-nav-list,
.widget_product_categories .product-categories {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-widget-layered-nav-list li,
.widget_product_categories .product-categories li {
    margin: 0 !important;
}

.woocommerce-widget-layered-nav-list li a,
.widget_product_categories .product-categories li a {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 16px !important;
    background: transparent !important;
    border-left: 3px solid transparent !important;
    text-decoration: none !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #b0b0b0 !important;
    transition: all 0.2s ease !important;
}

.woocommerce-widget-layered-nav-list li a:hover,
.widget_product_categories .product-categories li a:hover {
    background: #141414 !important;
    border-left-color: #fcb316 !important;
    color: #fcb316 !important;
}

.woocommerce-widget-layered-nav-list li.current-cat a,
.woocommerce-widget-layered-nav-list li.chosen a,
.widget_product_categories .product-categories li.current-cat a,
.widget_product_categories .product-categories li.current-cat > a {
    background: #141414 !important;
    border-left-color: #fcb316 !important;
    color: #ffffff !important;
}

/* Product count styling in widgets */
.woocommerce-widget-layered-nav-list li .count,
.widget_product_categories .product-categories li .count {
    font-size: 11px !important;
    color: #808080 !important;
    font-family: -apple-system, system-ui, sans-serif !important;
    background: transparent !important;
}
