/* Related Products Carousel - Old Money Aesthetic */
/* Shows 3 products at a time, 8 total, 2:3 ratio */
/* Deep Green: #1a3d2e | Gold: #d4af37 */
/* Save this as: related-products-carousel.css in your theme folder */

/* Hide WooCommerce default related products & buttons */
.related_products,
.related.products,
.woocommerce .related.products {
    display: none !important;
}

.related-carousel-wrapper .product-card .button,
.related-carousel-wrapper .add_to_cart_button,
.related-carousel-wrapper .added_to_cart {
    display: none !important;
}

:root {
    --deep-green: #1a3d2e;
    --gold: #d4af37;
    --light-gold: #f0e5c8;
    --cream: #faf8f3;
    --charcoal: #2d2d2d;
}

.related-carousel-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 80px auto 64px auto;
    padding: 64px 32px 0 32px;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
}

/* Header */
.related-header {
    text-align: center;
    margin-bottom: 48px;
}

.related-title {
    font-size: 36px;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--deep-green);
    margin: 0 0 24px 0;
    font-family: 'Playfair Display', 'Georgia', serif;
}

.related-divider {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 0 auto;
}

/* Carousel Container */
.related-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.related-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 8px 0 32px 0;
}

.related-track::-webkit-scrollbar {
    display: none;
}

/* Show exactly 2-3 products at a time (for 50% container) */
.related-item {
    flex: 0 0 calc(50% - 12px);
    max-width: calc(50% - 12px);
    min-width: 280px;
}

/* Product Card */
.product-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
    width: 100%;
}

.product-card:hover {
    transform: translateY(-4px);
}

/* Product Image - FIXED 2:3 RATIO */
.related-carousel-wrapper .product-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 150%; /* 2:3 ratio = 150% (3/2 * 100) */
    overflow: hidden;
    background-color: var(--cream);
    margin-bottom: 20px;
}

.related-carousel-wrapper .product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.related-carousel-wrapper .product-card:hover .product-image {
    transform: scale(1.05);
}

/* Sale Flag */
.related-carousel-wrapper .sale-flag {
    position: absolute;
    top: 16px;
    right: 16px;
    background-color: var(--deep-green);
    color: var(--gold);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 6px 14px;
    z-index: 2;
    border: 1px solid var(--gold);
}

/* Product Overlay */
.related-carousel-wrapper .product-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 61, 46, 0.05);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.related-carousel-wrapper .product-card:hover .product-overlay {
    opacity: 0;
}

.related-carousel-wrapper .view-product {
    color: var(--gold);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--gold);
    padding-bottom: 4px;
}

/* Product Info */
.related-carousel-wrapper .product-info {
    padding: 0 4px;
}

.related-carousel-wrapper .product-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.related-carousel-wrapper .product-tag {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    background-color: transparent;
    border: 1px solid var(--gold);
    padding: 4px 10px;
    display: inline-block;
}

.related-carousel-wrapper .product-name {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--deep-green);
    margin: 0 0 8px 0;
    line-height: 1.4;
    min-height: 44px;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
}

.related-carousel-wrapper .product-price {
    font-size: 15px;
    font-weight: 500;
    color: var(--charcoal);
    letter-spacing: 0.03em;
}

.related-carousel-wrapper .product-price del {
    color: #999;
    margin-right: 8px;
    font-weight: 400;
}

.related-carousel-wrapper .product-price ins {
    text-decoration: none;
    color: var(--deep-green);
}

/* Carousel Arrows */
.related-arrow {
    position: absolute;
    top: 35%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: var(--cream);
    border: 1px solid var(--gold);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

.related-container:hover .related-arrow {
    opacity: 1;
}

.related-arrow:hover {
    background-color: var(--deep-green);
    border-color: var(--deep-green);
}

.related-arrow:hover svg {
    stroke: var(--gold);
}

.related-arrow svg {
    stroke: var(--deep-green);
    transition: stroke 0.3s ease;
}

.related-arrow-left {
    left: -24px;
}

.related-arrow-right {
    right: -24px;
}

/* Loading Animation */
.related-carousel-wrapper .loading-bar {
    background: linear-gradient(90deg, #f5f3ed 25%, #ebe8dd 50%, #f5f3ed 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 0;
}

.related-carousel-wrapper .product-image-wrapper.loading-bar {
    padding-bottom: 150%; /* Maintain 2:3 ratio during loading */
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Tablet - Show 2 products */
@media (max-width: 1024px) {
    .related-item {
        flex: 0 0 calc(50% - 12px);
        max-width: calc(50% - 12px);
        min-width: 260px;
    }
    
    .related-title {
        font-size: 28px;
    }
    
    .related-carousel-wrapper {
        padding: 64px 24px 0 24px;
    }
}

/* Mobile - Show 1.5-2 products */
@media (max-width: 768px) {
    .related-carousel-wrapper {
        margin: 64px auto 48px auto;
        padding: 48px 16px 0 16px;
    }
    
    .related-header {
        margin-bottom: 32px;
    }
    
    .related-title {
        font-size: 24px;
        letter-spacing: 0.08em;
    }
    
    .related-item {
        flex: 0 0 calc(55% - 12px);
        max-width: calc(55% - 12px);
        min-width: 200px;
    }
    
    .related-carousel-wrapper .product-name {
        font-size: 14px;
        min-height: 40px;
    }
    
    .related-carousel-wrapper .product-price {
        font-size: 13px;
    }
    
    .related-carousel-wrapper .product-tag {
        font-size: 9px;
        padding: 3px 8px;
    }
    
    .related-carousel-wrapper .sale-flag {
        font-size: 10px;
        padding: 5px 10px;
        top: 12px;
        right: 12px;
    }
    
    .related-arrow {
        width: 40px;
        height: 40px;
    }
    
    .related-arrow svg {
        width: 20px;
        height: 20px;
    }
    
    .related-arrow-left {
        left: -8px;
    }
    
    .related-arrow-right {
        right: -8px;
    }
    
    .related-carousel-wrapper .view-product {
        font-size: 11px;
    }
}

/* Small Mobile - Show 1 product */
@media (max-width: 480px) {
    .related-item {
        flex: 0 0 85%;
        max-width: 85%;
        min-width: 200px;
    }
    
    .related-track {
        gap: 16px;
    }
    
    .related-carousel-wrapper .product-image-wrapper {
        margin-bottom: 16px;
    }
}