/* ============================================================
   Hero Slider / Banner Fix
   
   KEY INSIGHT: Owl Carousel measures item heights AFTER JS runs.
   If .bg-image is position:absolute, it has 0 intrinsic height
   → Owl collapses the stage to 0px → banner disappears after JS.
   
   FIX: Keep .bg-image as a normal block element with height:100%.
   .slider-bg-5 uses viewport-relative height (60vh) so it works
   inside Owl's .owl-item regardless of parent height.
   
   The inline style="background: none;" on .slider-area already
   overrides the hardcoded background-image from .slider-bg-5.
   The inline style="background-image: url(...)" on .bg-image
   sets the actual slide image. We must NOT override these.
   ============================================================ */

/* 1. Section wrapper */
.slider-section {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-top: 100px;
    padding: 0;
    height: 520px;
    /* Fixed banner height on desktop */
    max-height: 100vh;
}

/* 2. CRITICAL FIX: Override the 84vh height from frontend.css
      to a sensible size. Keep it viewport-relative so it works
      inside Owl Carousel's .owl-item (which has no explicit height).
      Do NOT set background-image here — inline styles handle it. */
.slider-bg-5 {
    height: 520px !important;
    min-height: 400px !important;
    max-height: 520px !important;
    /* Preserve background handling – do not set background-image */
}

/* 3. Slider area base */
.slider-area {
    position: relative;
    width: 100%;
    overflow: hidden;
    height: 100%;
    /* Ensure it fills the parent height */
}

/* Ensure Owl Carousel items inherit the banner height */
#slider-item .owl-item,
#slider-item .owl-stage {
    height: 520px !important;
    min-height: 400px !important;
}

.slider-area {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* 4. bg-image: KEEP AS NORMAL BLOCK (not absolute!)
      so Owl Carousel can measure its height.
      Owl measures the item, finds 60vh → sets stage height correctly.
      If we make it position:absolute, Owl sees 0 height → collapses. */
.bg-image {
    width: 100% !important;
    height: 100% !important;
    min-height: 400px !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    display: block !important;
}

/* 5. The <a> tag wrapping bg-image must also stretch */
.slider-area>a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

/* 6. Slider text overlay on top of the image */
.slider-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    text-align: center;
    width: 90%;
    max-width: 1170px;
}

.slider-text h2 span {
    color: #ffffff;
    font-size: 38px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.slider-text .subtitle {
    color: #ffffff;
    font-size: 18px;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* 7. Owl Carousel — make stage-outer clip properly */
#slider-item .owl-stage-outer {
    overflow: hidden;
}

/* Ensure Owl stage matches banner height */
#slider-item .owl-stage-outer,
#slider-item .owl-stage {
    height: 520px !important;
    min-height: 400px !important;
}

/* 9. Owl Dots */
#slider-item .owl-dots {
    position: absolute !important;
    bottom: 20px !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
}

#slider-item .owl-dots .owl-dot {
    width: 12px !important;
    height: 12px !important;
    background: rgba(255, 255, 255, 0.6) !important;
    border-radius: 50% !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
}

#slider-item .owl-dots .owl-dot span {
    display: none !important;
}

#slider-item .owl-dots .owl-dot.active {
    width: 32px !important;
    border-radius: 6px !important;
    background: #D92635 !important;
}

/* 9. Owl Nav Arrows */
#slider-item .owl-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    padding: 0 20px !important;
    pointer-events: none !important;
    z-index: 10 !important;
    margin: 0 !important;
}

#slider-item .owl-nav .owl-prev,
#slider-item .owl-nav .owl-next {
    pointer-events: auto !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.45) !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    transition: background 0.3s ease !important;
    border: none !important;
    outline: none !important;
}

#slider-item .owl-nav .owl-prev:hover,
#slider-item .owl-nav .owl-next:hover {
    background: #D92635 !important;
}

/* ============================================================
   Responsive
   ============================================================ */

/* Maintain full banner height & full background image cover fill on all responsive viewports */
@media screen and (max-width: 991px) {
    .slider-section {
        margin-top: 70px !important;
        height: 520px !important;
        min-height: 480px !important;
        max-height: 520px !important;
    }

    #slider-item .owl-stage-outer,
    #slider-item .owl-stage,
    #slider-item .owl-item,
    .slider-area,
    .slider-bg-5,
    .slider-area > a,
    .bg-image {
        height: 520px !important;
        min-height: 480px !important;
        max-height: 520px !important;
    }

    .bg-image {
        width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
    }
}

/* Mobile */
@media screen and (max-width: 767px) {
    .slider-section {
        margin-top: 70px !important;
        height: 500px !important;
        min-height: 450px !important;
        max-height: 500px !important;
    }

    #slider-item .owl-stage-outer,
    #slider-item .owl-stage,
    #slider-item .owl-item,
    .slider-area,
    .slider-bg-5,
    .slider-area > a,
    .bg-image {
        height: 500px !important;
        min-height: 450px !important;
        max-height: 500px !important;
    }

    .bg-image {
        width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
    }

    #slider-item .owl-nav {
        padding: 0 10px !important;
    }

    #slider-item .owl-nav .owl-prev,
    #slider-item .owl-nav .owl-next {
        width: 36px !important;
        height: 36px !important;
        font-size: 15px !important;
    }

    .slider-text h2 span {
        font-size: 24px;
    }

    .slider-text .subtitle {
        font-size: 14px;
        letter-spacing: 1px;
    }
}

/* Small Mobile */
@media screen and (max-width: 479px) {
    .slider-section {
        margin-top: 70px !important;
        height: 460px !important;
        min-height: 420px !important;
        max-height: 460px !important;
    }

    #slider-item .owl-stage-outer,
    #slider-item .owl-stage,
    #slider-item .owl-item,
    .slider-area,
    .slider-bg-5,
    .slider-area > a,
    .bg-image {
        height: 460px !important;
        min-height: 420px !important;
        max-height: 460px !important;
    }

    .bg-image {
        width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
    }

    .slider-text h2 span {
        font-size: 20px;
    }
}