/* ── Tour Booking Widget ──────────────────────────────────────────────────── */

.tb-booking-widget {
    position: relative;
    font-family: inherit;
    max-width: 720px;
    font-size: 1em;
    color: #16202a;
    line-height: 1.45;
}

/* Test mode banner */
.tb-test-banner {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 8px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
}

/* ── Step headings ────────────────────────────────────────────────────────── */
.tb-step__title {
    font-size: 1.15em;
    font-weight: 700;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

/* ── Calendar ─────────────────────────────────────────────────────────────── */
.tb-calendar {
    max-width: 400px;
}

.tb-calendar__month {
    margin-bottom: 20px;
}

.tb-calendar__month-label {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    margin-bottom: 8px;
}

.tb-calendar__dates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tb-calendar__picker .ui-datepicker {
    width: 100%;
    max-width: 400px;
    padding: 14px;
    border: 1px solid #d7d7d7;
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.tb-calendar__picker .ui-datepicker-header {
    position: relative;
    margin-bottom: 10px;
    padding: 8px 28px;
    background: #f6f8fa;
    border-radius: 8px;
}

.tb-calendar__picker .ui-datepicker-title {
    text-align: center;
    font-weight: 700;
    font-size: 1em;
    color: #17212b;
}

.tb-calendar__picker .ui-datepicker-prev,
.tb-calendar__picker .ui-datepicker-next {
    position: absolute;
    top: 9px;
    width: 24px;
    height: 24px;
    text-indent: -9999px;
    overflow: hidden;
    cursor: pointer;
}

.tb-calendar__picker .ui-datepicker-prev { left: 8px; }
.tb-calendar__picker .ui-datepicker-next { right: 8px; }

.tb-calendar__picker .ui-datepicker-prev::before,
.tb-calendar__picker .ui-datepicker-next::before {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-indent: 0;
    font-size: 16px;
    color: #1976d2;
}

.tb-calendar__picker .ui-datepicker-prev::before { content: "<"; }
.tb-calendar__picker .ui-datepicker-next::before { content: ">"; }

.tb-calendar__picker table {
    width: 100%;
    border-collapse: collapse;
}

.tb-calendar__picker th {
    padding: 4px 0 8px;
    font-size: 0.9em;
    color: #44515d;
    text-transform: uppercase;
}

.tb-calendar__picker td {
    padding: 2px;
}

.tb-calendar__picker td a,
.tb-calendar__picker td span {
    display: block;
    text-align: center;
    padding: 12px 0;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1em;
    font-weight: 600;
    color: #1f2933;
}

.tb-calendar__picker td a {
    background: #fff;
    color: #1f2933;
    border: 1px solid #d6dee6;
}

.tb-calendar__picker td a.ui-state-default,
.tb-calendar__picker td a.ui-state-default:visited,
.tb-calendar__picker td a.ui-state-highlight,
.tb-calendar__picker td a.ui-state-hover,
.tb-calendar__picker td a.ui-state-focus {
    color: #1f2933;
}

.tb-calendar__picker td a.ui-state-hover {
    background: #f7e2e2;
    border-color: #c75f5f;
}

.tb-calendar__picker td a.ui-state-active {
    background: #a90e0e;
    border-color: #a90e0e;
    color: #fff;
}

.tb-calendar__picker td.tb-datepicker-available a {
    background: #a90e0e;
    border-color: #a90e0e;
    color: #ffffff;
    font-weight: 700;
}

.tb-calendar__picker td.tb-datepicker-available a.ui-state-default,
.tb-calendar__picker td.tb-datepicker-available a.ui-state-highlight,
.tb-calendar__picker td.tb-datepicker-available a.ui-state-hover,
.tb-calendar__picker td.tb-datepicker-available a.ui-state-focus {
    color: #ffffff;
}

.tb-calendar__picker td.tb-datepicker-available a.ui-state-active,
.tb-calendar__picker td.tb-datepicker-available a.ui-state-active:hover {
    background: #8f0c0c;
    border-color: #8f0c0c;
    color: #ffffff;
}

.tb-calendar__picker td.tb-datepicker-available a.ui-state-hover,
.tb-calendar__picker td.tb-datepicker-available a.ui-state-focus {
    background: #8f0c0c;
    border-color: #8f0c0c;
}

.tb-calendar__picker td.tb-datepicker-soldout a {
    background: #fff4f1;
    border-color: #f0b8aa;
    color: #a9442a;
    font-weight: 700;
}

.tb-calendar__picker td.tb-datepicker-soldout a.ui-state-default,
.tb-calendar__picker td.tb-datepicker-soldout a.ui-state-highlight,
.tb-calendar__picker td.tb-datepicker-soldout a.ui-state-hover,
.tb-calendar__picker td.tb-datepicker-soldout a.ui-state-focus,
.tb-calendar__picker td.tb-datepicker-soldout a.ui-state-active {
    color: #a9442a;
}

.tb-calendar__picker td.tb-datepicker-soldout a.ui-state-hover,
.tb-calendar__picker td.tb-datepicker-soldout a.ui-state-focus,
.tb-calendar__picker td.tb-datepicker-soldout a.ui-state-active {
    background: #fde7e1;
    border-color: #e59b89;
}

.tb-calendar__picker td.tb-datepicker-unavailable span,
.tb-calendar__picker td.ui-datepicker-unselectable span {
    background: #f3f5f7;
    color: #7b8794;
    border: 1px solid #e1e7ec;
}

.tb-calendar__hint {
    margin-top: 10px;
    color: #666;
    font-size: 1em;
}

.tb-calendar__selection {
    margin-top: 12px;
    padding: 12px 14px;
    background: #eef6ff;
    border: 1px solid #c9dff8;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
}

/* Date button base */
.tb-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 10px 12px;
    border: 2px solid #d0d0d0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.82rem;
    line-height: 1.3;
    transition: border-color 0.15s, background 0.15s;
}

.tb-date__day {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.tb-date__label {
    color: #555;
    font-size: 0.75rem;
    margin-top: 2px;
}

.tb-date__spots {
    margin-top: 4px;
    font-size: 0.72rem;
    color: #2e7d32;
    font-weight: 600;
}

.tb-date__badge {
    margin-top: 4px;
    font-size: 0.72rem;
    color: #999;
}

/* Available */
.tb-date--available:hover,
.tb-date--available:focus {
    border-color: #1976d2;
    background: #e3f2fd;
    outline: none;
}

.tb-date--selected {
    border-color: #1565c0;
    background: #1565c0;
    color: #fff;
}

.tb-date--selected .tb-date__label,
.tb-date--selected .tb-date__spots {
    color: #bbdefb;
}

/* Almost full (≥80%) */
.tb-date--almost-full .tb-date__spots {
    color: #e65100;
}

/* Sold out / closed / unavailable */
.tb-date--unavailable {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f5f5f5;
    border-color: #e0e0e0;
}

/* ── Booking form ─────────────────────────────────────────────────────────── */
.tb-booking-form {
    margin-top: 24px;
    background: #ffffff;
    border: 1px solid #e7edf3;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 12px 30px rgba(10, 37, 64, 0.06);
}

.tb-step {
    margin-bottom: 24px;
}

/* ── PAX selectors ────────────────────────────────────────────────────────── */
.tb-pax-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 16px 18px;
    border: 1px solid #e4ebf1;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfc 100%);
    gap: 16px;
    margin-bottom: 12px;
}

.tb-pax-row__label {
    display: block;
    font-size: 1em;
    font-weight: 700;
    color: #17212b;
}

.tb-pax-row__price {
    display: block;
    min-width: 60px;
    margin-top: 4px;
    text-align: left;
    color: #4d6475;
    font-size: 0.95em;
    font-weight: 600;
}

.tb-pax-row__controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border: 1px solid #d8e1e8;
    border-radius: 10px;
    background: #f4f8fb;
}

