﻿/* ---------- Card shell ---------- */
.step2-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: visible; /* IMPORTANT: don't clip Syncfusion popup */
}

.step2-card-header {
    background: #f8fafc;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.step2-card-body {
    padding: 16px;
}

.badge-required {
    background: #111827;
    color: #fff;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.badge-optional {
    background: #e5e7eb;
    color: #111827;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.step2-missing .step2-link {
    text-align: left;
}

.step2-policy details summary {
    cursor: pointer;
}

/* ---------- Shared list wrapper ---------- */
.passenger-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* =========================================================
   Legacy passenger styles (safe to keep; may be unused now)
   ========================================================= */
.passenger-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.passenger-head {
    display: grid;
    grid-template-columns: 160px 1fr 24px;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    background: #fff;
    align-items: center;
}

.passenger-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.passenger-title {
    font-weight: 800;
}

.passenger-status {
    font-size: 16px;
}

.passenger-fields {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 12px;
    align-items: start;
}

.passenger-field .form-control {
    height: 44px;
}

.passenger-lastname {
    margin-top: 4px;
    line-height: 1.1;
}

.passenger-caret {
    font-size: 18px;
    opacity: 0.75;
    text-align: right;
}

.passenger-body {
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
    padding: 12px;
}

.converter {
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

/* =========================================================
   NEW Guest row styles (what you're using now)
   ========================================================= */

/* Row “card” */
.guest-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}

/* Make inputs consistent height */
.guest-item .form-control {
    height: 44px;
}

/* Desktop/tablet layout: left meta column + right fields column */
.guest-row {
    display: grid;
    grid-template-columns: 110px 1fr; /* keeps “Guest X” compact */
    gap: 12px;
    align-items: start;
}

.guest-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px; /* aligns with input tops */
    min-width: 0;
}

.guest-title {
    font-weight: 800;
    color: #111827;
    white-space: nowrap;
}

.guest-status {
    font-size: 16px;
    flex: 0 0 auto;
}

/*
  Desktop grid: name | weight | front seat
  - weight column tightened so the checkbox stays visible
  - minmax(0,1fr) prevents overflow from long inputs
*/
.guest-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(190px, 22vw, 240px) max-content;
    gap: 12px;
    align-items: start;
    min-width: 0;
}

.guest-name,
.guest-weight {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.guest-lastname {
    margin-top: 6px;
    line-height: 1.1;
}

.guest-name-single .guest-lastname {
    display: none;
}

/* Weight input-group: prevent wrap + keep unit width consistent */
.guest-weight .input-group {
    width: 100%;
    flex-wrap: nowrap;
}

.guest-weight .input-group .form-control {
    min-width: 0; /* allows shrinking instead of overflowing */
}

.guest-unit {
    width: 78px;
    min-width: 78px;
}

/* Helps align the weight column with the "last name" helper row when same-last-name is on */
.guest-weight-spacer {
    height: 18px;
}

/* Front seat column */
.guest-frontseat {
    display: flex;
    align-items: center;
    padding-top: 10px;
    white-space: nowrap;
    justify-self: start;
}

/* Make checkbox row a nice click target */
.guest-frontseat .form-check {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.guest-frontseat .form-check-input {
    margin-top: 0;
}

/* =========================================================
   Responsive fixes (this is what fixes your mobile regression)
   ========================================================= */

/* Tablet + down: put meta above fields */
@media (max-width: 768px) {
    .guest-row {
        grid-template-columns: 1fr;
    }

    .guest-meta {
        padding-top: 0;
    }

    /*
      Default for <=768: two columns (name + weight) then front-seat on its own row.
      Prevents the “weight/unit offscreen” issue while keeping a compact layout.
    */
    .guest-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "name weight"
            "front front";
    }

    .guest-name {
        grid-area: name;
    }

    .guest-weight {
        grid-area: weight;
    }

    .guest-frontseat {
        grid-area: front;
        padding-top: 0;
        justify-self: start;
    }

    .guest-weight-spacer {
        display: none;
    }
}

/* Phones: stack everything (matches the “mobile was fine” behavior) */
@media (max-width: 480px) {
    .guest-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "name"
            "weight"
            "front";
    }
}

/* --- Syncfusion dropdown popups: ensure they appear/click above sticky footer on mobile --- */
.e-dropdownbase.e-popup,
.e-popup.e-ddl,
.e-popup.e-control,
.e-popup.e-multi-select-list-wrapper,
.e-popup-open {
    z-index: 20000 !important;
}

/* Allow dropdown popups to escape the card on mobile (prevents “tap does nothing”) */
.step2-card-popups {
    overflow: visible;
}

/* iOS/Android tap friendliness */
.touch-control,
.touch-control * {
    -webkit-tap-highlight-color: transparent;
}

/* Step 2 dropdown tap reliability (iOS Safari) */
#accommodationAvailability,
#referralAvailability {
    position: relative;
    z-index: 5;
}

/* Syncfusion dropdown popup must sit above sticky footer + cards */
#accommodationDropdown_popup,
#referralDropdown_popup {
    z-index: 20000 !important;
}

/* Make sure the dropdown input itself is on top for taps */
#accommodationAvailability,
#referralAvailability {
    position: relative;
    z-index: 10;
}

/* 1) Neutralize Bootstrap .row negative margins inside the padded card */
.step2-card-body #accommodationAvailability.row,
.step2-card-body #referralAvailability.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* If you keep col-12 + p-0 on those wrappers, ensure they don't re-introduce offsets */
.step2-card-body #accommodationAvailability.col-12,
.step2-card-body #referralAvailability.col-12 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* 2) Ensure the Syncfusion wrapper spans the same width as other inputs */
.step2-card-body #accommodationAvailability .e-control-wrapper,
.step2-card-body #referralAvailability .e-control-wrapper,
.step2-card-body #accommodationAvailability .e-input-group,
.step2-card-body #referralAvailability .e-input-group {
    width: 100% !important;
    max-width: 100% !important;
}

/* 3) Prevent the dropdown caret/icon from wrapping under the text */
.step2-card-body #accommodationAvailability .e-input-group,
.step2-card-body #referralAvailability .e-input-group {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

/* Let the text area shrink so the icon stays on the right */
.step2-card-body #accommodationAvailability input.e-input,
.step2-card-body #referralAvailability input.e-input {
    flex: 1 1 auto !important;
    width: 1% !important; /* critical: prevents taking 100% and forcing wrap */
    min-width: 0 !important;
}

/* Push the dropdown icon to the far right */
.step2-card-body #accommodationAvailability .e-ddl-icon,
.step2-card-body #referralAvailability .e-ddl-icon,
.step2-card-body #accommodationAvailability .e-input-group-icon,
.step2-card-body #referralAvailability .e-input-group-icon {
    margin-left: auto !important;
    flex: 0 0 auto !important;
}
