/* ==========================================================================
   NextXen Booking — Frontend Styles
   ========================================================================== */

/* ── Booking Form Wrapper ─────────────────────────────────────────────────── */
.nxb-booking-form-wrapper {
    max-width: 640px;
    font-family: inherit;
}

.nxb-addons { margin: 1rem 0; padding: 1rem; border: 1px solid #ddd; }
.nxb-addons label { display: block; margin: .45rem 0; }
.nxb-search { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; margin-bottom: 1.5rem; }
.nxb-search label { display: grid; gap: .35rem; }
.nxb-search-results article { padding: 1rem 0; border-bottom: 1px solid #ddd; }

.nxb-booking-form {
    margin: 0;
}

/* ── Field Layout ─────────────────────────────────────────────────────────── */
.nxb-field-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.nxb-field {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nxb-field label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.nxb-field label abbr {
    text-decoration: none;
    color: #e00;
    margin-left: 2px;
}

/* ── Date Inputs ──────────────────────────────────────────────────────────── */
.nxb-date-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #fff;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.nxb-date-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.nxb-date-input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

/* ── Availability Notice ──────────────────────────────────────────────────── */
.nxb-availability-notice {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 14px;
}

.nxb-availability-notice.nxb-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.nxb-availability-notice.nxb-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.nxb-availability-notice.nxb-loading {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

/* ── Price Breakdown ──────────────────────────────────────────────────────── */
.nxb-price-breakdown-wrapper {
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}

.nxb-price-breakdown {
    padding: 0;
}

.nxb-breakdown-table {
    width: 100%;
    border-collapse: collapse;
}

.nxb-breakdown-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

.nxb-breakdown-table td,
.nxb-breakdown-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 0.9rem;
}

.nxb-breakdown-table td:last-child,
.nxb-breakdown-table th:last-child {
    text-align: right;
    white-space: nowrap;
}

.nxb-breakdown-total {
    background: #fff;
    border-top: 2px solid #e5e7eb;
}

.nxb-breakdown-total th {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
}

.nxb-duration-note {
    padding: 8px 16px;
    font-size: 0.82rem;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    margin: 0;
}

.nxb-select-dates-notice {
    padding: 16px;
    font-size: 0.9rem;
    color: #6b7280;
    text-align: center;
    margin: 0;
}

/* ── Add to Cart Button ───────────────────────────────────────────────────── */
.nxb-form-actions {
    margin-top: 4px;
}

.nxb-add-to-cart-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.nxb-add-to-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Loading Spinner ──────────────────────────────────────────────────────── */
.nxb-loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: nxb-spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes nxb-spin {
    to { transform: rotate(360deg); }
}

/* ── Order email dates ────────────────────────────────────────────────────── */
.nxb-dates {
    font-size: 0.85em;
    color: #6b7280;
    display: block;
    margin-top: 2px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .nxb-field-row {
        flex-direction: column;
        gap: 12px;
    }
}
