/* =================================================================
 * Shop Page & Wishlist Styles — Shaarvi Biotech
 * ================================================================= */

/* --- Shop Hero Banner --- */
.sb-shop-hero {
    background: linear-gradient(135deg, var(--sb-green-pale) 0%, var(--sb-cream) 50%, var(--sb-gold-light) 100%);
    padding: 120px 0 40px;
    text-align: center;
    border-bottom: 1px solid var(--sb-border);
}
.sb-shop-hero h1 {
    font-family: var(--sb-font-heading);
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    color: var(--sb-text);
    margin-bottom: 8px;
}
.sb-shop-hero p {
    color: var(--sb-text-light);
    font-size: 1rem;
    margin: 0;
}
.sb-shop-hero .sb-shop-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 20px;
}
.sb-shop-hero .sb-shop-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--sb-text-light);
}
.sb-shop-hero .sb-shop-stat svg {
    width: 16px;
    height: 16px;
    color: var(--sb-green);
}
.sb-shop-hero .sb-shop-stat strong {
    color: var(--sb-green-dark);
    font-weight: 700;
}

/* --- Category Filter Pills --- */
.sb-category-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 0 24px;
    border-bottom: 1px solid var(--sb-border);
    margin-bottom: 24px;
}
.sb-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 50px;
    border: 1.5px solid var(--sb-border);
    background: var(--sb-white);
    color: var(--sb-text);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--sb-transition);
    white-space: nowrap;
}
.sb-cat-pill:hover {
    border-color: var(--sb-green);
    color: var(--sb-green);
    background: var(--sb-green-pale);
}
.sb-cat-pill.active {
    background: var(--sb-green);
    color: var(--sb-white);
    border-color: var(--sb-green);
}
.sb-cat-pill.active:hover {
    background: var(--sb-green-dark);
    color: var(--sb-white);
}
.sb-cat-count {
    background: rgba(0,0,0,0.08);
    font-size: 0.72rem;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 600;
}
.sb-cat-pill.active .sb-cat-count {
    background: rgba(255,255,255,0.25);
}

/* --- Shop Toolbar (Result count + Sorting + View) --- */
.sb-shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.sb-shop-toolbar .woocommerce-result-count {
    margin: 0;
    font-size: 0.85rem;
    color: var(--sb-text-light);
    order: 1;
}
.sb-shop-toolbar .woocommerce-ordering {
    margin: 0;
    order: 3;
}
.sb-shop-toolbar .woocommerce-ordering select {
    padding: 8px 32px 8px 14px;
    border: 1.5px solid var(--sb-border);
    border-radius: var(--sb-radius-sm);
    font-family: var(--sb-font-body);
    font-size: 0.85rem;
    color: var(--sb-text);
    background: var(--sb-white);
    cursor: pointer;
    transition: var(--sb-transition);
    appearance: auto;
}
.sb-shop-toolbar .woocommerce-ordering select:focus {
    outline: none;
    border-color: var(--sb-green);
}

/* --- View Toggle --- */
.sb-view-toggle {
    display: flex;
    gap: 4px;
    order: 2;
    margin-left: auto;
}
.sb-view-btn {
    background: none;
    border: 1.5px solid var(--sb-border);
    border-radius: var(--sb-radius-sm);
    padding: 8px;
    cursor: pointer;
    color: var(--sb-gray);
    transition: var(--sb-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sb-view-btn:hover {
    color: var(--sb-green);
    border-color: var(--sb-green);
}
.sb-view-btn.active {
    background: var(--sb-green);
    color: var(--sb-white);
    border-color: var(--sb-green);
}

/* --- Product Card Actions (Wishlist + Quick View overlay) --- */
.sb-product-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 5;
    opacity: 0;
    transform: translateX(8px);
    transition: all 0.25s ease;
}
ul.products li.product:hover .sb-product-actions,
.products-grid .product:hover .sb-product-actions {
    opacity: 1;
    transform: translateX(0);
}
.sb-wishlist-btn,
.sb-quickview-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--sb-white);
    color: var(--sb-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: var(--sb-transition);
}
.sb-wishlist-btn:hover {
    background: #FFE8E8;
    color: #E53935;
}
.sb-wishlist-btn.active {
    background: #E53935;
    color: var(--sb-white);
}
.sb-wishlist-btn.active svg {
    fill: currentColor;
}
.sb-quickview-btn:hover {
    background: var(--sb-green);
    color: var(--sb-white);
}

/* --- Product Badges --- */
.sb-product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    z-index: 5;
}
.sb-badge-new {
    background: var(--sb-green);
    color: var(--sb-white);
}
.sb-badge-bestseller {
    background: var(--sb-gold);
    color: var(--sb-white);
}

