/* ================================================== */
/* 1. SWIPER / 3RD PARTY LIBRARY OVERRIDES            */
/* ================================================== */

.swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.swiper-slide {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.swiper.product-carousel,
.swiper.taxonomy-carousel {
    height: 380px; 
}


/* ================================================== */
/* 2. NATIVE CAROUSEL ENGINE (Layout & Sizing)        */
/* ================================================== */

.native-carousel {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding-bottom: 20px;
    overflow: visible; /* Allows arrows to sit outside */
}

.carousel-inner {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    gap: 15px; 
    padding-bottom: 20px; 
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-width: 0; 
    /* Force Track to Stretch Items (Equal Height Logic) */
    align-items: stretch;
}

.carousel-track::-webkit-scrollbar { 
    height: 0; 
}

/* --- Item Sizing & Responsive --- */
.carousel-item {
    flex: 0 0 18.18%; /* 5.5 items visible */
    box-sizing: border-box;
    scroll-snap-align: start;
    min-width: 0;
    /* Force Item to Fill Track (Equal Height Logic) */
    height: auto; 
    display: flex;
    flex-direction: column;
}

/* Keep Budget Carousel override if needed */
.native-carousel.budget-carousel .carousel-item {
    flex: 0 0 18.18% !important; 
}

/* Tablet */
@media (max-width: 1384px) {
    .carousel-item { flex: 0 0 calc(100% / 4.5); }
}

/* Mobile */
@media (max-width: 768px) {
    .carousel-item { 
        flex: 0 0 40%; 
        max-width: 40%;
    }
    .carousel-track {
        padding-left: 10px;
        padding-right: 40px;
        gap: 10px;
    }
}


/* ================================================== */
/* 3. NAVIGATION (ARROWS)                             */
/* ================================================== */

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    margin-top: -20px; 
    background: rgb(234, 234, 234);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: background 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
    z-index: 20; 
}

