﻿/* ============================================================================
   FINAL CAROUSEL FIX - Add to END of carousel.css or home.css
   ============================================================================ */

/* =========================
   PRODUCT CARD STRUCTURE
   ========================= */

.product-card {
    background: white !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}

/* =========================
   CAROUSEL CONTAINER
   ========================= */

.product-card .product-carousel {
    position: relative !important;
    width: 100% !important;
    overflow: hidden !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}

/* =========================
   CAROUSEL SLIDES
   ========================= */

.product-carousel .carousel-slide {
    flex: 0 0 100% !important;
    min-width: 100% !important;
    width: 100% !important;
    display: none !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    position: relative !important;
}

.product-carousel .carousel-slide.active {
    display: block !important;
}

/* =========================
   PRODUCT CARD LINK
   ========================= */

.product-carousel .carousel-slide a,
.product-carousel .carousel-slide .product-card-link {
    display: block !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    text-decoration: none !important;
    position: relative !important;
}

/* =========================
   PRODUCT IMAGE CONTAINER
   ========================= */

.product-card .product-image,
.product-carousel .carousel-slide .product-image {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 100% !important; /* 1:1 aspect ratio = square */
    overflow: hidden !important;
    background: #f3f4f6 !important;
}

/* For 4:3 aspect ratio, use: padding-bottom: 75% !important; */
/* For 16:9 aspect ratio, use: padding-bottom: 56.25% !important; */

/* =========================
   IMAGES INSIDE CAROUSEL
   ========================= */

.product-card .product-image img,
.product-carousel .carousel-slide .product-image img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}

/* Alternative: Contain mode (shows full image with padding) */
.product-image img.fit-contain {
    object-fit: contain !important;
    padding: 1rem !important;
}

/* =========================
   IMAGE PLACEHOLDER
   ========================= */

.product-image-placeholder {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%),
                linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%) !important;
    background-size: 20px 20px !important;
    background-position: 0 0, 10px 10px !important;
    color: #9ca3af !important;
    font-size: 3rem !important;
}

/* =========================
   PRODUCT BADGES
   ========================= */

.product-card .product-badges,
.product-carousel .product-badges {
    position: absolute !important;
    top: 1rem !important;
    left: 1rem !important;
    z-index: 5 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    pointer-events: none !important;
}

.product-badges .badge {
    display: inline-block !important;
    padding: 6px 14px !important;
    border-radius: 50px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.badge-featured {
    background: linear-gradient(135deg, rgba(184,134,11,0.95) 0%, rgba(160, 82, 45, 0.95) 100%) !important;
    color: white !important;
}

.badge-custom {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(99, 102, 241, 0.95) 100%) !important;
    color: white !important;
}

/* =========================
   CAROUSEL NAVIGATION
   ========================= */

.product-carousel .carousel-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    padding: 0 10px !important;
    pointer-events: none !important;
    z-index: 10 !important;
}

.product-carousel .carousel-btn {
    pointer-events: auto !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    font-size: 1rem !important;
    color: #333 !important;
    padding: 0 !important;
}

.product-carousel .carousel-btn:hover {
    background: #B8860B !important;
    color: white !important;
    transform: scale(1.1) !important;
}

.product-carousel .carousel-btn:active {
    transform: scale(0.95) !important;
}

/* =========================
   CAROUSEL DOTS
   ========================= */

.product-carousel .carousel-dots {
    display: flex !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-top: 15px !important;
    padding: 10px 0 !important;
    position: relative !important;
    z-index: 1 !important;
}

.product-carousel .carousel-dot {
    width: 10px !important;
    height: 10px !important;
    min-width: 10px !important;
    min-height: 10px !important;
    border-radius: 50% !important;
    background: #ddd !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.product-carousel .carousel-dot:hover {
    background: #bbb !important;
    transform: scale(1.2) !important;
}

.product-carousel .carousel-dot.active {
    background: #B8860B !important;
    width: 12px !important;
    height: 12px !important;
}

/* =========================
   PRODUCT INFO SECTION
   ========================= */

.product-card .product-info {
    padding: 1.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    flex: 1 !important;
    height: auto !important;
    min-height: auto !important;
}

.product-card .product-name {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    margin-bottom: 0 !important;
    color: #1f2937 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    line-height: 1.4 !important;
    letter-spacing: -0.02em !important;
    height: auto !important;
    min-height: auto !important;
}

.product-card .product-name a {
    color: inherit !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.product-card .product-name a:hover {
    color: #B8860B !important;
}

.product-card .product-description {
    color: #64748b !important;
    margin-bottom: 0 !important;
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    flex-grow: 1 !important;
    height: auto !important;
    min-height: auto !important;
}

.product-card .product-price {
    font-size: 1.375rem !important;
    font-weight: 800 !important;
    color: #B8860B !important;
    margin-bottom: 0 !important;
    letter-spacing: -0.02em !important;
    text-shadow: 0 1px 2px rgba(184,134,11,0.1) !important;
}

.product-card .product-actions {
    display: flex !important;
    gap: 0.75rem !important;
    margin-top: 1.25rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.product-card .product-actions .btn {
    flex: 1 !important;
    padding: 0.875rem 1.25rem !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    border-radius: 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 2px solid transparent !important;
    letter-spacing: 0.02em !important;
    min-height: 44px !important;
}

.product-card .product-actions .btn-icon {
    flex: 0 0 auto !important;
    min-width: 52px !important;
}

/* =========================
   RESPONSIVE ADJUSTMENTS
   ========================= */

@media (max-width: 640px) {
    .product-card .product-image,
    .product-carousel .carousel-slide .product-image {
        padding-bottom: 100% !important; /* Keep square on mobile */
    }
    
    .product-card .product-info {
        padding: 1rem !important;
    }
    
    .product-card .product-name {
        font-size: 1rem !important;
    }
    
    .product-card .product-description {
        font-size: 0.85rem !important;
        -webkit-line-clamp: 2 !important;
    }
    
    .product-card .product-price {
        font-size: 1.2rem !important;
    }
    
    .product-carousel .carousel-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        font-size: 0.9rem !important;
    }
    
    .product-carousel .carousel-dots {
        margin-top: 10px !important;
        padding: 8px 0 !important;
    }
}

/* =========================
   HOVER EFFECTS
   ========================= */

.product-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 20px 45px rgba(184,134,11,0.15), 0 8px 25px rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(184,134,11,0.2) !important;
}

.product-card:hover .product-image img {
    transform: scale(1.05) !important;
}

/* =========================
   ACCESSIBILITY
   ========================= */

.product-carousel .carousel-btn:focus,
.product-carousel .carousel-dot:focus {
    outline: 3px solid #B8860B !important;
    outline-offset: 2px !important;
}

/* =========================
   REMOVE ANY TRACK/CONTAINER WRAPPERS
   ========================= */

.product-carousel .carousel-container,
.product-carousel .carousel-track {
    display: contents !important;
}

/* =========================
   DEBUGGING (Remove in production)
   ========================= */

/* Uncomment to debug layout issues
.product-card {
    border: 2px solid red !important;
}

.product-carousel {
    border: 2px solid blue !important;
}

.carousel-slide {
    border: 2px solid green !important;
}

.carousel-slide.active {
    border: 2px solid lime !important;
}

.product-image {
    border: 2px solid orange !important;
}
*/