/**
 * Feature: Mobile Booking Form Styles (Refined Luxury Card Dropdowns)
 *
 * @package Avada_Child
 */

/* ==========================================================================
   CSS Variables & Typography
   ========================================================================== */
.search-wrapper-mobile,
.modal-search-wrapper {
    --mb-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-family: var(--mb-font-sans);
    box-sizing: border-box;
}

.search-wrapper-mobile *,
.modal-search-wrapper * {
    box-sizing: border-box;
}

/* ==========================================================================
   1. Trigger Capsule Button (Visible on page)
   ========================================================================== */
.search-wrapper-mobile {
    width: 100%;
    margin: 10px 0;
}

.search-content {
    display: flex;
    align-items: center;
    height: 52px;
    width: 100%;
    border-radius: 100px;
    background: #F6F6F6;
    padding: 0 6px 0 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.search-content:active {
    transform: scale(0.985);
}

.search-content h6 {
    color: #1A1A1A;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: normal;
}

.search-icon-circle {
    display: flex;
    margin-left: auto;
    height: 40px;
    width: 40px;
    background: linear-gradient(180deg, #F55E14 0%, #C04001 100%);
    border-radius: 100px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(245, 94, 20, 0.3);
}

/* ==========================================================================
   2. Full-Screen Modal Overlay & Content
   ========================================================================== */
.modal-search-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-search-wrapper.is-active {
    display: flex;
    opacity: 1;
}

@media (max-width: 480px) {
    .modal-search-wrapper {
        align-items: stretch;
    }
}

.modal-search-content {
    background-color: #F9FAFB;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    max-width: 480px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-search-wrapper.is-active .modal-search-content {
    transform: translateY(0);
}

@media (min-width: 481px) {
    .modal-search-content {
        height: 92vh;
        max-height: 780px;
        border-radius: 20px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    }
}

.mb-form-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* ==========================================================================
   3. Modal Header
   ========================================================================== */
.modal-search-header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 56px;
    padding: 0 16px;
    background: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
    z-index: 10;
    flex-shrink: 0;
}

.modal-search-header h5 {
    color: #111827;
    font-size: 17px !important;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.2px;
}

.modal-close {
    position: absolute;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.modal-close:active {
    background: #E5E7EB;
    transform: scale(0.92);
}

/* ==========================================================================
   4. Modal Body & Container
   ========================================================================== */
.modal-search-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
}

.mb-card-field {
    margin-bottom: 14px;
}

/* ==========================================================================
   5. Custom Dropdown & Luxury Card Design
   ========================================================================== */
.mb-dropdown-container {
    position: relative;
    width: 100%;
}

.mb-select-card {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 64px;
    background: #FFFFFF;
    border: 1.5px solid #E5E7EB;
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}

.mb-select-card:hover,
.mb-select-card.is-open {
    border-color: #F55E14;
    box-shadow: 0 0 0 3.5px rgba(245, 94, 20, 0.12);
}

.mb-select-visual {
    display: flex;
    align-items: center;
    width: 100%;
    pointer-events: none;
}

.mb-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 12px;
}

.mb-icon-badge.pickup-badge,
.mb-icon-badge.date-badge {
    background: rgba(245, 94, 20, 0.09);
}

.mb-icon-badge.dropoff-badge,
.mb-icon-badge.promo-badge {
    background: #F3F4F6;
}

.mb-select-text-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.mb-select-caption {
    font-size: 10px;
    font-weight: 700;
    color: #6B7280;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.mb-select-val {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mb-select-val.is-placeholder {
    font-weight: 500;
    color: #9CA3AF;
}

.mb-chevron-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F3F4F6;
    flex-shrink: 0;
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.mb-select-card.is-open .mb-chevron-badge {
    transform: rotate(180deg);
}

