/* ── NOVB Booking Form Styles ── */

/* Form Sections */
.novb-booking-form {
    position: relative;
}

.novb-form-section {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.novb-form-section__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e8e8;
    color: #1a1a2e;
}

/* Form Layout */
.novb-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.novb-form-row:last-child {
    margin-bottom: 0;
}

.novb-form-group {
    margin-bottom: 16px;
    width: 100%;
}

.novb-form-group:last-child {
    margin-bottom: 0;
}

.novb-form-group--half {
    flex: 0 0 calc(50% - 8px);
    width: calc(50% - 8px);
    margin-bottom: 0;
}

.novb-form-group--third {
    flex: 0 0 calc(33.333% - 11px);
    width: calc(33.333% - 11px);
    margin-bottom: 0;
}

/* Labels */
.novb-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.novb-required {
    color: #e74c3c;
}

.novb-form-hint {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* Inputs & Selects */
.novb-form-input,
.novb-form-select,
.novb-form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    color: #1a1a2e;
    transition: border-color 200ms ease, box-shadow 200ms ease;
    box-sizing: border-box;
    font-family: inherit;
}

.novb-form-input:focus,
.novb-form-select:focus,
.novb-form-textarea:focus {
    outline: none;
    border-color: #1a1a2e;
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.1);
}

.novb-form-input[readonly] {
    background: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

.novb-form-input--error {
    border-color: #e74c3c;
}

.novb-form-input--error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.novb-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

input[type="date"].novb-form-input,
input[type="time"].novb-form-input {
    min-height: 44px;
    line-height: 1.4;
}

input[type="date"].novb-form-input:invalid,
input[type="time"].novb-form-input:invalid {
    color: #999;
}

.novb-form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Address Autocomplete */
.novb-ac-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    max-height: 240px;
    overflow-y: auto;
}

.novb-ac-item {
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 150ms;
}

.novb-ac-item:last-child {
    border-bottom: none;
}

.novb-ac-item:hover {
    background-color: #f5f5f5;
}

/* Stopovers */
.novb-stopover-section {
    margin-top: 12px;
}

.novb-stopover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.novb-stopover-add {
    background: none;
    border: 1px dashed #aaa;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    transition: all 200ms;
}

.novb-stopover-add:hover {
    border-color: #1a1a2e;
    color: #1a1a2e;
}

.novb-stopover-item {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 8px;
    transition: box-shadow 200ms, opacity 200ms;
}

.novb-stopover-item.is-dragging {
    opacity: 0.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.novb-stopover-item .novb-form-input {
    flex: 1;
}

.novb-stopover-handle {
    cursor: grab;
    font-size: 18px;
    color: #aaa;
    padding: 4px 2px;
    user-select: none;
    touch-action: none;
    line-height: 1;
    flex-shrink: 0;
}

.novb-stopover-handle:active {
    cursor: grabbing;
}

.novb-stopover-remove {
    background: none;
    border: none;
    font-size: 20px;
    color: #aaa;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 200ms;
    flex-shrink: 0;
}

.novb-stopover-remove:hover {
    color: #e74c3c;
}

/* Spots Editor */
.novb-spots-editor {
    position: relative;
}

.novb-spots-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.novb-spot-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0f4f8;
    border: 1px solid #d0d5dd;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 13px;
    color: #333;
}

.novb-spot-remove {
    background: none;
    border: none;
    font-size: 16px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 2px;
}

.novb-spot-remove:hover {
    color: #e74c3c;
}

/* Excluded Areas Warning */
.novb-excluded-warning {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #991b1b;
    font-size: 14px;
}

/* Addons */
.novb-addons-container {
    min-height: 40px;
}

.novb-addons-placeholder {
    color: #888;
    font-size: 14px;
    text-align: center;
    padding: 12px;
}

.novb-addon-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.novb-addon-item:last-child {
    border-bottom: none;
}

.novb-addon-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.novb-addon-check {
    width: 18px;
    height: 18px;
    accent-color: #1a1a2e;
}

.novb-addon-name {
    flex: 1;
}

.novb-addon-price {
    font-weight: 500;
    color: #1a1a2e;
}

.novb-addon-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-left: 28px;
    font-size: 13px;
}

.novb-addon-qty-input {
    width: 70px;
    padding: 6px 10px;
    font-size: 14px;
}

/* Itinerary */
.novb-itinerary-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.novb-itinerary-day {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 20px;
    margin: 0;
}

.novb-itinerary-legend {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    padding: 0 8px;
}

/* Price Panel */
.novb-price-panel {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.novb-price-panel__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    color: #1a1a2e;
}

.novb-price-panel__vehicle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 16px;
}

.novb-price-panel__vehicle-img {
    width: 60px;
    height: 40px;
    overflow: hidden;
    border-radius: 4px;
}

