/* Bahar-e-Haram — mobile layout & hero fixes */

html,
body.bhe-site,
.bhe-site,
.bhe-site main,
.bhe-site #main-content {
    overflow-x: clip;
    max-width: 100%;
}

@supports not (overflow: clip) {
    html,
    body.bhe-site {
        overflow-x: hidden;
    }
}

.bhe-site img,
.bhe-site video,
.bhe-site iframe {
    max-width: 100%;
}

/* Homepage hero — mobile: no 3D zoom, wider framing */
@media (max-width: 991px) {
    .bhe-hero {
        perspective: none !important;
        transform-style: flat !important;
        min-height: clamp(400px, 64svh, 520px) !important;
        height: auto !important;
        overflow: hidden !important;
    }

    /* Kill legacy head styles that set fixed height / parallax on .hero-slider */
    .bhe-hero > .hero-slider,
    .bhe-hero .hero-slider {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        transform: none !important;
        transform-style: flat !important;
        background: none !important;
        background-image: none !important;
        background-attachment: scroll !important;
        animation: none !important;
        display: block !important;
    }

    .bhe-hero .hero-slide {
        background: #0a0806 !important;
    }

    .bhe-hero .hero-slide img {
        /* Fit width — shows more of the scene vs aggressive cover crop */
        width: 100% !important;
        height: auto !important;
        min-height: 100% !important;
        max-height: none !important;
        object-fit: cover !important;
        object-position: center top !important;
        inset: auto !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }

    .bhe-hero .hero-slide[data-theme="umrah"] img {
        object-position: center 18% !important;
    }

    .bhe-hero .hero-slide[data-theme="kashmir"] img {
        object-position: center 40% !important;
    }

    .hero-overlay,
    .hero-particles {
        transform: none !important;
        transform-style: flat !important;
    }

    .hero-particles {
        display: none !important;
    }

    .bhe-hero::before,
    .bhe-hero::after {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .bhe-hero {
        min-height: clamp(300px, 48svh, 400px) !important;
    }

    .bhe-hero .hero-slide[data-theme="umrah"] img {
        object-position: center 15% !important;
    }

    .bhe-hero .hero-slide[data-theme="kashmir"] img {
        object-position: center 35% !important;
    }

    .bhe-hero-inner {
        bottom: clamp(80px, 13vh, 120px) !important;
        width: min(94%, 820px) !important;
    }

    .bhe-hero-title {
        font-size: clamp(1.65rem, 7vw, 2.25rem) !important;
    }

    .bhe-hero-subtitle {
        font-size: 0.9rem !important;
        margin-bottom: 18px !important;
    }

    .hero-dots {
        bottom: 56px !important;
    }
}

/* Homepage Kashmir package grid (index) */
@media (max-width: 767px) {
    .package-spotlight,
    .package-spotlight .kashmir-packages-section {
        overflow-x: clip;
        max-width: 100%;
    }

    .kp-grid-wrap,
    .bhe-packages-wrap {
        width: 100%;
        max-width: 100%;
        padding-inline: clamp(10px, 3vw, 16px);
        box-sizing: border-box;
    }

    .kp-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .kp-card:hover {
        transform: none !important;
    }

    .kp-card:hover .kp-card-media img {
        transform: none !important;
    }

    .kp-actions {
        grid-template-columns: 1fr !important;
    }

    .tst-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .bhe-section-rail-inner {
        justify-content: flex-start;
        padding-inline: 12px;
    }
}

/* Inner page heroes (packages, about, etc.) */
@media (max-width: 767px) {
    .bhe-page-hero {
        min-height: clamp(220px, 36svh, 300px);
        padding: clamp(72px, 14vw, 88px) 0 clamp(24px, 5vw, 36px);
    }

    .bhe-page-hero__bg {
        transform: none !important;
        background-size: cover !important;
        background-position: center center !important;
    }

    .bhe-page-hero h1 {
        font-size: clamp(1.45rem, 6vw, 1.85rem);
    }

    .bhe-page-hero p {
        font-size: 0.95rem;
    }

    .bhe-page-hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .bhe-page-hero__actions .bhe-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* Header container on small screens */
@media (max-width: 576px) {
    .bhe-header .bhe-container {
        padding: 6px 10px;
        gap: 8px;
        border-radius: 16px;
    }

    .bhe-logo img {
        height: 36px;
    }

    .header-actions {
        gap: 6px;
    }

    .bhe-container {
        width: min(100%, 1320px);
        padding-inline: 12px;
    }
}

/* Modals — 100vw causes horizontal scroll on mobile */
@media (max-width: 767px) {
    .modal-dialog {
        margin: 0.75rem !important;
        max-width: calc(100% - 1.5rem) !important;
        width: auto !important;
    }

    .modal-dialog.modal-lg {
        max-width: calc(100% - 1.5rem) !important;
    }

    .modal-body {
        max-height: calc(100svh - 140px);
    }
}

@media (max-width: 576px) {
    .modal-dialog,
    .modal-dialog.modal-lg {
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        min-height: auto !important;
    }

    .modal-content {
        min-height: auto !important;
        border-radius: 0 !important;
    }
}

/* Contact page legacy containers */
@media (max-width: 767px) {
    .kashmir-packages-section .container,
    .kashmir-packages-section .container-fluid,
    .package-selection-section .container {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        margin-inline: auto !important;
        box-sizing: border-box !important;
    }
}
