/* ===== Flatpickr custom theme ===== */
.flatpickr-calendar {
    border-radius: 14px !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18) !important;
    border: none !important;
    font-family: inherit !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

.flatpickr-day:hover {
    background: #eff6ff !important;
    border-color: #eff6ff !important;
    color: #1e293b !important;
}

.flatpickr-months .flatpickr-month {
    background: #3b82f6 !important;
    color: #fff !important;
    border-radius: 14px 14px 0 0 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: #fff !important;
}

.flatpickr-weekday {
    color: #3b82f6 !important;
    font-weight: 700 !important;
}

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
    fill: #fff !important;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 6px !important;
}

.flatpickr-day.today {
    border-color: #3b82f6 !important;
    color: #3b82f6 !important;
    font-weight: 700 !important;
}

.flatpickr-day.today:hover {
    background: #eff6ff !important;
}

.flatpickr-input {
    cursor: pointer;
}

/* Hide native calendar icon on date input */
input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    cursor: pointer;
}

/* ===== HERO BASE ===== */
.hero-section {
    min-height: 85vh;
    display: flex;
    align-items: center;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-result-section {
    min-height: 50vh;
    display: flex;
    align-items: center;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-gradient {
    background: linear-gradient(135deg,
            rgba(15, 23, 42, 0.78) 0%,
            rgba(15, 23, 42, 0.58) 50%,
            rgba(15, 23, 42, 0.42) 100%);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: clamp(1.9rem, 4.5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* ===== BOOKING TABS ===== */
.hero-booking-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 20px;
    /* overflow:hidden dihapus agar passenger dropdown tidak terpotong */
    width: 100%;
}

.hero-tabs-nav {
    display: flex;
    background: rgba(0, 0, 0, 0.18);
    padding: 6px 6px 0;
    gap: 4px;
    border-radius: 20px 20px 0 0;
}

.hero-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 10px 10px 0 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.hero-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.hero-tab-btn.active {
    background: rgba(255, 255, 255, 0.96);
    color: #1e293b;
}

.hero-tab-btn.active svg {
    stroke: #3b82f6;
}

.hero-tab-content {
    display: none;
    padding: 16px;
    /* overflow visible agar passenger dropdown tidak terpotong */
    overflow: visible;
}

.hero-tab-content.active {
    display: block;
}

/* ===== HERO DEFAULT LAYER FIX ===== */
.hero-default-shell {
    position: relative;
    z-index: 120;
    isolation: isolate;
    overflow: visible !important;
}

.hero-default-shell .container,
.hero-default-shell .grid,
.hero-default-shell .hero-booking-box,
.hero-default-shell .hero-tab-content,
.hero-default-shell .fb-boat-row,
.hero-default-shell .fb-field,
.hero-default-shell .fb-field-icon,
.hero-default-shell .fb-combo-wrap,
.hero-default-shell .fb-pax-wrap {
    overflow: visible !important;
}

/* Samakan radius field From/To agar konsisten dengan style hero terbaru */
.hero-default-shell .fb-combo-wrap,
.hero-default-shell .fb-combo-input {
    border-radius: 12px !important;
}

.hero-default-shell .fb-combo-input {
    height: 48px;
}

.hero-default-shell .fb-combo-dropdown {
    z-index: 3200 !important;
}

.hero-default-shell .fb-pax-dropdown {
    z-index: 3300 !important;
}

.flatpickr-calendar {
    z-index: 3400 !important;
}

/* ===== TOUR SEARCH FORM ===== */
.hero-search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hero-search-input {
    flex: 1;
    min-width: 180px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 10px;
    padding: 14px 16px 14px 44px;
    font-size: 0.95rem;
    color: #1e293b;
    outline: none;
    height: 50px;
}

.hero-search-input::placeholder {
    color: #94a3b8;
}

.hero-search-icon-abs {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* ===== SHARED FORM FIELD ===== */
.fb-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fb-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding-left: 2px;
}

.fb-control {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 10px;
    padding: 0 14px;
    height: 48px;
    font-size: 0.88rem;
    color: #1e293b;
    outline: none;
    width: 100%;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.fb-control::placeholder {
    color: #94a3b8;
}

.fb-control:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.fb-select-wrap {
    position: relative;
}

.fb-select-wrap::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #64748b;
    pointer-events: none;
}

/* ===== ICON INSIDE FIELD ===== */
.fb-field-icon {
    position: relative;
}

.fb-field-icon .fb-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 2;
    display: flex;
    align-items: center;
}

.fb-field-icon .fb-control,
.fb-field-icon input {
    padding-left: 38px !important;
}

/* ===== COMBOBOX (searchable From/To) ===== */
.fb-combo-wrap {
    position: relative;
}

.fb-combo-input {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 10px;
    padding: 0 32px 0 38px;
    height: 48px;
    font-size: 0.88rem;
    color: #1e293b;
    outline: none;
    width: 100%;
    cursor: text;
}

.fb-combo-input::placeholder {
    color: #94a3b8;
}

.fb-combo-input:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.fb-combo-arrow {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #64748b;
}

.fb-combo-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    z-index: 9998;
    display: none;
    max-height: 220px;
    overflow-y: auto;
}

.fb-combo-dropdown.open {
    display: block;
}

.fb-combo-option {
    padding: 10px 14px;
    font-size: 0.88rem;
    color: #1e293b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.12s;
}

.fb-combo-option:hover,
.fb-combo-option.focused {
    background: #eff6ff;
    color: #3b82f6;
}

.fb-combo-option:first-child {
    border-radius: 12px 12px 0 0;
}

.fb-combo-option:last-child {
    border-radius: 0 0 12px 12px;
}

.fb-combo-empty {
    padding: 12px 14px;
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
}

/* Flatpickr input inside fb-field-icon */
.fb-field-icon .flatpickr-input {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 10px;
    padding: 0 14px 0 38px;
    height: 48px;
    font-size: 0.88rem;
    color: #1e293b;
    outline: none;
    width: 100%;
    cursor: pointer;
}

.fb-field-icon .flatpickr-input:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.fb-field-icon .flatpickr-input::placeholder {
    color: #94a3b8;
}

.fb-return-input {
    padding-right: 40px !important;
}

.fb-date-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 14px;
    z-index: 3;
}

