/**
 * KoreaFaces Amazon-Style Homepage CSS
 * Discovery Cards + Horizontal Scrolling Product Strips
 */

/* ========================================
   GLOBAL AMAZON-STYLE SETTINGS
   ======================================== */

/* =============================================
   ELITE COSMETIC COLOR SYSTEM - KoreaFaces
   Primary:   #C8446B  (Deep Rose)
   Secondary: #D4AF37  (Champagne Gold)
   Dark:      #1A1A2E  (Luxury Navy)
   Light:     #FDF6F0  (Ivory Cream)
   Accent:    #F9EDE5  (Warm Blush)
   ============================================= */

/* FIX: Elite ivory/cream background - refined cosmetic feel */
html, body {
    background-color: #FDF6F0 !important;
}

.homepage-amazon {
    background: #F5EDE6;
    max-width: 100%;
    padding: 0;
}

.homepage-amazon .site-main {
    padding: 0;
}

/* ========================================
   DISCOVERY CARDS SECTION (Amazon Top Fold)
   ======================================== */

.discovery-cards-section {
    background: #F5EDE6; /* Elite: warm ivory background */
    padding: 20px 0;
    margin-top: 0; /* FIX: Removed negative margin that caused hero overlap */
}

.discovery-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1240px; /* FIX: Aligned with .ast-container max-width */
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   DISCOVERY CARD BASE STYLES
   ======================================== */

.discovery-card {
    background: #FFFFFF;
    border-radius: 12px; /* Elite: softer corners */
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 420px;
    box-shadow: 0 2px 12px rgba(200, 68, 107, 0.08); /* Rose-tinted shadow */
    border: 1px solid rgba(212, 175, 55, 0.15); /* Subtle gold border */
    transition: transform 0.25s, box-shadow 0.25s;
}

.discovery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(200, 68, 107, 0.18); /* Deep rose glow on hover */
    border-color: rgba(212, 175, 55, 0.4); /* Gold border on hover */
}

.card-header {
    margin-bottom: 15px;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1A1A2E; /* Elite Navy */
    margin: 0;
    line-height: 1.3;
    letter-spacing: 0.5px;
    font-family: Georgia, 'Times New Roman', serif; /* Luxury serif font */
}

.card-footer {
    margin-top: auto;
    padding-top: 10px;
}

.card-link {
    color: #C8446B; /* Elite Deep Rose */
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: color 0.2s, letter-spacing 0.2s;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.card-link:hover {
    color: #D4AF37; /* Gold on hover */
    letter-spacing: 1px;
}

/* ========================================
   TYPE A: SINGLE IMAGE CARD
   ======================================== */

.card-single .card-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 15px;
}

.card-single .card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

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

/* ========================================
   TYPE B: QUAD CARD (2x2 Grid)
   ======================================== */

.card-quad-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    flex: 1;
    margin-bottom: 15px;
}

.quad-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.quad-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
    transition: transform 0.2s;
}

.quad-item:hover img {
    transform: scale(1.05);
}

.quad-label {
    font-size: 12px;
    color: #0F1111;
    line-height: 1.3;
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   HORIZONTAL SCROLLING PRODUCT STRIP
   ======================================== */

.product-strip {
    background: #FFFFFF;
    padding: 28px 0;
    margin: 16px 0;
    border-top: 3px solid #D4AF37; /* Gold top accent line */
    border-bottom: 1px solid rgba(212,175,55,0.2);
}

.strip-container {
    max-width: 1240px; /* FIX: Aligned with .ast-container max-width */
    margin: 0 auto;
    padding: 0 20px;
}

.strip-header {
    margin-bottom: 15px;
}

.strip-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1A1A2E; /* Elite Navy */
    margin: 0;
    line-height: 1.3;
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: 0.5px;
    padding-left: 12px;
    border-left: 4px solid #C8446B; /* Rose accent bar */
}

/* ========================================
   HORIZONTAL SCROLL WRAPPER
   ======================================== */

.strip-scroll-wrapper {
    position: relative;
    padding: 0 50px; /* Space for scroll buttons */
}

.strip-products {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
    padding: 10px 0 20px 0;
}

/* Custom Scrollbar Styling */
.strip-products::-webkit-scrollbar {
    height: 8px;
}

.strip-products::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.strip-products::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.strip-products::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================
   SCROLL BUTTONS
   ======================================== */