/* Custom Dropdown Menu Panel */
@keyframes mbMenuSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mb-custom-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: #FFFFFF;
    border: 1.5px solid #F55E14;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 6px;
    z-index: 50;
    overflow: hidden;
    animation: mbMenuSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mb-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.mb-item-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.mb-item-label {
    font-size: 15px;
    font-weight: 600;
    color: #1F2937;
    flex: 1;
}

.mb-item-check {
    display: none;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
}

.mb-menu-item:hover,
.mb-menu-item:active,
.mb-menu-item.is-selected {
    background: #FFF7ED;
}

.mb-menu-item.is-selected .mb-item-label {
    color: #C04001;
    font-weight: 700;
}

.mb-menu-item.is-selected .mb-item-check {
    display: flex;
}

/* Input box for promo code */
.mb-input-box {
    display: flex;
    align-items: center;
    min-height: 60px;
    background: #FFFFFF;
    border: 1.5px solid #E5E7EB;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    cursor: text;
    position: relative;
    transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}

.mb-input-box:hover,
.mb-input-box:focus-within {
    border-color: #F55E14;
    box-shadow: 0 0 0 3px rgba(245, 94, 20, 0.12);
}

.mb-input-box:focus-within .mb-icon-badge.promo-badge,
.mb-input-box.has-value .mb-icon-badge.promo-badge {
    background: rgba(245, 94, 20, 0.09);
    transition: background 0.2s ease;
}

.mb-input-box:focus-within .mb-icon-badge.promo-badge svg,
.mb-input-box.has-value .mb-icon-badge.promo-badge svg {
    stroke: #F55E14;
    transition: stroke 0.2s ease;
}

.mb-input-box .mb-select-caption {
    font-size: 9px;
    letter-spacing: 0.5px;
    margin-bottom: 1px;
}

.mb-input-box:focus-within .mb-select-caption {
    color: #C04001;
}

.mb-promo-element {
    max-height: 40px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
    outline: none;
    width: 100%;
    padding: 0;
    margin: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.mb-promo-element::placeholder {
    font-size: 13.5px;
    color: #9CA3AF;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

.mb-promo-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    margin-left: 6px;
    background: #F3F4F6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    outline: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.mb-promo-clear:hover {
    background: #E5E7EB;
}

.mb-promo-clear:active {
    transform: scale(0.9);
}

.mb-promo-clear svg {
    display: block;
    pointer-events: none;
}

/* ==========================================================================
   6. Travel Dates Dual-Card UI
   ========================================================================== */
.mb-dates-container {
    display: flex;
    align-items: center;
    min-height: 64px;
    background: #FFFFFF;
    border: 1.5px solid #E5E7EB;
    border-radius: 14px;
    padding: 10px 14px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mb-dates-container:hover,
.mb-dates-container.is-focused {
    border-color: #F55E14;
    box-shadow: 0 0 0 3.5px rgba(245, 94, 20, 0.12);
}

.mb-dates-content {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    margin: 0;
}

.mb-date-card {
    flex: 1 1 0;
    min-width: 0;
    max-width: 130px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.mb-date-card.is-active .mb-select-caption {
    color: #C04001;
    font-weight: 800;
}

.mb-date-divider {
    display: flex;
    flex: 0 0 60px;
    margin-right: 20px;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    flex-shrink: 0;
}

@media (max-width: 390px) {
    .mb-date-divider {
        padding: 0 6px;
    }
    .mb-icon-badge.date-badge {
        margin-right: 8px;
        width: 40px;
        height: 40px;
    }
    .mb-select-caption {
        font-size: 9px;
    }
    .mb-select-val,
    .mb-promo-element {
        font-size: 13.5px;
    }
}

/* Visually hidden Flatpickr input */
.mb-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   7. Sticky Bottom Action Bar & Validation
   ========================================================================== */
.modal-search-footer {
    width: 100%;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #FFFFFF;
    border-top: 1px solid #E5E7EB;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
    z-index: 20;
    flex-shrink: 0;
}

.apply-step-btn {
    width: 100%;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(180deg, #F55E14 0%, #C04001 100%);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(245, 94, 20, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.apply-step-btn:active {
    transform: scale(0.985);
    box-shadow: 0 2px 8px rgba(245, 94, 20, 0.25);
}

/* Validation shake animation & Toast */
@keyframes mbShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.mb-shake {
    animation: mbShake 0.4s ease-in-out;
}

.mb-error-border {
    border-color: #E53935 !important;
    box-shadow: 0 0 0 3.5px rgba(229, 57, 53, 0.15) !important;
}

.mb-error-toast {
    margin-top: 12px;
    padding: 10px 14px;
    background: #FFEBEE;
    color: #D32F2F;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #FFCDD2;
}

/* ==========================================================================
   8. Flatpickr Theme Overrides & Responsive Protection
   ========================================================================== */
#field_dates_group {
    position: relative;
}

#field_dates_group .flatpickr-calendar {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    width: 320px !important;
    max-width: calc(100vw - 32px) !important;
    background: #FFFFFF !important;
    border: 1.5px solid #F55E14 !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16) !important;
    z-index: 100 !important;
    overflow: hidden !important;
}

/* Header & Month Navigation */
#field_dates_group .flatpickr-months {
    position: relative;
    height: 48px;
    background: #FFFFFF;
    border-bottom: 1px solid #F3F4F6;
    display: block;
    text-align: center;
}

#field_dates_group .flatpickr-month {
    position: relative;
    height: 48px;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 46px;
    overflow: hidden;
}

