/* 
   THE NURSERY OUTLET - DYNAMIC DEALS CAROUSEL STYLESHEET
   Sleek, lightweight, scroll-snap image slider matching the brand design system.
*/

.tno-module-wrapper .deals-header {
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
}

.tno-module-wrapper .deals-header h2 {
    margin-bottom: 0.75rem;
}

.tno-module-wrapper .deals-header p {
    color: rgba(32, 32, 32, 0.8);
    font-size: 0.95rem;
}

.tno-deals-carousel-wrapper {
    position: relative;
    width: 100%;
    margin: 3.5rem auto 2.5rem auto; /* Added more spacing at the top (3.5rem) */
    padding: 0 3.5rem; /* Give space on left/right for navigation arrows so they don't overlap images */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Scroll prevention overrides: Hide navigation if slides fit the screen layout */
.tno-deals-no-scroll-desktop .tno-deals-arrow,
.tno-deals-no-scroll-desktop .tno-deals-dots {
    display: none !important;
}

@media (max-width: 1023px) {
    .tno-deals-no-scroll-desktop .tno-deals-arrow {
        display: flex !important;
    }
    .tno-deals-no-scroll-desktop .tno-deals-dots {
        display: flex !important;
    }
}

.tno-deals-no-scroll-tablet .tno-deals-arrow,
.tno-deals-no-scroll-tablet .tno-deals-dots {
    display: none !important;
}

@media (max-width: 767px) {
    .tno-deals-no-scroll-tablet .tno-deals-arrow {
        display: flex !important;
    }
    .tno-deals-no-scroll-tablet .tno-deals-dots {
        display: flex !important;
    }
}

/* Track Container to hide overflow and shape the bounds */
.tno-deals-track-container {
    overflow: hidden;
    width: 100%;
}

/* The actual scrollable list of slide images */
.tno-deals-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    position: relative;
    padding: 0.5rem 0.25rem 1rem 0.25rem; /* Small vertical breathing room for shadows */
    margin-bottom: -0.5rem;
}

.tno-deals-track::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Edge */
}

/* Slide item */
.tno-deal-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Slide promotional image */
.tno-deal-image {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: unset !important;
    object-fit: unset !important;
    display: block !important;
    border-radius: var(--radius-md, 12px) !important;
    box-shadow: var(--shadow-medium, 0 6px 18px rgba(0, 0, 0, 0.05)) !important;
    border: 1px solid rgba(32, 32, 32, 0.06) !important;
    transition: var(--transition-smooth, all 0.4s cubic-bezier(0.16, 1, 0.3, 1)) !important;
}

/* Hover effects */
.tno-deal-image:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(32, 32, 32, 0.08);
    border-color: rgba(19, 111, 99, 0.15);
}

/* Slide Navigation Arrows (positioned on the outer sides) */
.tno-deals-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--color-white, #FBFAF9);
    border: 1px solid rgba(32, 32, 32, 0.08);
    color: var(--color-dark, #202020);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-medium, 0 6px 18px rgba(0, 0, 0, 0.05));
    z-index: 10;
    padding: 0;
    transition: var(--transition-smooth, all 0.4s cubic-bezier(0.16, 1, 0.3, 1));
}

.tno-deals-arrow svg {
    transition: transform 0.3s ease;
}

.tno-deals-arrow:hover {
    background-color: var(--color-primary, #136F63);
    color: var(--color-white, #FBFAF9);
    border-color: var(--color-primary, #136F63);
}

.tno-deals-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.tno-deals-prev {
    left: 0; /* Align to outer left edge */
}

.tno-deals-next {
    right: 0; /* Align to outer right edge */
}

.tno-deals-prev:hover svg {
    transform: translateX(-2px);
}

.tno-deals-next:hover svg {
    transform: translateX(2px);
}

/* Dots pagination indicators (pushed lower under carousel) */
.tno-deals-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 2.25rem; /* Lowered from 1.5rem */
}

.tno-deals-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(32, 32, 32, 0.2);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: var(--transition-smooth, all 0.4s cubic-bezier(0.16, 1, 0.3, 1));
}

.tno-deals-dot:hover {
    background-color: rgba(32, 32, 32, 0.4);
}

.tno-deals-dot.active {
    background-color: var(--color-primary, #136F63);
    width: 24px;
    border-radius: 5px;
}

/* ==========================================================================
   Lightbox / Modal Styling
   ========================================================================== */
.tno-deals-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(32, 32, 32, 0.92);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tno-deals-lightbox.open {
    display: flex;
    opacity: 1;
}

.tno-deals-lightbox-content {
    max-width: 90%;
    max-height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tno-deals-lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background-color: #000;
}

.tno-deals-lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2.5rem;
    color: var(--color-white, #FBFAF9);
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    z-index: 1000000;
    transition: var(--transition-smooth, all 0.4s cubic-bezier(0.16, 1, 0.3, 1));
}

.tno-deals-lightbox-close:hover {
    color: var(--color-primary, #136F63);
    transform: scale(1.1);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablets & Small Desktops (2 Items) */
@media (min-width: 768px) {
    .tno-deal-slide {
        flex: 0 0 calc(50% - 0.75rem); /* 2 items visible, splitting gap */
    }
}

/* Large Desktops (3 Items) */
@media (min-width: 1024px) {
    .tno-deal-slide {
        flex: 0 0 calc(33.333% - 1rem); /* 3 items visible, splitting gap */
    }
}

/* Mobile adjustments (adjust layout padding so arrows don't clip offscreen) */
@media (max-width: 768px) {
    .tno-deals-carousel-wrapper {
        padding: 0 0.5rem; /* Allow wider track on mobile screens */
    }
    
    .tno-deals-prev {
        left: 0.25rem;
    }
    
    .tno-deals-next {
        right: 0.25rem;
    }
    
    .tno-deals-arrow {
        width: 38px;
        height: 38px;
        background-color: rgba(251, 250, 249, 0.95); /* Slightly transparent white on mobile */
    }
    
    .tno-deals-track {
        gap: 1rem;
    }
}

/* Focus and Accessibility */
.tno-deals-dot:focus-visible,
.tno-deals-arrow:focus-visible,
.tno-deals-lightbox-close:focus-visible {
    outline: 2px solid var(--color-primary, #136F63);
    outline-offset: 3px;
}