.strip-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 100px;
    background: linear-gradient(to right, rgba(255,255,255,0.95), rgba(255,255,255,0.8));
    border: 1px solid #D5D9D9;
    border-radius: 4px;
    font-size: 28px;
    color: #0F1111;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.strip-scroll-btn:hover {
    background: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.strip-scroll-prev {
    left: 0;
}

.strip-scroll-next {
    right: 0;
}

/* Hide buttons when not needed */
.strip-scroll-btn.hidden {
    display: none;
}

/* ========================================
   PRODUCT CARD IN STRIP
   ======================================== */

.strip-product-card {
    flex: 0 0 200px;
    width: 200px;
    background: #FFFFFF;
    border: 1px solid rgba(212,175,55,0.2); /* Subtle gold border */
    border-radius: 12px; /* Elite soft corners */
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    box-shadow: 0 2px 8px rgba(200,68,107,0.06);
}

.strip-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(200,68,107,0.16); /* Rose glow */
    border-color: #C8446B; /* Deep Rose border */
}

.strip-product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.strip-product-image {
    width: 100%;
    height: 200px;
    display: block;
    background: #F7F8F8;
    overflow: hidden;
}

.strip-product-image > a,
.product-image-carousel-slide > a {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.strip-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

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

.strip-product-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.strip-product-title {
    font-size: 14px;
    line-height: 1.4;
    color: #0F1111;
    margin: 0 0 8px 0;
    font-weight: 400;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.strip-product-card:hover .strip-product-title {
    color: #C7511F;
}

.strip-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #C8446B; /* Elite Deep Rose for price */
    margin-bottom: 5px;
    font-family: Georgia, serif;
}

.strip-product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.rating-count {
    color: #007185;
}

/* ========================================
   MOBILE RESPONSIVENESS
   ======================================== */

/* Tablet (3 cards) */
@media (max-width: 1200px) {
    .discovery-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* Tablet (2 cards) */
@media (max-width: 900px) {
    .discovery-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .discovery-card {
        height: 380px;
    }
    
    .strip-scroll-wrapper {
        padding: 0 40px;
    }
    
    .strip-scroll-btn {
        width: 35px;
        height: 80px;
        font-size: 24px;
    }
}

/* Mobile (1 card stacked vertically) */
@media (max-width: 640px) {
    .discovery-cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 15px;
    }
    
    .discovery-card {
        height: 400px;
    }
    
    .discovery-cards-section {
        padding: 15px 0;
    }
    
    /* Hide scroll buttons on mobile, use touch swipe */
    .strip-scroll-btn {
        display: none;
    }
    
    .strip-scroll-wrapper {
        padding: 0;
    }
    
    .strip-container {
        padding: 0 15px;
    }
    
    .strip-header h2 {
        font-size: 20px;
    }
    
    .strip-product-card {
        flex: 0 0 150px;
        width: 150px;
    }
    
    .strip-product-image {
        height: 150px;
    }
    
    .strip-product-title {
        font-size: 13px;
        height: 36px;
    }
    
    .strip-product-price {
        font-size: 16px;
    }
    
    .card-header h3 {
        font-size: 18px;
    }
    
    .quad-item img {
        height: 120px;
    }
}

/* Very small mobile */
@media (max-width: 480px) {
    .discovery-card {
        height: 360px;
        padding: 15px;
    }
    
    .card-quad-grid {
        gap: 10px;
    }
    
    .quad-item img {
        height: 100px;
    }
    
    .strip-product-card {
        flex: 0 0 140px;
        width: 140px;
    }
}

/* ========================================
   HERO BANNER (Keep existing styles)
   ======================================== */

.hero-banner {
    position: relative;
    height: 400px;
    margin-bottom: 0;
    overflow: hidden;
}

.hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.8s;
    z-index: 0;
}

.hero-slide.active {
    opacity: 1;
    z-index: 1;
}

.hero-content {
    text-align: center;
    color: white;
    max-width: 700px;
    padding: 40px;
}

.hero-content h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 25px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.btn-hero {
    display: inline-block;
    padding: 14px 44px;
    background: rgba(255,255,255,0.15);
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 30px; /* Pill shape - luxury cosmetic style */
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 2px solid rgba(255,255,255,0.7);
    backdrop-filter: blur(4px);
}

.btn-hero:hover {
    background: #D4AF37; /* Champagne gold on hover */
    border-color: #D4AF37;
    color: #1A1A2E;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(212,175,55,0.4);
}

