/* Booking Summary Bar */
@import url('dateRangePicker.css');

.booking-summary-bar {
    background-color: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-md) 0;
    margin-top: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.booking-summary-content {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--spacing-lg);
    align-items: center;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    overflow: hidden;
}

.booking-summary-item {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-start;
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}

.booking-summary-item.booking-summary-total {
    margin-left: auto;
    text-align: right;
    flex-direction: column;
    align-items: flex-end;
    flex: 0 0 auto;
}

.booking-summary-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.booking-summary-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.booking-summary-info {
    flex: 1;
    min-width: 0;
}

.booking-summary-label {
    font-size: 10px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
}

.booking-summary-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.booking-summary-value {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.booking-summary-subvalue,
.booking-summary-date {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.booking-summary-price {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-black);
    color: var(--color-accent);
    margin-bottom: var(--spacing-xs);
    display: inline-flex;
    align-items: flex-end;
    gap: 0.3em;
}

.booking-summary-change-btn {
    background: transparent;
    border: 2px solid var(--color-accent);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    flex-shrink: 0;
    margin-left: auto;
    padding: var(--spacing-xs) var(--spacing-sm);
    min-width: 55px;
    height: 26px;
}

.booking-summary-change-btn:hover {
    background-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(164, 255, 0, 0.3);
}

.change-text {
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: color var(--transition-base);
    white-space: nowrap;
}

.booking-summary-change-btn:hover .change-text {
    color: var(--color-bg-primary);
}

@media (max-width: 768px) {
    .booking-summary-bar {
        padding: 10px 0 12px;
        background: transparent;
        border-bottom: none;
    }

    .booking-summary-content {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px;
        margin: 0 var(--spacing-md);
        padding: 10px 10px 10px 12px;
        background: var(--color-bg-card);
        border: 1px solid var(--color-border);
        border-radius: 12px;
        overflow: hidden;
    }

    .booking-summary-item {
        flex: 1 1 0;
        width: auto;
        max-width: none;
        min-width: 0;
        align-items: center;
        gap: 6px;
        min-height: 0;
        padding: 0;
        background: none;
        border: none;
        border-radius: 0;
    }

    .booking-summary-icon {
        margin-top: 0;
        width: 16px;
        height: 16px;
    }

    .booking-summary-icon svg {
        width: 16px;
        height: 16px;
    }

    .booking-summary-label,
    .booking-summary-subvalue {
        display: none;
    }

    .booking-summary-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        min-width: 0;
    }

    .booking-summary-meta {
        flex-direction: column;
        gap: 0;
        overflow: hidden;
        width: 100%;
    }

    .booking-summary-value {
        font-size: 0.75rem;
        line-height: 1.2;
        max-width: 100%;
    }

    .booking-summary-date {
        flex-shrink: 1;
        font-size: 0.6875rem;
        line-height: 1.2;
        max-width: 100%;
    }

    .booking-summary-item.booking-summary-total {
        display: none;
    }

    .booking-summary-change-btn {
        margin-left: 4px;
        min-width: auto;
        height: 28px;
        padding: 0 8px;
    }
}

/* Edit booking modal */
.booking-edit-modal {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1100;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    padding: 130px 16px 16px;
    padding-top: calc(130px + env(safe-area-inset-top, 0px));
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    overscroll-behavior: none;
}

.booking-edit-modal.is-open {
    display: flex;
    animation: bookingEditFade 0.2s ease both;
}

