/**
 * Bestsellers Section - Premium Skincare Style
 * 
 * @package ChildTheme_Clean
 */

/* ============================================
   SECTION CONTAINER
   ============================================ */

.bestsellers-section {
    background-color: #fafafa;
    padding: 80px 24px;
}

@media (min-width: 768px) {
    .bestsellers-section {
        padding: 100px 40px;
    }
}

@media (min-width: 1024px) {
    .bestsellers-section {
        padding: 120px 60px;
    }
}

/* ============================================
   SECTION HEADER
   ============================================ */

.bestsellers-section-header {
    text-align: center;
    margin-bottom: 80px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.bestsellers-section-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 2.5rem;
    line-height: 1.2;
    font-weight: 400;
    color: #1a1a1a;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

@media (min-width: 768px) {
    .bestsellers-section-title {
        font-size: 3.5rem;
        margin-bottom: 32px;
    }
}

@media (min-width: 1024px) {
    .bestsellers-section-title {
        font-size: 4rem;
        margin-bottom: 40px;
    }
}

.bestsellers-section-description {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #666;
    font-weight: 300;
    margin-bottom: 32px;
    padding: 0 20px;
}

@media (min-width: 768px) {
    .bestsellers-section-description {
        font-size: 1rem;
        margin-bottom: 40px;
        padding: 0;
    }
}

.bestsellers-section-cta {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary-color, #245c2a);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-color, #245c2a);
    padding-bottom: 4px;
    display: inline-block;
}

.bestsellers-section-cta:hover {
    opacity: 0.7;
}

/* ============================================
   PRODUCT GRID
   ============================================ */

.bestsellers-products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Mobile: Horizontal scroll */
@media (max-width: 767px) {
    .bestsellers-products-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 24px;
        padding-bottom: 20px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .bestsellers-products-grid::-webkit-scrollbar {
        display: none;
    }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .bestsellers-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 48px 32px;
    }
}

/* Desktop: 4 columns */
@media (min-width: 1024px) {
    .bestsellers-products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 48px 32px;
    }
}

/* ============================================
   PRODUCT CARD
   ============================================ */

.bestseller-product-card {
    width: 100%;
    scroll-snap-align: start;
}

@media (max-width: 767px) {
    .bestseller-product-card {
        min-width: 280px;
        flex-shrink: 0;
    }
}

.bestseller-product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #f5f5f0;
    border-radius: 4px;
    margin-bottom: 24px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bestseller-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0;
    display: block;
}

/* ============================================
   PRODUCT BADGES
   ============================================ */

.bestseller-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 20px;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
}

/* When discount badge exists, move bestseller badge down */
.bestseller-product-image-wrapper:has(.bestseller-discount-badge) .bestseller-badge {
    top: auto;
    bottom: 16px;
    left: 16px;
}

/* Fallback for browsers without :has() support - use inline style from PHP */
.bestseller-badge[style*="bottom"] {
    top: auto !important;
}

.bestseller-discount-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 20px;
    z-index: 11;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.3);
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bestseller-wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bestseller-wishlist-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary-color, #245c2a);
    fill: none;
    stroke-width: 1.5;
}

.bestseller-wishlist-btn.active svg,
.bestseller-wishlist-btn[data-in-wishlist="1"] svg {
    fill: var(--primary-color, #245c2a);
    stroke: var(--primary-color, #245c2a);
}

/* ============================================
   PRODUCT INFO
   ============================================ */

.bestseller-product-info {
    padding: 0 4px;
}

/* Rating & Reviews */
.bestseller-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.bestseller-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--primary-color, #245c2a);
}

.bestseller-stars svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.bestseller-review-count {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.6875rem;
    color: #666;
    font-weight: 400;
}

/* Product Title */
.bestseller-product-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.bestseller-product-title a {
    color: inherit;
    text-decoration: none;
}

/* Product Subtitle */
.bestseller-product-subtitle {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #666;
    font-weight: 300;
    font-style: italic;
    margin-bottom: 16px;
}

/* Product Tags */
.bestseller-product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.bestseller-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #f0f5f2;
    color: var(--primary-color, #245c2a);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(36, 92, 42, 0.15);
}

.bestseller-tag svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 2.5;
}