.hero-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.hero-prev, .hero-next {
    background: rgba(255,255,255,0.3);
    border: 2px solid white;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-prev:hover, .hero-next:hover {
    background: white;
    color: #0274be;
}

.hero-dots {
    display: flex;
    gap: 8px;
}

.hero-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.hero-dots .dot.active {
    background: white;
    width: 25px;
    border-radius: 5px;
}

/* Mobile hero adjustments */
@media (max-width: 768px) {
    .hero-banner {
        height: 300px;
    }
    
    .hero-content h1 {
        font-size: 28px;
    }
    
    .hero-content p {
        font-size: 16px;
    }
}

/* ========================================
   SMOOTH SCROLL ANIMATION
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.discovery-card,
.product-strip {
    animation: fadeInUp 0.6s ease-out;
}

/* ========================================
   LOADING STATES
   ======================================== */

.strip-products.loading {
    opacity: 0.6;
    pointer-events: none;
}

.discovery-card.loading {
    opacity: 0.6;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.strip-scroll-btn:focus,
.card-link:focus,
.strip-product-link:focus {
    outline: 2px solid #007185;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/**
 * KoreaFaces Critical Fixes
 * Mobile sidebar, header cart, hero text, product cards
 */

/* ========================================
   FIX 1: MOBILE SIDEBAR ISSUE
   ======================================== */

/* Hide sidebar on mobile */
@media (max-width: 768px) {
    .sidebar,
    .widget-area,
    #secondary,
    .woocommerce-sidebar,
    .shop-sidebar {
        display: none !important;
    }
    
    /* Make product grid full width on mobile */
    .woocommerce-page #primary,
    .woocommerce #primary {
        width: 100% !important;
        margin: 0 !important;
    }
    
    .woocommerce .products,
    .woocommerce-page .products {
        width: 100% !important;
    }
}

/* Sticky Filter Button (Mobile) */
.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #FF9900;
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 999;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .mobile-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-filter-toggle:active {
        transform: scale(0.95);
    }
}

/* Mobile Filter Drawer */
.mobile-filter-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 350px;
    height: 100vh;
    background: white;
    z-index: 9999;
    transition: left 0.3s;
    overflow-y: auto;
    box-shadow: 4px 0 12px rgba(0,0,0,0.3);
}

.mobile-filter-drawer.active {
    left: 0;
}

.mobile-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    display: none;
}

.mobile-filter-overlay.active {
    display: block;
}

.filter-drawer-header {
    padding: 20px;
    background: #232F3E;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-drawer-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.filter-drawer-content {
    padding: 20px;
}

/* ========================================
   FIX 2: HEADER CART TEXT BREAKING
   ======================================== */

/* Fix cart total breaking vertically */
.site-header .cart-contents,
.site-header .woocommerce-Price-amount,
.site-header-cart .woocommerce-Price-amount,
.ast-site-header-cart .cart-container,
.header-main-layout-1 .ast-site-header-cart,
.ast-cart-menu-wrap,
.ast-cart-menu-wrap .count,
.widget_shopping_cart .total,
.mini-cart .woocommerce-Price-amount {
    white-space: nowrap !important;
    display: inline-block !important;
    min-width: fit-content !important;
}

/* Ensure cart container has space */
.site-header .ast-site-header-cart,
.site-header-cart,
.ast-cart-menu-wrap {
    min-width: 100px !important;
    white-space: nowrap !important;
}

/* Fix any flex wrapping */
.site-header .ast-site-header-cart a,
.ast-cart-menu-wrap a {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
}

/* Force single line for price */
.site-header .woocommerce-Price-amount,
.header-woo-cart .woocommerce-Price-amount {
    display: inline !important;
    white-space: nowrap !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

/* Currency symbol */
.site-header .woocommerce-Price-currencySymbol {
    display: inline !important;
    margin-left: 2px !important;
}

/* ========================================
   FIX 3: HERO BANNER TEXT OVERLAP
   ======================================== */

.hero-content {
    text-align: center;
    color: white;
    max-width: 700px;
    padding: 40px;
    z-index: 2 !important;
    position: relative !important;
}

.hero-content h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 20px !important;
    line-height: 1.2 !important;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    display: block !important;
    clear: both !important;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 25px !important;
    margin-top: 15px !important;
    line-height: 1.5 !important;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.4);
    display: block !important;
    clear: both !important;
}

.btn-hero {
    margin-top: 15px !important;
    display: inline-block !important;
    clear: both !important;
}

/* FIX: Removed padding from absolutely-positioned hero slides (was breaking layout) */
/* .hero-slide uses position:absolute + width/height 100%, padding breaks it */