#field_dates_group .flatpickr-current-month {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    position: static;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: auto;
    left: auto;
    transform: none;
}

#field_dates_group .flatpickr-current-month .cur-month {
    font-weight: 700;
    color: #111827;
}

#field_dates_group .flatpickr-current-month .cur-year {
    font-weight: 700;
    color: #4B5563;
}

#field_dates_group .flatpickr-prev-month,
#field_dates_group .flatpickr-next-month {
    position: absolute;
    top: 7px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    pointer-events: auto;
    transition: background 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

#field_dates_group .flatpickr-prev-month:hover,
#field_dates_group .flatpickr-next-month:hover {
    background: #FFEAD9;
}

#field_dates_group .flatpickr-prev-month:active,
#field_dates_group .flatpickr-next-month:active {
    transform: scale(0.92);
}

#field_dates_group .flatpickr-prev-month {
    left: 8px;
}

#field_dates_group .flatpickr-next-month {
    right: 8px;
}

#field_dates_group .flatpickr-prev-month svg,
#field_dates_group .flatpickr-next-month svg {
    width: 14px;
    height: 14px;
    fill: #F55E14;
    pointer-events: none;
}

/* Weekday header */
#field_dates_group span.flatpickr-weekday {
    color: #6B7280;
    font-weight: 600;
    font-size: 12px;
}

/* Days container */
#field_dates_group .flatpickr-day {
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    margin-top: 2px;
}

#field_dates_group .flatpickr-day.selected,
#field_dates_group .flatpickr-day.startRange,
#field_dates_group .flatpickr-day.endRange {
    background: #F55E14 !important;
    border-color: #F55E14 !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
}

#field_dates_group .flatpickr-day.inRange {
    background: rgba(245, 94, 20, 0.14) !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: #C04001 !important;
}

#field_dates_group .flatpickr-day.flatpickr-disabled,
#field_dates_group .flatpickr-day.flatpickr-disabled:hover,
#field_dates_group .flatpickr-day.mb-sunday-disabled,
#field_dates_group .flatpickr-day.mb-sunday-disabled:hover {
    color: #D1D5DB !important;
    cursor: not-allowed !important;
    opacity: 0.45;
}

#field_dates_group .flatpickr-day.mb-sunday-disabled.inRange {
    background: rgba(245, 94, 20, 0.14) !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: #C04001 !important;
    opacity: 0.8 !important;
}
