/* Hero Carousel Responsive Behavior */

/* CRITICAL: Hide mobile-only elements by default on all screens */
.hero-product.mobile-only {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Desktop (769px and up) - Show all 5 desktop products, hide mobile images */
@media (min-width: 769px) {
    /* CRITICAL: Ensure hero carousel is above navbar */
    #heroCarousel {
        position: relative !important;
        z-index: 100 !important;
        overflow: hidden !important;
    }

    /* CRITICAL: Override carousel-item height - 500px */
    .carousel-item,
    #heroCarousel .carousel-item {
        height: 500px !important;
        min-height: 500px !important;
        max-height: 500px !important;
        overflow: hidden !important;
    }

    /* Hide mobile-only images on desktop */
    .carousel-item .carousel-scene .hero-product.mobile-only,
    .hero-product.mobile-only {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        position: absolute !important;
        left: -10000px !important;
        top: -10000px !important;
        z-index: -1000 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* Show all desktop products with proper positions */
    .carousel-item.active .carousel-scene #hero-carousel .hero-product-1.desktop-only,
    .carousel-item .carousel-scene .hero-product-1.desktop-only,
    .hero-product-1.desktop-only {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: absolute !important;
        top: 25% !important;
        left: 15% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
        z-index: 100 !important;
        width: auto !important;
        height: auto !important;
        overflow: hidden !important;
    }

    .carousel-item.active .carousel-scene #hero-carousel .hero-product-2.desktop-only,
    .carousel-item .carousel-scene .hero-product-2.desktop-only,
    .hero-product-2.desktop-only {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: absolute !important;
        top: 25% !important;
        right: 15% !important;
        left: auto !important;
        bottom: auto !important;
        transform: translate(50%, -50%) !important;
        z-index: 100 !important;
        width: auto !important;
        height: auto !important;
        overflow: hidden !important;
    }

    .carousel-item.active .carousel-scene #hero-carousel .hero-product-3.desktop-only,
    .carousel-item .carousel-scene .hero-product-3.desktop-only,
    .hero-product-3.desktop-only {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
        z-index: 110 !important;
        width: auto !important;
        height: auto !important;
        overflow: hidden !important;
    }

    .carousel-item.active .carousel-scene #hero-carousel .hero-product-4.desktop-only,
    .carousel-item .carousel-scene .hero-product-4.desktop-only,
    .hero-product-4.desktop-only {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: absolute !important;
        bottom: 25% !important;
        left: 15% !important;
        right: auto !important;
        top: auto !important;
        transform: translate(-50%, 50%) !important;
        z-index: 100 !important;
        width: auto !important;
        height: auto !important;
        overflow: hidden !important;
    }

    .carousel-item.active .carousel-scene #hero-carousel .hero-product-5.desktop-only,
    .carousel-item .carousel-scene .hero-product-5.desktop-only,
    .hero-product-5.desktop-only {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: absolute !important;
        bottom: 25% !important;
        right: 15% !important;
        left: auto !important;
        top: auto !important;
        transform: translate(50%, 50%) !important;
        z-index: 100 !important;
        width: auto !important;
        height: auto !important;
        overflow: hidden !important;
    }

    /* Desktop images: contain, no filter, original size */
    #heroCarousel .carousel-item.active .carousel-scene .hero-product-1.desktop-only .hero-img,
    #heroCarousel .carousel-item .carousel-scene .hero-product-1.desktop-only .hero-img,
    #heroCarousel .hero-product-1.desktop-only .hero-img {
        width: 280px !important;
        height: 280px !important;
        object-fit: contain !important;
        background: transparent !important;
        filter: none !important;
    }

    #heroCarousel .carousel-item.active .carousel-scene .hero-product-2.desktop-only .hero-img,
    #heroCarousel .carousel-item .carousel-scene .hero-product-2.desktop-only .hero-img,
    #heroCarousel .hero-product-2.desktop-only .hero-img {
        width: 280px !important;
        height: 280px !important;
        object-fit: contain !important;
        background: transparent !important;
        filter: none !important;
    }

    #heroCarousel .carousel-item.active .carousel-scene .hero-product-3.desktop-only .hero-img,
    #heroCarousel .carousel-item .carousel-scene .hero-product-3.desktop-only .hero-img,
    #heroCarousel .hero-product-3.desktop-only .hero-img {
        width: 400px !important;
        height: 400px !important;
        object-fit: contain !important;
        background: transparent !important;
        filter: none !important;
    }

    #heroCarousel .carousel-item.active .carousel-scene .hero-product-4.desktop-only .hero-img,
    #heroCarousel .carousel-item .carousel-scene .hero-product-4.desktop-only .hero-img,
    #heroCarousel .hero-product-4.desktop-only .hero-img {
        width: 280px !important;
        height: 280px !important;
        object-fit: contain !important;
        background: transparent !important;
        filter: none !important;
    }

    #heroCarousel .carousel-item.active .carousel-scene .hero-product-5.desktop-only .hero-img,
    #heroCarousel .carousel-item .carousel-scene .hero-product-5.desktop-only .hero-img,
    #heroCarousel .hero-product-5.desktop-only .hero-img {
        width: 280px !important;
        height: 280px !important;
        object-fit: contain !important;
        background: transparent !important;
        filter: none !important;
    }

    /* Carousel title styling for desktop */
    .carousel-main-title {
        font-size: 2rem !important;
        text-align: center !important;
        color: white !important;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5) !important;
        position: absolute !important;
        top: 15px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 1000 !important;
        padding: 0 20px !important;
    }
}