/* Mobile hero text fixes */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 26px !important;
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
    }
    
    .hero-content p {
        font-size: 16px !important;
        line-height: 1.4 !important;
        margin-bottom: 20px !important;
        margin-top: 10px !important;
    }
}

/* ========================================
   FIX 4: ADD TO CART BUTTONS (Amazon-style)
   ======================================== */

/* Add to Cart on Discovery Cards */
.discovery-card .card-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Add to Cart in Product Strips */
.strip-product-card {
    position: relative;
}

.strip-product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Elite Cosmetic Add to Cart button - Deep Rose */
.product-add-to-cart-btn,
.strip-product-card .button,
.strip-product-card .add_to_cart_button,
.woocommerce .products .product .button {
    display: block !important;
    width: 100% !important;
    padding: 9px 12px !important;
    background: linear-gradient(135deg, #C8446B 0%, #A3304F 100%) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 20px !important; /* Pill shape - luxury cosmetic style */
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    box-shadow: 0 3px 10px rgba(200,68,107,0.3) !important;
    margin-top: auto !important;
}

.product-add-to-cart-btn:hover,
.strip-product-card .button:hover,
.woocommerce .products .product .button:hover {
    background: linear-gradient(135deg, #D4AF37 0%, #B8941E 100%) !important; /* Gold on hover */
    box-shadow: 0 5px 15px rgba(212,175,55,0.4) !important;
    transform: translateY(-1px) !important;
    color: #1A1A2E !important;
}

/* Gold style for featured products */
.hot-sale-products .button,
.strip-product-card:nth-child(3n) .button {
    background: linear-gradient(135deg, #D4AF37 0%, #B8941E 100%) !important;
    color: #1A1A2E !important;
    border: none !important;
}

.hot-sale-products .button:hover,
.strip-product-card:nth-child(3n) .button:hover {
    background: linear-gradient(135deg, #C8446B 0%, #A3304F 100%) !important;
    color: white !important;
}

/* Loading state */
.button.loading {
    opacity: 0.6 !important;
    cursor: wait !important;
}

.button.added {
    background: #46B450 !important;
    border-color: #3E9E45 !important;
    color: white !important;
}

.button.added::after {
    content: ' ✓' !important;
}

/* ========================================
   FIX 5: PRODUCT CARD IMAGE CAROUSEL
   ======================================== */

/* Product card image container */
.strip-product-image,
.woocommerce .products .product .woocommerce-loop-product__link {
    position: relative !important;
    overflow: hidden !important;
}

/* Image carousel wrapper */
.product-image-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.product-image-carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    height: 100%;
}

.product-image-carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}

.product-image-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Carousel Navigation Dots */
.product-carousel-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
    background: rgba(0,0,0,0.6);
    padding: 4px 8px;
    border-radius: 12px;
}

.product-carousel-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.product-carousel-dots .dot.active {
    background: white;
    width: 18px;
    border-radius: 3px;
}

/* Touch swipe indicator */
.product-image-carousel.touch-active {
    cursor: grabbing;
}

/* Multiple images badge */
.has-multiple-images::before {
    content: '📷';
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    z-index: 5;
}

/* Arrow buttons for desktop hover */
.product-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #DDD;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s, background 0.2s;
    font-size: 18px;
    color: #0F1111;
}

.strip-product-card:hover .product-carousel-arrow,
.product:hover .product-carousel-arrow {
    opacity: 1;
}

.product-carousel-arrow:hover {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.product-carousel-prev {
    left: 5px;
}

.product-carousel-next {
    right: 5px;
}

/* Hide arrows on mobile (touch swipe only) */
@media (max-width: 768px) {
    .product-carousel-arrow {
        display: none;
    }
}

/* ========================================
   STRIP PRODUCT CARD ENHANCEMENTS (consolidated - no duplicates)
   ======================================== */

/* NOTE: .strip-product-card, .strip-product-link, .strip-product-info
   are fully defined above. Only additions/overrides here. */

/* Ensure button stays at bottom */
.strip-product-card .button {
    margin-top: auto !important;
}

/* ========================================
   DISCOVERY CARD ADD TO CART
   ======================================== */

.card-footer .btn-add-to-cart {
    display: block;
    width: 100%;
    padding: 10px;
    background: #FFD814;
    color: #0F1111;
    border: 1px solid #FCD200;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    margin-top: 8px;
}

.card-footer .btn-add-to-cart:hover {
    background: #F7CA00;
    box-shadow: 0 2px 5px rgba(213,217,217,0.7);
}

/* ========================================
   MOBILE PRODUCT GRID FIXES
   ======================================== */

@media (max-width: 768px) {
    /* 2 column grid on mobile */
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 10px !important;
    }
    
    .woocommerce ul.products li.product {
        padding: 10px !important;
    }
    
    /* Smaller buttons on mobile */
    .product .button {
        padding: 8px 10px !important;
        font-size: 12px !important;
    }
    
    /* Mobile strip cards */
    .strip-product-card {
        flex: 0 0 150px;
        width: 150px;
    }
    
    .strip-product-image {
        height: 150px;
    }
}

