/* ==============================================
   COSIONT HEART SRL — Shop / Archive Product
   Sidebar filters, grid/list view, toolbar
   ============================================== */

/* ==============================================
   0. ASTRA OVERRIDES — R8, R13: Force fullwidth,
      hide Astra default WooCommerce sidebar
   ============================================== */

/* Hide Astra's injected WooCommerce sidebar (R8) */
#secondary,
.ast-shop-sidebar-disable,
.widget-area.secondary,
.ast-above-header-section-separated,
.ast-woocommerce-container .sidebar,
.woocommerce-sidebar {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

/* Force #primary to full width — kill Astra 2-col layout */
#primary,
.ast-primary-content,
.content-area {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Astra container resets for shop page */
.ast-separate-container .ast-article-single,
.ast-separate-container .ast-article-post,
.ast-separate-container .ast-woocommerce-container,
.ast-plain-container .ast-woocommerce-container {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Kill Astra's default shop layout wrapper */
.ast-woocommerce-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Kill Astra col2-set floats on shop (R8) */
.woocommerce .col2-set,
.woocommerce .col2-set .col-1,
.woocommerce .col2-set .col-2 {
    float: none !important;
    width: 100% !important;
}

/* Remove Astra archive description (custom hero is used) */
.ast-archive-description {
    display: none !important;
}

/* Force site-content to not constrain layout */
.site-content .ast-container {
    display: block !important;
    max-width: 100% !important;
    padding: 0 !important;
}

/* Ensure Astra doesn't add its own sidebar toggle or woo-layout styles */
.ast-shop-archive-page .site-content .ast-container {
    display: block !important;
}

/* Astra defaults WC product lists to its own grid — override */
.ast-woocommerce-shop-page ul.products,
.woocommerce ul.products {
    display: none !important;
}

/* --- Filter Buttons --- */
.cst-filter-btn {
    color: var(--cst-text-dim);
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
}
.cst-filter-btn:hover {
    background: rgba(197, 160, 89, 0.06);
    color: var(--cst-dark);
}
.cst-filter-btn.active {
    background: var(--cst-gold);
    color: #fff;
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.25);
}
.cst-filter-btn.active span:last-child {
    background: rgba(255,255,255,0.25) !important;
    color: #fff !important;
}

/* --- View Toggle Buttons --- */
.cst-view-btn {
    color: var(--cst-text-dim);
    background: transparent;
    border: none;
    cursor: pointer;
}
.cst-view-btn:hover { color: var(--cst-gold); }
.cst-view-btn.active {
    background: var(--cst-gold);
    color: #fff;
    box-shadow: 0 2px 6px rgba(197, 160, 89, 0.2);
}

/* --- List View Mode --- */
#cst-product-grid.cst-list-view {
    grid-template-columns: 1fr !important;
}
#cst-product-grid.cst-list-view .cst-product-card > div {
    flex-direction: row;
    max-height: 200px;
}
#cst-product-grid.cst-list-view .cst-product-card .aspect-\[4\/5\] {
    aspect-ratio: 1/1;
    width: 200px;
    flex-shrink: 0;
}
#cst-product-grid.cst-list-view .cst-product-card .line-clamp-2 {
    -webkit-line-clamp: 1;
}

/* --- Product Card Hover --- */
.cst-product-card {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* --- Toolbar Search Focus --- */
#cst-shop-search:focus {
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.1);
}

/* --- Pagination --- */
.pagination-custom ul {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}
.pagination-custom li a,
.pagination-custom li span.current {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    transition: all 0.3s;
}
.pagination-custom li a {
    color: var(--cst-text-dim);
    border: 1px solid transparent;
}
.pagination-custom li a:hover {
    color: var(--cst-gold);
    border-color: var(--cst-border);
    background: #fff;
}
.pagination-custom li span.current {
    background: var(--cst-gold);
    color: white;
    border-color: var(--cst-gold);
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.3);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    #cst-product-grid.cst-list-view .cst-product-card > div {
        flex-direction: column;
        max-height: none;
    }
    #cst-product-grid.cst-list-view .cst-product-card .aspect-\[4\/5\] {
        width: 100%;
    }
}
