/*
 * NYALA P03 EXPERIENCE SEARCH V1.0
 *
 * Reuses Global Experience Search visual system.
 * Scope: Single Experience P03.
 */

/* Desktop & Tablet */

@media (min-width: 768px) {

    body.nyala-p03-active
    .nyala-experience-search__desktop--section {
        position: relative;

        right: auto;
        bottom: auto;
        left: auto;

        width: 100%;

        margin: 0;
        padding: 28px 24px;

        background: #f7f5ef;

        z-index: 10;

        pointer-events: auto;
    }

    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__desktop-inner {
        width: min(1180px, 100%);
        margin-inline: auto;
    }
}

/* Tablet */

@media (min-width: 768px) and (max-width: 1023px) {

    body.nyala-p03-active
    .nyala-experience-search__desktop--section {
        padding: 22px 20px;
    }
}

/* Mobile */

@media (max-width: 767px) {

    /*
     * Keep existing mobile search component.
     * Place above the approved investment panel.
     */

    body.nyala-p03-active
    .nyala-experience-search__mobile-trigger {
        position: fixed !important;

        right: 16px !important;
        left: auto !important;

        bottom: calc(
            112px + env(safe-area-inset-bottom)
        ) !important;

        z-index: 950 !important;
    }

    /*
     * Search modal must be above
     * the mobile investment bottom panel.
     */

    body.nyala-p03-active
    .nyala-experience-search__modal:not([hidden]) {
        z-index: 10020 !important;
    }
}

/* Small Mobile */

@media (max-width: 359px) {

    body.nyala-p03-active
    .nyala-experience-search__mobile-trigger {
        right: 10px !important;
        bottom: calc(
            108px + env(safe-area-inset-bottom)
        ) !important;
    }
}

/* =========================================================
   NYALA P03 — HOME SEARCH VISUAL MATCH V1.1

   Floating dock overlapping the bottom of Hero.
   Scope: Single Experience P03 only.
   ========================================================= */

@media (min-width: 768px) {

    /*
     * Make the P03 Hero the visual anchor.
     */
    body.nyala-p03-active
    .nyala-p03__hero {
        position: relative;
    }

    /*
     * Pull search section upward to overlap Hero.
     * Preserve natural document flow.
     */
    body.nyala-p03-active
    .nyala-experience-search__desktop--section {
        position: relative !important;

        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;

        width: 100% !important;

        margin: -86px 0 0 !important;
        padding: 0 24px 42px !important;

        background: transparent !important;

        z-index: 20 !important;

        pointer-events: none;
    }

    /*
     * Unified premium floating panel.
     */
    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__desktop-inner {
        display: grid !important;

        grid-template-columns:
            320px minmax(0, 1fr) !important;

        gap: 0 !important;

        width: min(1536px, 100%) !important;
        min-height: 172px !important;

        margin: 0 auto !important;
        padding: 0 !important;

        overflow: hidden;

        border: 1px solid rgba(255,255,255,.4);
        border-radius: 26px !important;

        background: #eef1f4 !important;

        box-shadow:
            0 26px 55px rgba(23,37,57,.18),
            0 8px 20px rgba(23,37,57,.06) !important;

        pointer-events: auto;
    }

    /*
     * Navy heading panel.
     */
    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__heading {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: center !important;

        gap: 13px !important;

        padding: 28px 32px !important;

        background: linear-gradient(
            145deg,
            #22364c 0%,
            #172539 100%
        ) !important;
    }

    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__heading > span {
        color: #F3CD56 !important;

        font-size: 12px !important;
        font-weight: 800 !important;
        letter-spacing: .17em !important;
    }

    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__heading > strong {
        max-width: 220px !important;

        color: #fff !important;

        font-size: clamp(25px, 2.3vw, 36px) !important;
        line-height: 1.08 !important;
        letter-spacing: -.045em !important;
    }

    /*
     * Filter fields and search button.
     */
    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__form {
        display: grid !important;

        grid-template-columns:
            repeat(4, minmax(0, 1fr))
            minmax(110px, .6fr) !important;

        gap: 14px !important;
        align-items: end !important;

        padding: 32px 26px !important;

        background: #eef1f4 !important;
    }

    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__field select {
        width: 100% !important;
        min-height: 62px !important;

        border-radius: 14px !important;
        background-color: #fff !important;
    }

    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__submit {
        min-height: 62px !important;
        border-radius: 14px !important;
        background: #DD403A !important;
        color: #fff !important;
    }
}