.fb-date-clear.show {
    display: inline-flex;
}

.fb-date-clear:hover {
    background: #cbd5e1;
}

/* ===== PASSENGER DROPDOWN ===== */
.fb-pax-wrap {
    position: relative;
}

.fb-pax-trigger {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 10px;
    padding: 0 14px;
    height: 48px;
    font-size: 0.88rem;
    color: #1e293b;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    user-select: none;
}

.fb-pax-text-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.fb-pax-label-mobile {
    display: inline;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fb-pax-label-desktop {
    display: none;
    font-weight: 700;
    min-width: 12px;
}

.fb-pax-trigger:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.fb-pax-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    padding: 12px 14px;
    z-index: 9999;
    display: none;
    min-width: 240px;
    /* Pastikan tidak terpotong container apapun */
    right: auto;
}

.fb-pax-dropdown.open {
    display: block;
}

.fb-pax-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.fb-pax-row:last-child {
    border-bottom: none;
}

.fb-pax-info strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
}

.fb-pax-info small {
    font-size: 0.72rem;
    color: #94a3b8;
}

.fb-pax-counter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fb-pax-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.15s ease;
}

.fb-pax-btn:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
}

.fb-pax-num {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    min-width: 18px;
    text-align: center;
}

/* ===== SUBMIT BUTTON ===== */
.hero-submit-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    padding: 0 20px;
}

.hero-submit-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

/* ===== STATS ===== */
.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 2rem;
}