/* --- Quick View Modal --- */
.sb-quickview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}
.sb-quickview-overlay.active {
    opacity: 1;
    visibility: visible;
}
.sb-quickview-modal {
    background: var(--sb-white);
    border-radius: var(--sb-radius);
    max-width: 820px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 80px rgba(0,0,0,0.2);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s ease;
}
.sb-quickview-overlay.active .sb-quickview-modal {
    transform: scale(1) translateY(0);
}
.sb-quickview-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--sb-gray);
    z-index: 2;
    line-height: 1;
    padding: 4px;
}
.sb-quickview-close:hover {
    color: var(--sb-text);
}
.sb-quickview-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.sb-quickview-image {
    background: var(--sb-gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sb-quickview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--sb-radius) 0 0 var(--sb-radius);
}
.sb-quickview-info {
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.sb-quickview-cats {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--sb-gold);
    font-weight: 600;
    margin-bottom: 8px;
}
.sb-quickview-info h2 {
    font-family: var(--sb-font-heading);
    font-size: 1.5rem;
    margin-bottom: 12px;
}
.sb-quickview-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--sb-green-dark);
    margin-bottom: 16px;
}
.sb-quickview-desc {
    font-size: 0.9rem;
    color: var(--sb-text-light);
    line-height: 1.6;
    margin-bottom: 12px;
}
.sb-quickview-weight {
    font-size: 0.85rem;
    color: var(--sb-text-light);
    margin-bottom: 20px;
}
.sb-quickview-buttons {
    display: flex;
    gap: 10px;
}
.sb-quickview-buttons .btn {
    flex: 1;
    text-align: center;
    padding: 12px 20px;
    font-size: 0.85rem;
}

/* --- Header Wishlist Icon --- */
.header-wishlist {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--sb-text);
}
.header-wishlist svg {
    width: 22px;
    height: 22px;
}
.header-wishlist:hover {
    color: #E53935;
}
.wishlist-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #E53935;
    color: var(--sb-white);
    font-size: 0.6rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* --- Toast Notification --- */
.sb-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--sb-text);
    color: var(--sb-white);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.sb-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- List View Toggle --- */
ul.products.sb-list-view {
    grid-template-columns: 1fr !important;
}
ul.products.sb-list-view li.product {
    display: grid !important;
    grid-template-columns: 200px 1fr;
    gap: 0;
}
ul.products.sb-list-view li.product a img {
    aspect-ratio: 1;
    height: 100%;
    object-fit: cover;
}
ul.products.sb-list-view li.product .sb-product-actions {
    opacity: 1;
    transform: none;
}

/* --- Wishlist Page --- */
.sb-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    padding: 20px 0;
}
.sb-wishlist-item {
    background: var(--sb-white);
    border-radius: var(--sb-radius);
    border: 1px solid var(--sb-border);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}
.sb-wishlist-item:hover {
    box-shadow: var(--sb-shadow-hover);
}
.sb-wishlist-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}
.sb-wishlist-item h4 {
    padding: 12px 16px 4px;
    font-family: var(--sb-font-heading);
    font-size: 0.95rem;
}
.sb-wishlist-item a {
    text-decoration: none;
    color: var(--sb-text);
}
.sb-wishlist-price {
    padding: 0 16px;
    font-weight: 700;
    color: var(--sb-green-dark);
    font-size: 0.95rem;
}
.sb-wishlist-item .btn-sm {
    display: block;
    margin: 12px 16px 16px;
    text-align: center;
    padding: 10px;
    font-size: 0.8rem;
}
.sb-wishlist-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: #999;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: var(--sb-transition);
}
.sb-wishlist-remove:hover {
    background: #E53935;
    color: var(--sb-white);
}
.sb-wishlist-empty {
    text-align: center;
    padding: 60px 20px;
}
.sb-wishlist-empty-icon {
    font-size: 4rem;
    color: var(--sb-border);
    margin-bottom: 16px;
}
.sb-wishlist-empty h3 {
    font-family: var(--sb-font-heading);
    margin-bottom: 8px;
}
.sb-wishlist-empty p {
    color: var(--sb-text-light);
    margin-bottom: 24px;
}
.sb-wishlist-loading {
    text-align: center;
    color: var(--sb-text-light);
    padding: 40px;
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .sb-shop-hero {
        padding: 100px 0 28px;
    }
    .sb-shop-hero .sb-shop-stats {
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
    }
    .sb-category-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 16px;
        scrollbar-width: none;
    }
    .sb-category-filters::-webkit-scrollbar { display: none; }
    .sb-shop-toolbar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sb-view-toggle {
        order: 3;
        margin-left: 0;
    }
    .sb-quickview-body {
        grid-template-columns: 1fr;
    }
    .sb-quickview-image img {
        border-radius: var(--sb-radius) var(--sb-radius) 0 0;
        max-height: 300px;
    }
    .sb-quickview-info {
        padding: 24px 20px;
    }
    .sb-quickview-buttons {
        flex-direction: column;
    }
    ul.products.sb-list-view li.product {
        grid-template-columns: 1fr !important;
    }
    .sb-wishlist-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .sb-product-actions {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 480px) {
    .sb-wishlist-grid {
        grid-template-columns: 1fr;
    }
}