/* Tablet: preserve usable form width. */

@media (min-width: 768px) and (max-width: 1100px) {

    body.nyala-p03-active
    .nyala-experience-search__desktop--section {
        margin-top: -60px !important;
        padding-inline: 20px !important;
    }

    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__desktop-inner {
        grid-template-columns: 1fr !important;
        min-height: 0 !important;
    }

    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__heading {
        padding: 18px 24px !important;
    }

    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__heading > strong {
        max-width: none !important;
        font-size: 24px !important;
    }

    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__form {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        padding: 22px !important;
    }

    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__submit {
        grid-column: 1 / -1;
    }
}

/* Mobile: keep approved floating search behavior. */

@media (max-width: 767px) {

    body.nyala-p03-active
    .nyala-experience-search__desktop--section {
        display: none !important;
    }
}


/* =========================================================
   NYALA P03 EXPERIENCE SEARCH — POSITION CORRECTION V1.2
   Reference: Homepage Experience Search
   ========================================================= */

@media (min-width: 1101px) {

    body.nyala-p03-active
    .nyala-experience-search__desktop--section {
        width: 100% !important;

        margin-top: -86px !important;
        margin-bottom: 0 !important;

        padding:
            0
            clamp(24px, 12.5vw, 256px)
            42px !important;

        background: transparent !important;
    }

    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__desktop-inner {
        width: 100% !important;
        max-width: 1536px !important;

        min-height: 172px !important;

        grid-template-columns:
            320px minmax(0, 1fr) !important;

        border-radius: 26px !important;
    }

    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__form {
        padding: 28px 24px !important;
        gap: 12px !important;
    }
}

@media (min-width: 768px) and (max-width: 1100px) {

    body.nyala-p03-active
    .nyala-experience-search__desktop--section {
        margin-top: -65px !important;
        padding:
            0 24px 36px !important;
    }

    body.nyala-p03-active
    .nyala-experience-search__desktop--section
    .nyala-experience-search__desktop-inner {
        max-width: 100% !important;
    }
}


/* =========================================================
   NYALA P03 SEARCH — EXACT 50:50 OVERLAP V1.3
   ========================================================= */

@media (min-width: 768px) {

    body.nyala-p03-active
    .nyala-experience-search__desktop--section {

        position: relative !important;

        top: auto !important;
        bottom: auto !important;

        /*
         * Dynamic value from actual panel height.
         */
        margin-top:
            calc(
                -1 * var(
                    --nyala-search-overlap,
                    86px
                )
            ) !important;

        /*
         * Prevent panel from covering content
         * in the next section.
         */
        margin-bottom: 0 !important;

        z-index: 20 !important;
    }
}

/* Mobile unchanged */

@media (max-width: 767px) {

    body.nyala-p03-active
    .nyala-experience-search__desktop--section {
        display: none !important;
    }
}


/* NYALA P03 SEARCH POSITION V1.4 */

@media (min-width: 768px) {
    body.nyala-p03-active
    .nyala-experience-search__desktop--section {
        margin-top: 0 !important;
        transform: none;
        will-change: transform;
    }
}


/* =====================================================
   NYALA P03 — HERO CTA SPACING V1.0

   Add breathing room between Hero CTA and
   Experience Search without moving the filter.
   ===================================================== */

@media (min-width: 768px) {

    body.nyala-p03-active
    .nyala-p03__hero-content {
        padding-bottom: 24px !important;
    }

}