.carousel-nav:hover {
    background: #b8b8b8;
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

/* Position 50px outside */
.carousel-nav.prev { left: -50px; } 
.carousel-nav.next { right: -50px; }

.carousel-nav .arrow-icon { 
    width: 20px; 
    height: 20px; 
    display: block; 
    pointer-events: none; 
}

@media (max-width: 1384px) {
    .carousel-nav { display: none !important; }
}


/* ================================================== */
/* 4. PRODUCT CAROUSEL STYLING (Complete)             */
/* ================================================== */

/* --- Container List Item --- */
.native-carousel .carousel-item > li.product {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* --- Main Card Shell --- */
.native-carousel .custom-product-card {
    /* Layout & Flex */
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
    justify-content: space-between; /* Pushes header up and footer down */
    height: 100%; /* Fill the item */
    position: relative; 
    text-align: center;
    
    /* Visuals */
    background: #fff; 
    border: 1px solid #eee; /* Merch Border */
    border-radius: 4px;
    overflow: hidden; 
    transition: border-color 0.2s ease;
    box-shadow: none;
}

.native-carousel .custom-product-card:hover {
    border-color: #ccc; /* Merch Hover */
}

/* --- Image Wrapper & Hover Effects --- */
.native-carousel .custom-product-card .product-image-wrapper {
    position: relative;
    width: 100%;
    height: auto;       
    aspect-ratio: 1/1; /* Forces Square */
    background: #f9f9f9; 
    overflow: hidden;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 15px;
}

.native-carousel .custom-product-card .product-image-wrapper .primary-image,
.native-carousel .custom-product-card .product-image-wrapper .secondary-image {
    position: absolute;
    top: 0;
    left: 0; 
    width: 100%;
    height: 100%;
    
    /* 🏆 FIX: Changed from 'cover' to 'contain' to match grid */
    object-fit: contain; 
    
    transform: none; 
    transition: opacity 0.3s ease-in-out;
    
    /* 🏆 FIX: Changed from 'normal' to 'multiply' to blend white backgrounds */
    mix-blend-mode: multiply; 
}

.native-carousel .custom-product-card .product-image-wrapper .secondary-image {
    opacity: 0;
}

/* Hover Logic */
.native-carousel .custom-product-card:hover .product-image-wrapper .secondary-image {
    opacity: 1;
}

.native-carousel .custom-product-card:hover .product-image-wrapper:has(.secondary-image) .primary-image {
    opacity: 0;
}

@media (max-width: 1384px) {
  .native-carousel .custom-product-card:hover .product-image-wrapper .secondary-image { opacity: 0; }
  .native-carousel .custom-product-card:hover .product-image-wrapper:has(.secondary-image) .primary-image { opacity: 1; }
}

/* --- Ribbons (Pro/Grid Style) --- */
.native-carousel .custom-product-card .sale-ribbon,
.native-carousel .custom-product-card .new-ribbon,
.native-carousel .custom-product-card .stock-ribbon.out {
    display: block; 
    position: absolute;
    top: 8px; 
    left: 8px;
    font-size: 9px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 2px;
    z-index: 20;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.native-carousel .custom-product-card .sale-ribbon { background-color: #d00000; }
.native-carousel .custom-product-card .new-ribbon { background-color: #000000; }
.native-carousel .custom-product-card .stock-ribbon.out { background-color: #757575; }

/* --- Content & Typography --- */
.native-carousel .custom-product-card .product-details {
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Ensure details take up available space */
}

.native-carousel .custom-product-card .product-brand {
    font-weight: 700;
    font-size: 14px; 
    color: #999; /* Merch Grey */
    text-transform: uppercase;
    margin-top: 5px;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

.native-carousel .custom-product-card .product-title {
    font-size: 16px;
    font-weight: 400; 
    color: #111;
    padding: 0 10px;
    line-height: 1.3;
    word-wrap: break-word;
}

/* --- Price Styling & Positioning --- */
.native-carousel .custom-product-card .product-price {
    font-weight: 700;
    font-size: 14px;
    color: #111;
    margin-top: auto; /* Pushes price to bottom of card */
    margin-bottom: 0; 
    padding-top: 6px; 
}

/* Old Price (Red & Slashed) */
.native-carousel .custom-product-card .product-price del {
    color: #e63946; 
    margin-right: 8px;
    font-weight: 400;
    text-decoration: line-through;
    opacity: 1;
}

/* Current/Sale Price (Black & Bold) */
.native-carousel .custom-product-card .product-price ins {
    text-decoration: none;
    color: #111;
    font-weight: 700;
}


/* ================================================== */
/* 5. FEATURE BOX STYLING                             */
/* ================================================== */

/* Overrides for item width */
.featurebox-carousel .carousel-item { flex: 0 0 calc(100% / 5.5); }

@media (max-width: 1384px) {
    .featurebox-carousel .carousel-item { flex: 0 0 calc(100% / 4.6); }
}
@media (max-width: 480px) {
    .featurebox-carousel .carousel-item { flex: 0 0 calc(100% / 2.3); }
}

/* Card Styling */
.featurebox-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    height: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

.featurebox-card:hover { 
    box-shadow: 0 4px 10px rgba(0,0,0,0.08); 
}

/* Internal Elements */
.featurebox-image { 
    height: 180px; 
    background: #eee; 
}

.featurebox-image img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
}

.featurebox-content { 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; 
    text-align: center; 
    padding: 20px 15px; 
}

.featurebox-brand { 
    font-size: 14px; 
    font-weight: bold; 
    text-transform: uppercase; 
    color: #888; 
    margin-bottom: 4px; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.featurebox-heading { 
    font-size: 18px; 
    font-weight: 600; 
    color: #333; 
    line-height: 1.4; 
    margin-bottom: auto; 
}

.featurebox-button { 
    display: inline-block; 
    margin-top: 16px; /* auto handled below via flex */
    margin-top: auto; /* Force to bottom */
    padding: 10px 18px; 
    font-size: 14px; 
    background: #000; 
    color: #fff; 
    text-decoration: none; 
    border-radius: 1px; 
    transition: background 0.2s ease; 
}

.featurebox-button:hover { 
    background: #333; 
    color: #fff; 
}


/* ================================================== */
/* 6. TAXONOMY & GENERIC CARDS                        */
/* ================================================== */

/* Base Generic Card Logic */
.card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

/* Taxonomy Specifics */
.native-carousel.taxonomy-carousel .card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.native-carousel.taxonomy-carousel .carousel-image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.native-carousel.taxonomy-carousel .carousel-image-wrapper img {
    max-width: 100%;
    max-height: 80%;
    object-fit: contain;
    display: block;
}

/* Taxonomy Content Growth */
.native-carousel.taxonomy-carousel .card .featurebox-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}


/* ================================================== */
/* 7. BUNDLE / GIFT CARDS                             */
/* ================================================== */

.native-carousel .bundle-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.bundle-card .bundle-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 15px; 
}

.bundle-card .bundle-title {
    margin-bottom: 10px;
}

/* Push CTA/Price to bottom */
.bundle-card .bundle-cta,
.bundle-card .bundle-price {
    margin-top: auto;
}

.bundle-image-container {
    aspect-ratio: 1/1; /* Force square like products */
    width: 100%;
    position: relative;
    overflow: hidden;
}

.bundle-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}