/* Small screens (max-width: 768px) - Show only mobile-only images, hide all desktop */
@media (max-width: 768px) {
    /* CRITICAL: Blue gradient background - pure color, no effects */
    #heroCarousel {
        background: linear-gradient(135deg, #0d2b5f 0%, #1946AB 50%, #3366CC 100%) !important;
        position: relative !important;
        overflow: visible !important;
    }

    /* CRITICAL: Override carousel-item height for mobile */
    .carousel-item,
    #heroCarousel .carousel-item {
        height: 55vh !important;
        min-height: 55vh !important;
        max-height: 55vh !important;
        background: transparent !important;
    }

    /* HIDE ALL DESKTOP ELEMENTS */
    .carousel-item .carousel-scene .hero-product-1:not(.mobile-only),
    .carousel-item .carousel-scene .hero-product-2:not(.mobile-only),
    .carousel-item .carousel-scene .hero-product-3:not(.mobile-only),
    .carousel-item .carousel-scene .hero-product-4:not(.mobile-only),
    .carousel-item .carousel-scene .hero-product-5:not(.mobile-only),
    .carousel-item .carousel-scene .hero-product.desktop-only,
    .carousel-item .carousel-scene .desktop-only,
    .hero-product.desktop-only,
    .hero-product-1:not(.mobile-only),
    .hero-product-2:not(.mobile-only),
    .hero-product-3:not(.mobile-only),
    .hero-product-4:not(.mobile-only),
    .hero-product-5:not(.mobile-only) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    /* SHOW ONLY MOBILE-ONLY - full screen centered */
    .carousel-item .carousel-scene .hero-product.mobile-only,
    .hero-product.mobile-only {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        text-align: center !important;
        margin: 0 !important;
        width: 95vw !important;
        height: auto !important;
        z-index: 100 !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Mobile images - centered, large, cover */
    .carousel-item .carousel-scene .hero-product.mobile-only .hero-img {
        width: 95vw !important;
        height: auto !important;
        max-width: 700px !important;
        object-fit: contain !important;
        object-position: center !important;
        filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.25)) !important;
        display: block !important;
        margin: 0 auto !important;
    }

    /* Title overlay - Option 3: Text with ribbon border */
    .carousel-main-title {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        text-align: center !important;
        color: white !important;
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8) !important;
        position: absolute !important;
        top: 8px !important;
        left: 0 !important;
        right: auto !important;
        transform: none !important;
        z-index: 1000002 !important;
        background: rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(4px) !important;
        padding: 8px 16px 8px 20px !important;
        border: 2px solid rgba(255, 255, 255, 0.9) !important;
        border-radius: 10px !important;
        white-space: normal !important;
        line-height: 1.3 !important;
        display: inline-block !important;
    }

    /* Caption below image */
    .carousel-item .carousel-scene .hero-product.mobile-only .hero-caption {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        background: linear-gradient(135deg, rgba(10, 22, 40, 0.9) 0%, rgba(26, 54, 93, 0.9) 100%) !important;
        border: none !important;
        border-radius: 12px !important;
        padding: 8px 20px !important;
        margin: 0 auto !important;
        margin-top: -16px !important;
        color: white !important;
        font-size: 0.9rem !important;
        font-weight: 700 !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
        white-space: nowrap !important;
        width: auto !important;
        text-align: center !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
        z-index: 100 !important;
    }

    /* Carousel indicators */
    #heroCarousel .carousel-indicators {
        bottom: 20px !important;
        z-index: 1000002 !important;
        background: rgba(0, 0, 0, 0.3) !important;
        backdrop-filter: blur(4px) !important;
        padding: 8px 16px !important;
        border-radius: 20px !important;
    }

    #heroCarousel .carousel-indicators button {
        width: 10px !important;
        height: 10px !important;
        border-radius: 50% !important;
        background-color: rgba(255, 255, 255, 0.5) !important;
        border: 2px solid rgba(255, 255, 255, 0.8) !important;
        margin: 0 5px !important;
        transition: all 0.3s ease !important;
    }

    #heroCarousel .carousel-indicators button.active {
        background-color: #FFD700 !important;
        border-color: #FFD700 !important;
        transform: scale(1.2) !important;
    }
}