/* ========================================
   CSS SCROLL-SNAP FOR SMOOTH SWIPING
   ======================================== */

.strip-products {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.strip-product-card {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

/* Smooth scroll behavior */
.strip-products {
    scroll-behavior: smooth;
}

/* ========================================
   ADDITIONAL POLISH
   ======================================== */

/* Remove any conflicting margins */
.woocommerce-page .content-area,
.woocommerce .content-area {
    margin: 0 !important;
}

/* Fix container widths */
.woocommerce-page .ast-container,
.woocommerce .ast-container {
    max-width: 100% !important;
    padding: 0 15px !important;
}

/* Prevent text selection during swipe */
.strip-products.dragging {
    cursor: grabbing;
    user-select: none;
}

.strip-products.dragging * {
    pointer-events: none;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0F1111;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Desktop fixes for root homepage (Amazon layout) */

body.homepage-amazon,
.homepage-amazon {
    background: #F5EDE6 !important; /* Elite: warm ivory */
}

/* ========================================
   ELITE COSMETIC GLOBAL HEADER OVERRIDES
   ======================================== */

/* Navigation links */
.main-header-menu .menu-link,
.ast-nav-menu .menu-link {
    color: #1A1A2E !important;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: color 0.2s !important;
}

.main-header-menu .menu-link:hover,
.ast-nav-menu .menu-link:hover {
    color: #C8446B !important; /* Deep Rose on hover */
}

/* Cart icon color */
.ast-site-header-cart .ast-icon,
.ast-site-header-cart svg {
    color: #C8446B !important;
    fill: #C8446B !important;
}

/* Cart total amount */
.ast-woo-header-cart-total,
.ast-woo-header-cart-info-wrap {
    color: #1A1A2E !important;
    font-weight: 600 !important;
}

/* Account icon */
.ast-header-account-link svg path,
.ast-header-account-link .account-icon path {
    fill: #C8446B !important;
}

/* WooCommerce price colors site-wide */
.woocommerce-Price-amount,
.price .amount {
    color: #C8446B !important;
}

/* Product title hover */
.strip-product-card:hover .strip-product-title {
    color: #C8446B !important; /* Deep Rose */
}

/* Added to cart state */
.button.added {
    background: linear-gradient(135deg, #D4AF37 0%, #B8941E 100%) !important;
    border: none !important;
    color: #1A1A2E !important;
}

/* Discovery card footer btn */
.card-footer .btn-add-to-cart {
    background: linear-gradient(135deg, #C8446B 0%, #A3304F 100%);
    color: white;
    border: none;
    border-radius: 20px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-size: 12px;
}

.card-footer .btn-add-to-cart:hover {
    background: linear-gradient(135deg, #D4AF37 0%, #B8941E 100%);
    color: #1A1A2E;
}

@media (min-width: 1024px) {
    body.homepage-amazon .discovery-cards-grid,
    .homepage-amazon .discovery-cards-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px !important;
        max-width: 1240px !important; /* FIX: Aligned with .ast-container */
        margin: 0 auto !important;
    }

    body.homepage-amazon .strip-products,
    .homepage-amazon .strip-products {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 15px !important;
    }
}

body.homepage-amazon .card-quad-grid,
body.homepage-amazon .category-card-quad-container,
.homepage-amazon .card-quad-grid,
.homepage-amazon .category-card-quad-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 5px !important;
}

/* ========================================
   PRODUCT CARD IMAGE CAROUSEL
   ======================================== */

.product-image-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    background: #f9f0f4;
}

.product-image-carousel-track {
    position: relative;
    width: 100%;
}

.product-image-carousel-slide {
    display: none;
    width: 100%;
}

.product-image-carousel-slide.active {
    display: block;
}

.product-image-carousel-slide img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.strip-product-card:hover .product-image-carousel-slide.active img {
    transform: scale(1.04);
}

/* Carousel arrows */
.product-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(200,68,107,0.2);
    color: #C8446B;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    padding: 0;
}

.strip-product-card:hover .product-carousel-arrow {
    opacity: 1;
}

.product-carousel-prev { left: 6px; }
.product-carousel-next { right: 6px; }

.product-carousel-arrow:hover {
    background: #C8446B;
    color: #fff;
}

/* Carousel dots */
.product-carousel-dots {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 10;
}

.product-carousel-dots .pdot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.product-carousel-dots .pdot.active {
    background: #C8446B;
    transform: scale(1.4);
}

/* ========================================
   CART TOGGLE BUTTON (Add / Remove)
   ======================================== */

.kf-cart-toggle {
    display: block;
    width: 100%;
    padding: 9px 10px;
    background: linear-gradient(135deg, #C8446B 0%, #A3304F 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(200,68,107,0.3);
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

/* Label visibility */
.kf-cart-toggle .btn-add-label    { display: inline; }
.kf-cart-toggle .btn-remove-label { display: none; }

.kf-cart-toggle.in-cart .btn-add-label    { display: none; }
.kf-cart-toggle.in-cart .btn-remove-label { display: inline; }

/* In-cart state — gold gradient */
.kf-cart-toggle.in-cart {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    box-shadow: 0 3px 10px rgba(76,175,80,0.3);
}

.kf-cart-toggle.in-cart:hover {
    background: linear-gradient(135deg, #dc3545 0%, #a71d2a 100%);
    box-shadow: 0 3px 12px rgba(220,53,69,0.35);
}

/* Hover — normal state */
.kf-cart-toggle:not(.in-cart):hover {
    background: linear-gradient(135deg, #D4AF37 0%, #B8941E 100%);
    color: #1A1A2E;
    box-shadow: 0 5px 15px rgba(212,175,55,0.4);
    transform: translateY(-1px);
}

/* Loading spinner */
.kf-cart-toggle.loading {
    opacity: 0.7;
    cursor: wait;
}

/* Out of stock */
.kf-cart-toggle.out-of-stock {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
}

/* ========================================
   INSTANT CHECKOUT BUTTON
   ======================================== */

.kf-instant-checkout {
    display: block;
    width: 100%;
    padding: 9px 10px;
    background: linear-gradient(135deg, #D4AF37 0%, #B8941E 100%);
    color: #1A1A2E;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    margin-top: 6px;
    box-shadow: 0 3px 10px rgba(212,175,55,0.35);
    transition: all 0.3s ease;
    /* Hidden by default */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.kf-instant-checkout.visible {
    max-height: 50px;
    opacity: 1;
    margin-top: 6px;
    padding: 9px 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { max-height: 0; opacity: 0; transform: translateY(-5px); }
    to   { max-height: 50px; opacity: 1; transform: translateY(0); }
}

.kf-instant-checkout:hover {
    background: linear-gradient(135deg, #C8446B 0%, #A3304F 100%);
    color: #fff;
    box-shadow: 0 5px 15px rgba(200,68,107,0.4);
    transform: translateY(-1px);
}

/* ========================================
   IN-CART CARD STATE
   ======================================== */

.strip-product-card.in-cart {
    border-color: #4CAF50 !important;
    box-shadow: 0 4px 16px rgba(76,175,80,0.2) !important;
}

.strip-product-card.in-cart::before {
    content: '✓ In Cart';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #4CAF50;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 10px;
    z-index: 20;
    text-transform: uppercase;
}

/* Make card relative for the badge — overflow visible so badge shows above border */
.strip-product-card {
    position: relative;
    overflow: visible !important; /* Allow in-cart badge to show outside card bounds */
    cursor: pointer;
}

.strip-product-card .strip-product-image,
.strip-product-card .strip-product-info {
    cursor: pointer;
}

/* But keep image area clipped */
.strip-product-card .strip-product-image,
.strip-product-card .product-image-carousel {
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

/* ========================================
   PRODUCT TITLE LINK
   ======================================== */

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

.strip-product-title-link:hover .strip-product-title {
    color: #C8446B;
}

/* ========================================
   STRIP PRODUCT INFO LAYOUT FIX
   ======================================== */

.strip-product-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

/* ========================================
   MOBILE RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .product-image-carousel-slide img {
        height: 160px;
    }

    .kf-cart-toggle,
    .kf-instant-checkout {
        font-size: 11px;
        padding: 8px 8px;
    }

    .product-carousel-arrow {
        opacity: 1; /* Always show on mobile */
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
}
