/**
 * Kemati Shop Styles
 * Design: Sidebar filtres + Grille 4 colonnes
 */

/* ==========================================================================
   SHOP LAYOUT
   ========================================================================== */

.shop-archive {
    background-color: var(--wp--preset--color--white, #FFFFFF);
}

/* Page Header */
.shop-page-header {
    padding: 3rem 0 2rem;
    text-align: center;
}

.shop-page-title {
    font-family: var(--wp--preset--font-family--heading, 'Cormorant Garamond', serif);
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 500;
    color: var(--wp--preset--color--primary, #1A1A1A);
    margin: 0;
}

/* Promo Banner */
.shop-promo-banner {
    background-color: var(--wp--preset--color--surface, #F8F6F3);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.promo-banner-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.9375rem;
    color: var(--wp--preset--color--primary, #1A1A1A);
}

.promo-banner-text strong {
    font-weight: 600;
}

.promo-icon {
    font-size: 1.1rem;
}

/* Shop Layout: Sidebar + Products */
.shop-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2.5rem;
    padding: 1.5rem 0 4rem;
}

/* ==========================================================================
   SIDEBAR FILTERS
   ========================================================================== */

.shop-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.shop-filters-form {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* Filter Group */
.filter-group {
    border-bottom: 1px solid var(--wp--preset--color--border, #E5E5E5);
    padding-bottom: 1.5rem;
}

.filter-group:last-of-type {
    border-bottom: none;
}

.filter-title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wp--preset--color--primary, #1A1A1A);
    margin: 0 0 1rem;
}

/* Price Inputs */
.filter-price-inputs {
    display: flex;
    gap: 0.75rem;
}

.filter-price-inputs label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-price-inputs span {
    font-size: 0.75rem;
    color: var(--wp--preset--color--text-light, #666);
}

.filter-price-inputs input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--wp--preset--color--border, #D4D4D4);
    border-radius: 4px;
    font-size: 0.875rem;
    background: #fff;
}

.filter-price-inputs input:focus {
    outline: none;
    border-color: var(--wp--preset--color--accent, #9A7B5B);
}

/* Filter Options (Checkboxes) */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.filter-options-scrollable {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.filter-options-scrollable::-webkit-scrollbar {
    width: 4px;
}

.filter-options-scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.filter-options-scrollable::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

/* Custom Checkbox */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--wp--preset--color--primary, #1A1A1A);
    line-height: 1.4;
}

.filter-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.filter-checkbox .checkmark {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1px solid var(--wp--preset--color--border, #D4D4D4);
    border-radius: 3px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filter-checkbox input:checked + .checkmark {
    background-color: var(--wp--preset--color--primary, #1A1A1A);
    border-color: var(--wp--preset--color--primary, #1A1A1A);
}

.filter-checkbox input:checked + .checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.filter-checkbox:hover .checkmark {
    border-color: var(--wp--preset--color--accent, #9A7B5B);
}

/* Filter Actions */
.filter-actions {
    padding-top: 0.5rem;
}

.btn-filter-clear {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background-color: var(--wp--preset--color--primary, #1A1A1A);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-filter-clear:hover {
    background-color: var(--wp--preset--color--secondary, #333);
    color: #fff;
}

/* ==========================================================================
   PRODUCTS AREA
   ========================================================================== */

.shop-products-area {
    min-width: 0; /* Prevent grid blowout */
}

/* Toolbar */
.shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--wp--preset--color--border, #E5E5E5);
    margin-bottom: 1.5rem;
}

.shop-toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.shop-result-count {
    font-size: 0.875rem;
    color: var(--wp--preset--color--text-light, #666);
}

.shop-toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Ordering Select */
.shop-ordering .woocommerce-ordering {
    margin: 0;
}

.shop-ordering select {
    appearance: none;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--wp--preset--color--border, #D4D4D4);
    border-radius: 4px;
    font-size: 0.875rem;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    cursor: pointer;
    min-width: 200px;
}

.shop-ordering select:focus {
    outline: none;
    border-color: var(--wp--preset--color--accent, #9A7B5B);
}

/* View Mode Buttons */
.shop-view-mode {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--wp--preset--color--surface, #F8F6F3);
    border-radius: 4px;
}

.view-mode-btn {
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--wp--preset--color--text-light, #666);
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.view-mode-btn:hover,
.view-mode-btn.active {
    background: #fff;
    color: var(--wp--preset--color--primary, #1A1A1A);
}

/* Filters Toggle (Mobile) */
.shop-filters-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--wp--preset--color--border, #D4D4D4);
    border-radius: 4px;
    background: #fff;
    font-size: 0.875rem;
    cursor: pointer;
}

/* ==========================================================================
   PRODUCTS GRID
   ========================================================================== */

ul.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Product Card */
.product-card {
    margin: 0;
    padding: 0;
}

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

.product-card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--wp--preset--color--surface, #F8F6F3);
    border-radius: 8px;
    margin-bottom: 0.875rem;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Sale Badge */
.product-badge-sale {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.625rem;
    background: #E53E3E;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
}

/* Product Info */
.product-card-info {
    text-align: left;
}

.product-card-title {
    font-family: var(--wp--preset--font-family--body, 'Montserrat', sans-serif);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--wp--preset--color--primary, #1A1A1A);
    margin: 0 0 0.375rem;
    line-height: 1.4;
}

.product-card-price {
    font-size: 0.875rem;
    color: var(--wp--preset--color--text-light, #666);
}

.product-card-price del {
    color: #999;
    margin-right: 0.375rem;
}

.product-card-price ins {
    text-decoration: none;
    color: var(--wp--preset--color--primary, #1A1A1A);
    font-weight: 600;
}

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

.shop-pagination {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--wp--preset--color--border, #E5E5E5);
}

.pagination-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-list li {
    margin: 0;
}

.pagination-list a,
.pagination-list span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border: 1px solid var(--wp--preset--color--border, #D4D4D4);
    border-radius: 4px;
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--wp--preset--color--primary, #1A1A1A);
    background: #fff;
    transition: all 0.2s ease;
}

.pagination-list a:hover {
    border-color: var(--wp--preset--color--primary, #1A1A1A);
}

.pagination-current {
    background: var(--wp--preset--color--primary, #1A1A1A) !important;
    border-color: var(--wp--preset--color--primary, #1A1A1A) !important;
    color: #fff !important;
}

.pagination-dots {
    border: none !important;
    background: none !important;
}

/* ==========================================================================
   NO PRODUCTS
   ========================================================================== */

.shop-no-products {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--wp--preset--color--surface, #F8F6F3);
    border-radius: 8px;
}

.shop-no-products h2 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}

.shop-no-products p {
    color: var(--wp--preset--color--text-light, #666);
    margin-bottom: 1.5rem;
}

.shop-no-products .btn-primary {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: var(--wp--preset--color--primary, #1A1A1A);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
}

/* ==========================================================================
   PROMO STICKY BAR
   ========================================================================== */

.promo-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--wp--preset--color--primary, #1A1A1A);
    color: #fff;
    padding: 0.875rem 0;
    z-index: 100;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.promo-sticky-bar.hidden {
    transform: translateY(100%);
}

.promo-sticky-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.promo-sticky-text {
    font-size: 0.9375rem;
}

.promo-sticky-text strong {
    color: var(--wp--preset--color--gold, #C9A962);
}

.promo-sticky-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: #fff;
    color: var(--wp--preset--color--primary, #1A1A1A);
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.promo-sticky-copy:hover {
    background: var(--wp--preset--color--surface, #F8F6F3);
}

.promo-sticky-copy strong {
    font-weight: 600;
}

/* Adjust main content for sticky bar */
.shop-archive {
    padding-bottom: 70px;
}

/* ==========================================================================
   LIST VIEW
   ========================================================================== */

ul.products.view-list {
    grid-template-columns: 1fr;
    gap: 1rem;
}

ul.products.view-list .product-card-link {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1.5rem;
    align-items: center;
}

ul.products.view-list .product-card-image {
    margin-bottom: 0;
    aspect-ratio: 1;
}

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

@media (max-width: 1200px) {
    ul.products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }
    
    .shop-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        z-index: 1000;
        padding: 2rem;
        overflow-y: auto;
    }
    
    .shop-sidebar.active {
        display: block;
    }
    
    .shop-filters-toggle {
        display: flex;
    }
    
    ul.products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .shop-page-header {
        padding: 2rem 0 1.5rem;
    }
    
    .shop-toolbar {
        flex-wrap: wrap;
    }
    
    .shop-toolbar-left {
        width: 100%;
    }
    
    .shop-ordering select {
        min-width: 150px;
    }
    
    ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .promo-sticky-content {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .product-card-title {
        font-size: 0.8125rem;
    }
    
    .product-card-price {
        font-size: 0.8125rem;
    }
}