.novb-price-panel__vehicle-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.novb-price-panel__vehicle-name {
    font-weight: 500;
    font-size: 15px;
}

.novb-price-panel__items {
    margin-bottom: 16px;
}

.novb-price-panel__empty {
    text-align: center;
    color: #888;
    font-size: 14px;
    padding: 20px 0;
}

.novb-price-panel__error {
    text-align: center;
    padding: 24px 16px;
}

.novb-price-panel__error-icon {
    font-size: 32px;
    color: #e74c3c;
    margin-bottom: 8px;
}

.novb-price-panel__error-msg {
    font-size: 15px;
    font-weight: 600;
    color: #991b1b;
    margin: 0 0 6px;
}

.novb-price-panel__error-hint {
    font-size: 13px;
    color: #888;
    margin: 0;
}

.novb-price-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
}

.novb-price-item:last-child {
    border-bottom: none;
}

.novb-price-panel__divider {
    height: 1px;
    background: #e8e8e8;
    margin: 4px 0;
}

.novb-price-panel__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.novb-price-panel__total-label {
    font-size: 16px;
    font-weight: 600;
}

.novb-price-panel__total-amount {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
}

.novb-price-panel__payment-info {
    background: #f0f4f8;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #555;
}

.novb-price-panel__payment-info p {
    margin: 4px 0;
}

/* Price Breakdown (shared NovbPriceBreakdown component) */
.novb-price-panel .novb-breakdown {
    margin-bottom: 12px;
}

.novb-price-panel .novb-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.novb-price-panel .novb-breakdown-row--total {
    font-weight: 700;
    font-size: 16px;
    border-bottom: 2px solid #ddd;
    padding: 10px 0;
}

.novb-price-panel .novb-breakdown-row--discount .novb-breakdown-amount {
    color: #e74c3c;
}

.novb-price-panel .novb-breakdown-row--expandable {
    flex-direction: column;
    align-items: stretch;
}

.novb-price-panel .novb-breakdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}

.novb-price-panel .novb-breakdown-arrow {
    display: inline-block;
    font-size: 10px;
    transition: transform 200ms;
}

.novb-price-panel .novb-breakdown-row--open .novb-breakdown-arrow {
    transform: rotate(90deg);
}

.novb-price-panel .novb-breakdown-details {
    padding-left: 16px;
}

.novb-price-panel .novb-breakdown-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
    color: #666;
}

.novb-price-panel .novb-breakdown-detail-route {
    flex: 1;
    min-width: 0;
}

.novb-price-panel .novb-breakdown-detail-dist {
    margin: 0 8px;
    white-space: nowrap;
    color: #999;
}

.novb-price-panel .novb-breakdown-detail-fee {
    white-space: nowrap;
}

.novb-price-panel .novb-breakdown-row--payment {
    margin-top: 8px;
    border-top: 1px dashed #ccc;
    padding-top: 8px;
}

/* Submit Button */
.novb-booking-submit {
    width: 100%;
    margin-top: 8px;
    font-size: 18px;
    padding: 14px;
    cursor: pointer;
    border-radius: var(--radius-pill, 50px);
}

.novb-booking-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Errors */
.novb-form-errors {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.novb-form-errors ul {
    margin: 0;
    padding: 0 0 0 20px;
    color: #991b1b;
    font-size: 14px;
}

.novb-form-errors li {
    margin-bottom: 4px;
}

.novb-booking-error {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 16px;
}

/* Mobile Price Bar */
.novb-mobile-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 300ms ease;
    -webkit-transform: translateY(100%);
    -webkit-transition: -webkit-transform 300ms ease;
}

.novb-mobile-bar.is-visible {
    transform: translateY(0);
    -webkit-transform: translateY(0);
}

.novb-mobile-bar__overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

.novb-mobile-bar.is-open .novb-mobile-bar__overlay {
    display: block;
}

.novb-mobile-bar__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.novb-mobile-bar__price {
    display: flex;
    flex-direction: column;
}

.novb-mobile-bar__label {
    font-size: 12px;
    color: #888;
    line-height: 1;
}

.novb-mobile-bar__amount {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

.novb-mobile-bar__btn {
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: var(--radius-pill, 50px);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: opacity 200ms;
    white-space: nowrap;
}

.novb-mobile-bar__btn:active {
    opacity: 0.85;
}

.novb-mobile-bar__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.novb-mobile-bar__detail {
    display: none;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 20px 16px 12px;
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    position: relative;
    z-index: 2;
}

.novb-mobile-bar.is-open .novb-mobile-bar__detail {
    display: block;
}

.novb-mobile-bar__detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.novb-mobile-bar__close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    -webkit-appearance: none;
}

/* Confirm Modal */
.novb-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.novb-confirm-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.novb-confirm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #eee;
}

.novb-confirm-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1a1a2e;
}

.novb-confirm-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.novb-confirm-body {
    overflow-y: auto;
    padding: 20px 24px;
    -webkit-overflow-scrolling: touch;
}