.tb-pax-btn {
    width: 42px;
    height: 42px;
    border: 1px solid #b8c8d6;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #114a7a;
    transition: background 0.1s, border-color 0.1s, transform 0.1s;
}

.tb-pax-btn:hover {
    background: #eef6ff;
    border-color: #7db1e8;
}

.tb-pax-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f1f4f7;
    border-color: #d3dbe3;
    color: #7f8b97;
}

.tb-pax-input {
    width: 56px;
    text-align: center;
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 4px 0;
    font-size: 1.15em;
    font-weight: 700;
    color: #17212b;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    pointer-events: none;
}

.tb-pax-input::-webkit-inner-spin-button,
.tb-pax-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.tb-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 4px 0;
    font-weight: 700;
    font-size: 1.08em;
    color: #132536;
}

/* ── Customer fields ──────────────────────────────────────────────────────── */
.tb-field-row {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
}

.tb-field-row--half .tb-field {
    flex: 1;
    min-width: 0;
}

.tb-field {
    display: flex;
    flex-direction: column;
}

.tb-field label {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.tb-input {
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.tb-input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.15);
}

/* ── Payment methods ──────────────────────────────────────────────────────── */
.tb-payment-methods {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.tb-payment-method {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: block;
    cursor: pointer;
}

.tb-payment-method.is-disabled {
    cursor: not-allowed;
}

.tb-payment-radio {
    position: absolute;
    inset-inline-start: 16px;
    inset-block-start: 18px;
    width: 18px;
    height: 18px;
    margin: 0;
}

.tb-payment-method__card {
    display: block;
    min-height: 84px;
    padding: 16px 18px 16px 48px;
    border: 1px solid #d7e0e7;
    border-radius: 14px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.tb-payment-method__title {
    display: block;
    font-size: 1em;
    font-weight: 700;
    color: #132536;
}

.tb-payment-method__note {
    display: block;
    margin-top: 8px;
    font-size: 0.92em;
    line-height: 1.4;
    color: #7a2830;
}

.tb-payment-radio:checked + .tb-payment-method__card {
    border-color: #1565c0;
    background: #eef6ff;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.12);
}

.tb-payment-method:hover .tb-payment-method__card {
    border-color: #a8bfd7;
}

.tb-payment-method.is-disabled .tb-payment-method__card {
    opacity: 0.55;
    background: #f6f7f8;
}

.tb-payment-method.is-disabled .tb-payment-method__note {
    color: #7a2830;
}

.tb-btn {
    display: block;
    width: 100%;
    padding: 16px 18px;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.15s, transform 0.1s;
    font-family: inherit;
}

.tb-btn:hover { opacity: 1; }
.tb-btn:active { transform: scale(0.98); }

.tb-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.tb-btn--paypal {
    background: #ffc439;
    color: #003087;
}

.tb-btn--paypal:hover {
    background: #f2b931;
}

.tb-btn--card {
    background: #635bff;
    color: #fff;
}

.tb-btn--card:hover {
    background: #5148ea;
}

.tb-btn--confirm {
    background: #a90e0e;
    color: #fff;
    margin-top: 16px;
}

.tb-btn--confirm:hover {
    background: #8f0c0c;
}

/* Stripe Element container */
.tb-stripe-element {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px 12px;
    background: #fff;
    margin-top: 12px;
}

/* ── Error messages ───────────────────────────────────────────────────────── */
.tb-error-msg {
    color: #c62828;
    font-size: 1em;
    margin-top: 6px;
}

.tb-pax-error {
    margin-top: 8px;
}

.tb-payment-error {
    margin-top: 12px;
    padding: 12px 14px;
    background: #fdecea;
    border: 1px solid #f44336;
    border-radius: 10px;
    font-size: 1em;
}

.tb-return-status {
    padding: 18px 20px;
    border: 1px solid #c9dff8;
    border-radius: 14px;
    background: #eef6ff;
    color: #16324a;
    font-size: 1em;
    font-weight: 600;
}

.tb-return-status.is-pending {
    background: #eef6ff;
    border-color: #c9dff8;
    color: #16324a;
}

.tb-return-status.is-cancelled,
.tb-return-status.is-error {
    background: #fff3f1;
    border-color: #efc2bb;
    color: #7a2830;
}

.tb-return-page {
    max-width: 720px;
}

.tb-return-page__back {
    margin-top: 18px;
}

.tb-return-page__back a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    background: #a90e0e;
    border: 1px solid #a90e0e;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.tb-return-page__back a:hover,
.tb-return-page__back a:focus {
    background: #8f0c0c;
    border-color: #8f0c0c;
    text-decoration: none;
}

.tb-return-page__back a:active {
    transform: scale(0.98);
}

/* ── Success ──────────────────────────────────────────────────────────────── */
.tb-success {
    text-align: center;
    padding: 32px 20px 32px 0;
}

.tb-success__icon {
    font-size: 3rem;
    color: #2e7d32;
    margin-bottom: 12px;
}

.tb-success__message {
    font-size: 1em;
    line-height: 1.6;
}

/* ── Cancellation notice ──────────────────────────────────────────────────── */
.tb-cancelled-notice {
    padding: 14px 18px;
    background: #fff8e1;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #5d4037;
}

/* ── Spinner ──────────────────────────────────────────────────────────────── */
.tb-spinner {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 6px;
}

.tb-spinner__ring {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #1565c0;
    border-radius: 50%;
    animation: tb-spin 0.7s linear infinite;
}

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

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .tb-calendar {
        max-width: 100%;
    }

    .tb-calendar__picker .ui-datepicker {
        max-width: 100%;
    }

    .tb-booking-widget {
        font-size: 1em;
    }

    .tb-booking-form {
        padding: 18px 16px;
    }

    .tb-pax-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .tb-pax-row__controls {
        justify-content: space-between;
    }

    .tb-field-row--half {
        flex-direction: column;
    }

    .tb-payment-methods {
        flex-direction: column;
    }

    .tb-total-row {
        font-size: 1em;
    }
}