.booking-edit-modal.is-open .booking-edit-modal__sheet {
    animation: bookingEditSheetIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes bookingEditFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bookingEditSheetIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.booking-edit-modal__sheet {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: min(440px, 100%);
    min-width: 0;
    max-height: min(85dvh, 640px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 16px 16px;
}

.booking-edit-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.booking-edit-modal__title {
    margin: 0 36px 16px 0;
    font-size: 1.125rem;
    color: var(--color-text-primary);
}

.booking-edit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.booking-edit-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.booking-edit-field select,
.booking-edit-field input[type="date"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 52px;
    padding: 0 14px;
    color: var(--color-text-primary);
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--font-primary);
    color-scheme: dark;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.booking-edit-field select:focus,
.booking-edit-field input[type="date"]:focus {
    outline: none;
    border-color: rgba(164, 255, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(164, 255, 0, 0.12);
}

.booking-edit-field input[type="date"]::-webkit-calendar-picker-indicator,
.booking-edit-field input[type="date"]::-moz-calendar-picker-indicator {
    display: none;
    opacity: 0;
}

.booking-edit-field input[type="date"]::-webkit-datetime-edit,
.booking-edit-field input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.booking-edit-field input[type="date"]::-webkit-datetime-edit-text {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.booking-edit-dates .date-range-picker-wrapper {
    width: 100%;
    min-width: 0;
}

.booking-edit-modal .custom-select {
    position: relative;
}

.booking-edit-modal .custom-select > select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.booking-edit-modal .custom-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    font-size: 1rem;
    font-family: var(--font-primary);
    font-weight: 500;
    text-align: left;
    color: var(--color-text-muted);
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s ease;
}

.booking-edit-modal .custom-select.has-value .custom-select__trigger {
    color: var(--color-text-primary);
}

.booking-edit-modal .custom-select__trigger:focus-visible,
.booking-edit-modal .custom-select.is-open .custom-select__trigger {
    outline: none;
    border-color: rgba(164, 255, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(164, 255, 0, 0.12);
}

.booking-edit-modal .custom-select.is-invalid .custom-select__trigger {
    border-color: rgba(255, 90, 90, 0.7);
}

.booking-edit-modal .custom-select__trigger-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.booking-edit-modal .custom-select__chevron {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: 0.7;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.booking-edit-modal .custom-select.is-open .custom-select__chevron {
    transform: rotate(225deg) translateY(-2px);
}

.booking-edit-modal .custom-select__panel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
    transition:
        grid-template-rows 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.25s ease,
        margin 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.booking-edit-modal .custom-select.is-open .custom-select__panel {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 8px;
    pointer-events: auto;
}

.booking-edit-modal .custom-select__panel-inner {
    overflow: hidden;
    min-height: 0;
    background: #1a1a1a;
    border: 1px solid rgba(164, 255, 0, 0.16);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.booking-edit-modal .custom-select__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    font-size: 0.9375rem;
    font-family: var(--font-primary);
    text-align: left;
    color: var(--color-text-primary);
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    opacity: 0;
    transform: translateY(-6px);
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        opacity 0.25s ease,
        transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.booking-edit-modal .custom-select__option:last-child {
    border-bottom: none;
}

.booking-edit-modal .custom-select.is-open .custom-select__option {
    opacity: 1;
    transform: none;
}

.booking-edit-modal .custom-select.is-open .custom-select__option:nth-child(1) { transition-delay: 0.04s; }
.booking-edit-modal .custom-select.is-open .custom-select__option:nth-child(2) { transition-delay: 0.08s; }
.booking-edit-modal .custom-select.is-open .custom-select__option:nth-child(3) { transition-delay: 0.12s; }
.booking-edit-modal .custom-select.is-open .custom-select__option:nth-child(4) { transition-delay: 0.16s; }
.booking-edit-modal .custom-select.is-open .custom-select__option:nth-child(5) { transition-delay: 0.2s; }
.booking-edit-modal .custom-select.is-open .custom-select__option:nth-child(6) { transition-delay: 0.24s; }

.booking-edit-modal .custom-select__option:active,
.booking-edit-modal .custom-select__option.is-selected {
    background: rgba(164, 255, 0, 0.1);
    color: var(--color-accent);
}

.booking-edit-modal .custom-select__option.is-selected::after {
    content: '✓';
    font-size: 0.875rem;
    color: var(--color-accent);
}

.booking-edit-modal #summaryDropoffGroup {
    overflow: hidden;
    max-height: 400px;
    opacity: 1;
    transition:
        max-height 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.25s ease,
        margin 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.booking-edit-modal #summaryDropoffGroup.is-collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: -12px;
    pointer-events: none;
}

.booking-edit-same {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

.booking-edit-same input {
    accent-color: var(--color-accent);
}

.booking-edit-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-width: 0;
}

.booking-edit-field {
    min-width: 0;
}

@media (max-width: 400px) {
    .booking-edit-dates {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .booking-edit-modal.is-open,
    .booking-edit-modal.is-open .booking-edit-modal__sheet,
    .booking-edit-modal .custom-select__trigger,
    .booking-edit-modal .custom-select__panel,
    .booking-edit-modal .custom-select__option,
    .booking-edit-modal .custom-select__chevron,
    .booking-edit-modal #summaryDropoffGroup {
        animation: none;
        transition: none;
    }
}

@media (min-width: 769px) {
    .booking-edit-modal {
        align-items: flex-start;
        padding-top: calc(130px + env(safe-area-inset-top, 0px));
    }

    .booking-edit-modal__sheet {
        border-radius: 16px;
        padding: 24px;
    }
}