.novb-confirm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 16px;
}

.novb-confirm-table td {
    padding: 6px 0;
    vertical-align: top;
}

.novb-confirm-label {
    color: #888;
    width: 90px;
    white-space: nowrap;
    padding-right: 12px;
}

.novb-confirm-value {
    color: #1a1a2e;
    word-break: break-all;
}

.novb-confirm-divider td {
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}

.novb-confirm-price {
    margin-bottom: 16px;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 14px 16px;
}

.novb-confirm-price .novb-breakdown-row {
    font-size: 13px;
    padding: 5px 0;
}

.novb-confirm-coupon {
    padding: 14px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 14px;
}

.novb-confirm-coupon-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.novb-confirm-coupon-row {
    display: flex;
    gap: 8px;
}

.novb-confirm-coupon-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
}

.novb-confirm-coupon-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: var(--radius-pill, 50px);
    cursor: pointer;
    white-space: nowrap;
}

.novb-confirm-coupon-btn:disabled {
    opacity: 0.5;
}

.novb-confirm-coupon-msg {
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
}

.novb-confirm-coupon-msg.is-success {
    color: #16a34a;
}

.novb-confirm-coupon-msg.is-error {
    color: #dc2626;
}

.novb-confirm-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    padding-top: 14px;
    border-top: 2px solid #1a1a2e;
}

.novb-confirm-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #eee;
}

.novb-confirm-back {
    flex: 1;
    padding: 12px;
    font-size: 15px;
    font-weight: 500;
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
    border-radius: var(--radius-pill, 50px);
    cursor: pointer;
}

.novb-confirm-submit {
    flex: 1;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: var(--radius-pill, 50px);
    cursor: pointer;
}

.novb-confirm-submit:disabled {
    opacity: 0.5;
}

@media (max-width: 768px) {
    .novb-confirm-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .novb-confirm-modal {
        max-width: none;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
    }

    .novb-confirm-header {
        padding: 14px 16px;
    }

    .novb-confirm-body {
        padding: 16px;
    }

    .novb-confirm-footer {
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .novb-confirm-table {
        font-size: 13px;
    }

    .novb-confirm-label {
        width: 75px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .novb-booking-form {
        overflow: hidden;
    }

    .novb-form-row {
        flex-direction: column;
        gap: 0;
    }

    .novb-form-group--half,
    .novb-form-group--third {
        flex: none;
        width: 100%;
        margin-bottom: 16px;
    }

    .novb-form-section {
        padding: 20px 16px;
        border-radius: 10px;
    }

    .novb-form-input,
    .novb-form-select,
    .novb-form-textarea {
        font-size: 16px;
        max-width: 100%;
        border-radius: 8px;
    }

    /* iOS: keep native date/time picker but ensure consistent height */
    input[type="date"].novb-form-input,
    input[type="time"].novb-form-input {
        -webkit-appearance: none;
        min-height: 44px;
    }

    .novb-form-select {
        -webkit-appearance: none;
        border-radius: 8px;
    }

    .novb-form-input::placeholder {
        font-size: 14px;
    }

    .novb-ac-suggestions {
        position: fixed;
        left: 16px;
        right: 16px;
        top: auto;
        z-index: 1001;
        max-height: 200px;
        border-radius: 8px;
        border: 1px solid #d0d5dd;
    }

    .novb-stopover-item {
        flex-wrap: nowrap;
    }

    .novb-stopover-item .novb-form-input {
        min-width: 0;
    }

    .novb-itinerary-day {
        padding: 16px;
    }

    .novb-spots-tags {
        max-width: 100%;
    }

    .novb-spot-tag {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .novb-addon-label {
        flex-wrap: wrap;
    }

    .novb-addon-qty {
        padding-left: 28px;
        width: 100%;
    }

    .novb-mobile-bar {
        display: block;
    }

    .novb-mobile-bar__detail .novb-breakdown-row {
        font-size: 13px;
        padding: 6px 0;
    }

    .novb-mobile-bar__detail .novb-breakdown-detail {
        font-size: 12px;
    }

    .novb-price-panel__error {
        padding: 16px 12px;
    }

    .novb-price-panel__error-icon {
        font-size: 24px;
    }

    .novb-price-panel__error-msg {
        font-size: 14px;
    }
}

@media (max-width: 375px) {
    .novb-form-section {
        padding: 16px 12px;
        margin-bottom: 12px;
    }

    .novb-form-section__title {
        font-size: 16px;
        margin-bottom: 14px;
    }

    .novb-form-label {
        font-size: 13px;
    }

    .novb-mobile-bar__summary {
        padding: 10px 12px;
    }

    .novb-mobile-bar__amount {
        font-size: 18px;
    }

    .novb-mobile-bar__btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    .novb-itinerary-legend {
        font-size: 14px;
    }
}