.hero-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-stat-icon {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero-stat-text strong {
    display: block;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-stat-text span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

/* ===== GROUP FIELDS (Desktop: 3 group col-4) ===== */
.fb-group {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 10px 12px;
}

.fb-group-inner {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.fb-group-inner .fb-field {
    flex: 1;
    min-width: 0;
}

.fb-swap-btn {
    flex-shrink: 0;
    width: 34px;
    height: 48px;
    background: rgba(59, 130, 246, 0.35);
    border: 1.5px solid rgba(59, 130, 246, 0.6);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin-bottom: 0;
    padding: 0;
}

.fb-swap-btn:hover {
    background: rgba(59, 130, 246, 0.6);
}

/* ===== ROUTE WRAP (Group 1: From-Swap-To) ===== */
/* Desktop: sama persis dengan fb-group-inner */
.fb-route-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.fb-swap-container {
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767px) {
    .hero-section {
        min-height: 100svh;
    }

    .hero-submit-btn {
        width: 100%;
    }

    /* Tab label selalu tampil termasuk mobile */
    .hero-tab-btn span.tab-label {
        display: inline;
    }

    .hero-tabs-nav {
        gap: 3px;
    }

    .hero-tab-btn {
        padding: 9px 14px;
        font-size: 0.8rem;
    }

    /* Pada mobile, group tidak perlu bg box */
    .fb-group {
        background: transparent;
        border: none;
        padding: 0;
    }

    /* Group-inner (dipakai Group 3) jadi column di mobile */
    .fb-group-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    /* Pastikan semua item dalam group-inner full width di mobile */
    .fb-group-inner>* {
        width: 100% !important;
        flex-shrink: unset;
    }

    /* Search btn wrap full width di mobile */
    .fb-search-btn-wrap {
        display: block !important;
    }

    .fb-search-btn-wrap .hero-submit-btn {
        width: 100%;
    }

    /* Khusus group date: tetap row horizontal di mobile */
    .fb-group-dates .fb-group-inner {
        flex-direction: row;
        gap: 8px;
    }

    /* ===== Route wrap mobile: From & To stacked, swap absolute di kanan ===== */
    .fb-route-wrap {
        position: relative;
        flex-direction: column;
        gap: 8px;
    }

    .fb-route-wrap .fb-field {
        /* Beri padding-right agar teks select tidak tertindih swap btn */
        width: 100%;
    }

    .fb-route-wrap .fb-field .fb-control,
    .fb-route-wrap .fb-field .fb-select-wrap select {
        padding-right: 44px;
    }

    /* Swap button: absolut di kanan, vertikal center antara From dan To */
    .fb-swap-container {
        position: absolute;
        right: 6px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 5;
        align-items: center;
    }

    .fb-swap-btn {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: rgba(59, 130, 246, 0.5);
        border: 1.5px solid rgba(59, 130, 246, 0.8);
    }
}

@media (min-width: 768px) {
    .fb-swap-btn {
        width: 34px;
        height: 48px;
    }
}

/* ===== FASTBOAT SINGLE-ROW LAYOUT ===== */
.fb-boat-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Dates: side-by-side on mobile (same as before) */
.fb-boat-dates {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.fb-boat-dates .fb-field {
    flex: 1 1 0;
    min-width: 0;
}

.fb-boat-search-wrap {
    display: flex;
    align-items: flex-end;
}

.fb-boat-search-wrap .hero-submit-btn {
    width: 100%;
    padding: 0 20px;
}

@media (min-width: 768px) {
    .fb-boat-row {
        flex-direction: row;
        align-items: flex-end;
        gap: 8px;
    }

    .fb-boat-row>.fb-field {
        flex: 1 1 0;
        min-width: 0;
    }

    /* Dates container becomes a flex item too */
    .fb-boat-dates {
        flex: 2 1 0;
        min-width: 0;
    }

    .fb-boat-field-from,
    .fb-boat-field-to {
        flex: 1.4 1 0 !important;
    }

    .fb-boat-field-pax {
        flex: 0.72 1 0 !important;
        max-width: 108px;
    }

    .fb-boat-field-pax .fb-pax-trigger {
        padding: 0 10px;
    }

    .fb-pax-label-mobile {
        display: none;
    }

    .fb-pax-label-desktop {
        display: inline;
    }

    .fb-boat-search-wrap {
        flex-shrink: 0;
    }

    .fb-boat-search-wrap .hero-submit-btn {
        width: auto;
        white-space: nowrap;
    }

    /* Pastikan teks dalam combo input tidak terpotong dengan ellipsis */
    .fb-boat-row .fb-combo-input,
    .fb-boat-row .fb-control {
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }
}