/* Extra small screens (max-width: 480px) */
@media (max-width: 480px) {
    .carousel-item,
    #heroCarousel .carousel-item {
        height: 50vh !important;
        min-height: 50vh !important;
        max-height: 50vh !important;
    }

    .carousel-item .carousel-scene .hero-product.mobile-only .hero-img {
        width: 95vw !important;
        height: auto !important;
        max-width: 650px !important;
    }

    .carousel-item .carousel-scene .hero-product.mobile-only,
    .hero-product.mobile-only {
        width: 95vw !important;
        height: auto !important;
    }

    .carousel-main-title {
        font-size: 0.9rem !important;
        padding: 6px 12px 6px 16px !important;
    }

    .carousel-item .carousel-scene .hero-product.mobile-only .hero-caption {
        font-size: 0.8rem !important;
        padding: 5px 14px !important;
        margin-top: -12px !important;
    }

    #heroCarousel .carousel-indicators {
        bottom: 8px !important;
    }
}

/* Very small screens (max-width: 360px) */
@media (max-width: 360px) {
    .carousel-item,
    #heroCarousel .carousel-item {
        height: 45vh !important;
        min-height: 45vh !important;
        max-height: 45vh !important;
    }

    .carousel-item .carousel-scene .hero-product.mobile-only .hero-img {
        width: 95vw !important;
        height: auto !important;
        max-width: 520px !important;
    }

    .carousel-item .carousel-scene .hero-product.mobile-only,
    .hero-product.mobile-only {
        width: 95vw !important;
        height: auto !important;
    }

    .carousel-main-title {
        font-size: 0.8rem !important;
        padding: 5px 10px 5px 14px !important;
    }

    .carousel-item .carousel-scene .hero-product.mobile-only .hero-caption {
        font-size: 0.7rem !important;
        padding: 4px 12px !important;
        margin-top: -10px !important;
    }

    #heroCarousel .carousel-indicators {
        bottom: 6px !important;
    }
}