/* 
===================================================
   WooCommerce Archive & Shop Page Styles (Glassmorphism)
===================================================
*/

/* --- 1. Layout Container --- */
.store-archive-wrapper {
    padding: 3rem 15px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Header */
.store-archive-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    position: relative;
    animation: fadeIn 0.8s ease-out;
    z-index: 1;
    
}

.store-archive-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.store-archive-header .page-title {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* --- 2. Main Layout (Grid) --- */
.store-archive-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    align-items: start;
}

/* --- 3. Sidebar (Glassmorphism) --- */
.store-archive-layout .sidebar {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    position: sticky;
    top: 100px; /* Offset for sticky header */
}

.store-archive-layout .sidebar h2 {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(45, 134, 89, 0.1); /* Primary color low opacity */
}

/* Widgets inside sidebar */
.widget-area .widget {
    margin-bottom: 2rem;
}

.widget-area .widget:last-child {
    margin-bottom: 0;
}

.widget-area .widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.widget-area ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-area ul li {
    margin-bottom: 0.75rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.widget-area ul li a {
    color: var(--text-dark);
    font-size: 0.95rem;
    transition: var(--transition);
}

.widget-area ul li a:hover {
    color: var(--primary-color);
    padding-right: 5px; /* RTL visual cue */
}

/* Range Slider (if WooCommerce Price Filter is used) */
.price_slider_wrapper .ui-slider {
    background: #e0e0e0;
    border: none;
    height: 6px;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.price_slider_wrapper .ui-slider-range {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.price_slider_wrapper .ui-slider-handle {
    background: white;
    border: 2px solid var(--primary-color);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    top: -5px;
    cursor: grab;
    box-shadow: var(--shadow-sm);
}

.price_slider_wrapper .price_slider_amount .button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
}


/* --- 4. Main Products Area --- */
.store-products-main {
    min-width: 0; /* Prevents grid blowout */
}

/* Top Sorting & Results bar */
.woocommerce-notices-wrapper {
    width: 100%;
}

.woocommerce-before-shop-loop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255, 0.3);
    padding: 1rem 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 1rem;
}

.woocommerce-result-count {
    margin: 0;
    color: var(--text-light);
    font-weight: 500;
}

.woocommerce-ordering select {
    appearance: none;
    background: white url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%232d8659" class="bi bi-chevron-down" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/></svg>') no-repeat;
    background-position: left 1rem center; /* RTL friendly */
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-dark);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: var(--transition);
    outline: none;
}

.woocommerce-ordering select:hover,
.woocommerce-ordering select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 134, 89, 0.1);
}

/* Products Grid */
ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 2rem !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

ul.products::before, ul.products::after {
    display: none !important;
}

ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

ul.products li.product:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(45, 134, 89, 0.2);
}

/* Product Card Elements */
ul.products li.product a.woocommerce-LoopProduct-link {
    text-decoration: none;
    display: block;
    text-align: center;
    flex-grow: 1;
}

ul.products li.product img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    transition: transform 0.5s ease;
}

ul.products li.product:hover img {
    transform: scale(1.05);
}

ul.products li.product .woocommerce-loop-product__title {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    transition: var(--transition);
}

ul.products li.product:hover .woocommerce-loop-product__title {
    color: var(--primary-color);
}

/* Price */
ul.products li.product .price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    display: block;
}

ul.products li.product .price del {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 400;
    margin-left: 0.5rem;
}

ul.products li.product .price ins {
    text-decoration: none;
    color: var(--accent-color);
}

/* Add to Cart Button */
ul.products li.product .button {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-light), #e2e8f0);
    color: var(--text-dark);
    padding: 0.8rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: auto;
    border: 1px solid transparent;
}

ul.products li.product:hover .button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 4px 15px rgba(45, 134, 89, 0.3);
}

ul.products li.product .button.loading {
    opacity: 0.7;
}

ul.products li.product .button.added {
    background: var(--secondary-color);
    color: white;
}

/* Sale Badge */
span.onsale {
    position: absolute;
    top: 15px;
    right: 15px; /* RTL Standard */
    background: var(--accent-color);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    z-index: 9;
    box-shadow: 0 4px 10px rgba(247, 147, 30, 0.3);
    min-width: auto;
    min-height: auto;
    line-height: 1;
}

/* --- 5. Pagination --- */
.woocommerce-pagination ul {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    margin-top: 3rem;
    padding: 0;
    border: none !important;
}

.woocommerce-pagination ul li {
    border: none !important;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: var(--text-dark);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.05);
}

.woocommerce-pagination ul li a:hover,
.woocommerce-pagination ul li span.current {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(45, 134, 89, 0.3);
    border-color: transparent;
}


/* --- 6. Responsive Design (Mobile Friendly) --- */
@media (max-width: 992px) {
    .store-archive-layout {
        grid-template-columns: 1fr; /* Stack columns */
        gap: 1.5rem;
    }

    /* Move sidebar to the top or style it differently for mobile */
    .store-archive-layout .sidebar {
        position: static;
        width: 100%;
        margin-bottom: 1rem;
        padding: 1.5rem;
        /* Make widgets flex row if there are few, or let them stack */
    }

    .woocommerce-before-shop-loop {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .woocommerce-ordering {
        width: 100%;
    }
    
    .woocommerce-ordering select {
        width: 100%;
    }
}

@media (max-width: 576px) {
    ul.products {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 1rem !important;
    }

    ul.products li.product {
        padding: 1rem;
    }

    ul.products li.product .woocommerce-loop-product__title {
        font-size: 0.95rem;
    }

    ul.products li.product .price {
        font-size: 1rem;
    }

    ul.products li.product .button {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    .store-archive-wrapper {
        padding: 2rem 10px;
    }
}