/* Price */
.bestseller-product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 16px;
}

.bestseller-price-current {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #1a1a1a;
}

.bestseller-price-original {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    color: #999;
    text-decoration: line-through;
}

.bestseller-price-volume {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.75rem;
    color: #666;
    font-weight: 400;
}

/* Add to Cart Button */
.bestseller-add-to-cart-btn {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 12px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    color: #1a1a1a;
    background-color: #f5f5f0;
    border: 1px solid #e5e5e0;
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.bestseller-add-to-cart-btn:hover:not(:disabled),
.bestseller-add-to-cart-btn:focus:not(:disabled) {
    color: #1a1a1a;
    background-color: #f0f0eb;
    text-decoration: none;
    outline: none;
}

.bestseller-add-to-cart-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.bestseller-out-of-stock {
    background-color: #f5f5f5 !important;
    color: #999 !important;
    border-color: #e5e5e5 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* View Cart Button - appears after adding to cart */
.bestseller-product-card .added_to_cart,
.bestseller-product-card .wc-forward,
.bestseller-product-card a.added_to_cart,
.bestseller-product-card a.wc-forward,
.bestseller-product-card .woocommerce-message a.button,
.bestseller-product-card .woocommerce-info a.button,
.bestseller-product-card .bestseller-view-cart-btn,
.bestseller-product-card a[href*="cart"],
.bestseller-product-card a[href*="checkout"] {
    display: block !important;
    width: 100% !important;
    margin-top: 12px !important;
    padding: 12px 20px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    text-align: center !important;
    text-decoration: none !important;
    color: #ffffff !important;
    background-color: #245c2a !important;
    border: 1px solid #245c2a !important;
    border-radius: 2px !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, border-color 0.2s ease !important;
    box-sizing: border-box !important;
    line-height: 1.5 !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.bestseller-product-card .added_to_cart:hover,
.bestseller-product-card .wc-forward:hover,
.bestseller-product-card a.added_to_cart:hover,
.bestseller-product-card a.wc-forward:hover,
.bestseller-product-card .woocommerce-message a.button:hover,
.bestseller-product-card .woocommerce-info a.button:hover,
.bestseller-product-card .bestseller-view-cart-btn:hover,
.bestseller-product-card a[href*="cart"]:hover,
.bestseller-product-card a[href*="checkout"]:hover {
    background-color: #1d4a21 !important;
    border-color: #1d4a21 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.bestseller-product-card .added_to_cart:focus,
.bestseller-product-card .wc-forward:focus,
.bestseller-product-card a.added_to_cart:focus,
.bestseller-product-card a.wc-forward:focus,
.bestseller-product-card .woocommerce-message a.button:focus,
.bestseller-product-card .woocommerce-info a.button:focus,
.bestseller-product-card .bestseller-view-cart-btn:focus,
.bestseller-product-card a[href*="cart"]:focus,
.bestseller-product-card a[href*="checkout"]:focus {
    outline: 2px solid #245c2a !important;
    outline-offset: 2px !important;
}

/* ============================================
   COMMUNITY SECTION
   ============================================ */

.bestsellers-community-section {
    text-align: center;
    padding-top: 80px;
    margin-top: 80px;
    border-top: 1px solid #e5e5e5;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.bestsellers-community-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 2.5rem;
    line-height: 1.2;
    font-weight: 400;
    color: #1a1a1a;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

@media (min-width: 768px) {
    .bestsellers-community-title {
        font-size: 3.5rem;
        margin-bottom: 32px;
    }
}

@media (min-width: 1024px) {
    .bestsellers-community-title {
        font-size: 4rem;
        margin-bottom: 40px;
    }
}

.bestsellers-community-description {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #666;
    font-weight: 300;
    padding: 0 20px;
}

@media (min-width: 768px) {
    .bestsellers-community-description {
        font-size: 1rem;
        padding: 0;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

.bestsellers-empty-state {
    text-align: center;
    padding: 80px 24px;
    color: #999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}