
/* ============================================
   ARCHIVE / CATEGORY PAGE CSS
   ============================================ */

.archive-product-page {
    /* Using page-width from base theme */
    padding-bottom: 5rem;
}

/* Header */
/* Header */
/* Header */
.archive-header {
    text-align: center;
    margin-bottom: 0; /* Removed margin as requested */
    position: relative;
    padding: 1.5rem 0; /* Reduced padding further */
    background: transparent; /* Removed background */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.archive-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

/* Gold decorative lines for the title - Matching Training Page */
.archive-title-line {
    height: 2px;
    width: 96px;
    background-color: #D4A574;
}

.archive-title {
    color: #FFFFFF;
    text-align: center;
    font-family: "Chakra Petch", sans-serif;
    font-size: 36px;
    font-style: normal;
    font-weight: 700;
    line-height: 40px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    margin: 0;
}

.archive-subtitle {
     color: #99A1AF;
     text-align: center;
     font-family: "Chakra Petch", sans-serif;
     font-size: 14px;
     font-style: normal;
     font-weight: 400;
     line-height: 20px;
     letter-spacing: 0.35px;
     text-transform: uppercase;
     margin-top: 10px;
}

/* Layout */
.archive-layout-container {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

/* Sidebar */
.archive-sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: #1A2332;
    border: 1px solid #2A3C4D;
    padding: 24px;
    margin-top: 60px; /* Push sidebar down to align with cards (below sorting) */
}

@media (max-width: 990px) {
    .archive-sidebar {
        display: block !important;
        width: 100% !important;
        margin-top: 0 !important;
        margin-bottom: 30px !important;
        box-sizing: border-box !important;
    }
}

.archive-filters-heading {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #2A3C4D;
}

.widget-title,
.archive-sidebar h2,
.archive-sidebar h3,
.archive-sidebar h4,
.archive-sidebar .wp-block-heading {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 16px !important;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 1rem;
    margin-top: 1.5rem; /* Add spacing between widgets */
    text-transform: uppercase;
    line-height: 1.2;
}

.archive-sidebar .widget:first-child h2,
.archive-sidebar .widget:first-child h3,
.archive-sidebar .widget:first-child .widget-title {
    margin-top: 0;
}

.filter-apply-btn {
    width: 100%;
    background: #D4A574;
    color: #000;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    padding: 12px;
    border: none;
    text-transform: uppercase;
    margin-top: 2rem;
    cursor: pointer;
}

/* Grid Area */
.archive-product-grid {
    flex-grow: 1;
}

/* Toolbar */
.archive-toolbar {
    display: flex;
    justify-content: flex-end; /* Align sorting to right */
    align-items: center;
    margin-bottom: 24px;
    background-color: transparent; /* Remove banner bg */
    padding: 0; /* Remove padding */
    border: none; /* Remove border */
}

.archive-filter-toggle {
    background: none;
    border: none;
    color: #FFF;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 14px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.archive-toolbar-right select.orderby {
    background-color: #0F1821;
    color: #FFF;
    border: 1px solid #2A3C4D;
    padding: 8px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

/* Archive Grid Override */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important; /* Default 3 */
    gap: 20px;
    padding: 0 !important;
    margin: 0 !important;
}

@media (min-width: 1400px) {
    .archive-grid {
        grid-template-columns: repeat(4, 1fr) !important; /* 4 on large screens */
    }
}

@media (max-width: 990px) {
    .archive-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Card Adjustments for Archive */
.archive-card {
    height: 100%; /* Fill grid height */
    display: flex;
    flex-direction: column;
}

.archive-card .bestseller-product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.archive-card .bestseller-bottom-row {
    margin-top: auto;
}

/* ============================================
   WIDGET LIST STYLING (Brands, Categories, etc.)
   ============================================ */

/* Generic List Reset for Sidebar */
.archive-sidebar ul {
    padding: 0;
    margin: 0;
    list-style: none !important;
}

.archive-sidebar li {
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #99A1AF;
    display: flex;
    align-items: center;
    gap: 8px;
}

.archive-sidebar a {
    color: #99A1AF;
    text-decoration: none;
    transition: all 0.2s ease;
}

.archive-sidebar a:hover {
    color: #D4A574; /* Gold Hover */
    padding-left: 4px;
}

/* Active/Chosen state */
.archive-sidebar .current-cat > a,
.archive-sidebar .chosen > a,
.archive-sidebar li.active > a {
    color: #FFF;
    font-weight: 600;
}

/* Count styling */
.archive-sidebar .count {
    font-size: 12px;
    color: #4B5563;
    margin-left: auto;
}

/* Block Widget Specifics (if using Gutenberg Blocks) */
.wp-block-woocommerce-filter-wrapper {
    margin-bottom: 2rem;
}

.wc-block-components-checkbox-list-item {
    margin-bottom: 8px;
}

.wc-block-components-checkbox-list-item__label {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #99A1AF;
}

.wc-block-components-checkbox-list-item__checked .wc-block-components-checkbox-list-item__label {
    color: #FFF;
    color: #D4A574;
}

/* Mobile Title Fix */
@media (max-width: 639px) {
    .archive-title-wrapper {
        gap: 0;
    }

    .archive-title {
        white-space: normal;
    }

    .archive-title-line {
        display: none;
    }
    
    /* Ensure 1 column on mobile (Full Width Cards) */
    .archive-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
}

/* ============================================
   PAGINATION STYLING
   ============================================ */
.woocommerce-pagination {
    margin-top: 4rem;
    text-align: center;
}

.woocommerce-pagination ul {
    display: flex;
    justify-content: center;
    gap: 8px;
    border: none !important;
    padding: 0;
}

.woocommerce-pagination ul li {
    border: none !important;
    overflow: visible !important;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px; /* Square styling */
    height: 40px;
    padding: 0 12px;
    background-color: #1A2332; /* Dark background */
    border: 1px solid #2A3C4D !important;
    color: #FFF !important;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0 !important; /* Sharp corners */
}

/* Hover State */
.woocommerce-pagination ul li a:hover,
.woocommerce-pagination ul li a:focus {
    background-color: #D4A574 !important; /* Gold Hover */
    border-color: #D4A574 !important;
    color: #000 !important;
}

/* Active State */
.woocommerce-pagination ul li span.current {
    background-color: #D32F2F !important; /* Ferrari Red Active */
    border-color: #D32F2F !important;
    color: #FFF !important;
}

/* ============================================
   SIDEBAR SHOW MORE LINKS (FORCE VISIBILITY)
   ============================================ */
.archive-sidebar a,
.archive-sidebar span,
.widget a, 
.widget span {
    color: #99A1AF; /* Ensure base text is visible first */
}

.archive-sidebar a.show-more,
.archive-sidebar .wpc-show-more,
.archive-sidebar .yith-wcan-list-show-more,
.archive-sidebar a[class*="show-more"],
.archive-sidebar .widget a[href*="show_more"],
.archive-sidebar a.toggle-show-more,
.widget_layered_nav span.show-more,
.berocket_show_more,
.wpc-filter-content .wpc-show-more,
/* Target the precise class from screenshot */
.wc-block-product-filter-checkbox-list__show-more, 
button.wc-block-product-filter-checkbox-list__show-more {
    color: #D4A574 !important; /* Gold */
    font-size: 14px !important;
    font-family: 'Chakra Petch', sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    text-decoration: underline !important;
    margin-top: 8px !important;
    display: inline-block !important;
    cursor: pointer !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.archive-sidebar a.show-more:hover,
.archive-sidebar .wpc-show-more:hover,
.archive-sidebar .yith-wcan-list-show-more:hover {
    color: #FFF !important;
    text-decoration: none !important;
}

/* ============================================
   PAGINATION REINFORCEMENT
   ============================================ */
/* Target specifically to override any plugin styles */
.woocommerce nav.woocommerce-pagination ul,
.woocommerce nav.woocommerce-pagination ul.page-numbers {
    border: none !important;
    display: flex !important;
    justify-content: center !important;
    gap: 8px !important;
}

.woocommerce nav.woocommerce-pagination ul li,
.woocommerce nav.woocommerce-pagination ul.page-numbers li {
    border: none !important;
    margin: 0 !important;
    float: none !important;
    display: inline-block !important;
    overflow: visible !important;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span,
.woocommerce nav.woocommerce-pagination ul.page-numbers li a,
.woocommerce nav.woocommerce-pagination ul.page-numbers li span {
    background-color: #1A2332 !important; /* Dark Grey/Blue */
    color: #FFFFFF !important; /* Pure White Text */
    border: 1px solid #4A5568 !important; /* Lighter Border for Visibility */
    font-family: 'Chakra Petch', sans-serif !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    padding: 10px 14px !important;
    min-width: 44px !important;
    height: 44px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0 !important;
}

/* Hover Override */
.woocommerce nav.woocommerce-pagination ul li a:hover,
.woocommerce nav.woocommerce-pagination ul.page-numbers li a:hover {
    background-color: #D4A574 !important;
    color: #000 !important;
    border-color: #D4A574 !important;
}

/* Active Override */
.woocommerce nav.woocommerce-pagination ul li span.current,
.woocommerce nav.woocommerce-pagination ul.page-numbers li span.current {
    background-color: #D32F2F !important;
    border-color: #D32F2F !important;
    color: #FFF !important;
}

/* ============================================= */
/* MOBILE FIXES FOR CATEGORY PAGE - FINAL VERSION */
/* ============================================= */

@media (max-width: 1024px) {

    html body .bestseller-grid.archive-grid,
    html body .archive-grid,
    html body .bestseller-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 0 4px !important;           /* Reduced from 12px */
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        margin: 0 !important;
    }

    html body .bestseller-product-card.archive-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        padding: 0 !important;               /* Remove extra card padding */
        margin: 0 !important;
    }

    html body .bestseller-product-title {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        display: block !important;
        word-break: break-word !important;
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
        max-height: none !important;
    }

    html body .archive-toolbar,
    html body .woocommerce-ordering {
        width: 100% !important;
        display: block !important;
    }

    html body .archive-toolbar-right select.orderby,
    html body .woocommerce-ordering select.orderby {
        width: 100% !important;
        max-width: 100% !important;
        padding: 14px 16px !important;
    }

    html body .bestseller-btn {
        width: 100% !important;
        display: block !important;
        text-align: center !important;
    }
}

/* Reduce spacing in the category/archive header on mobile */
@media (max-width: 767px) {
    .archive-header {
        padding: 0.75rem 0 !important;
    }
    .archive-title-wrapper {
        margin-bottom: 0.25rem !important;
    }
    .archive-title {
        font-size: 28px !important;
        line-height: 32px !important;
    }
    .archive-title-line {
        width: 48px !important;
    }
    .archive-subtitle {
        margin-top: 4px !important;
        margin-bottom: 4px !important;
    }
    .archive-header .term-description,
    .archive-header .woocommerce-archive-description {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    .archive-header .term-description p,
    .archive-header .woocommerce-archive-description p {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* Reduce spacing for subcategory buttons section */
    .ferrari-category-buttons {
        padding: 0.5rem 0 !important;
    }
    .ferrari-category-buttons h2 {
        margin-top: 0 !important;
        margin-bottom: 12px !important;
    }

    /* Add comfortable side padding to content on mobile */
    .archive-product-page {
        padding-left: 16px !important;
        padding-right: 16px !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    /* Convert layout flexbox to block to prevent card overflow */
    .archive-layout-container {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }

    .archive-product-grid {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }

    .bestseller-grid.archive-grid {
        padding: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Ensure breadcrumbs have consistent side padding */
    .woocommerce-breadcrumb, 
    .product-breadcrumb {
        padding-left: 16px !important;
        padding-right: 16px !important;
        box-sizing: border-box !important;
    }
}

