/* ═══════════════════════════════════════════════════════════════════
   BOOKING — slot grid, cards, panel, form, toast
   ═══════════════════════════════════════════════════════════════════ */

.section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}


/* ── Slot day groups ───────────────────────────────────────────── */

.slots-wrap {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    margin-bottom: 2rem;
}

.slot-day-group {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.slot-day-title {
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
    margin: 0;
    font-family: var(--font);
    font-weight: 600;
}

.slot-day-name {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--bordeaux-bright);
    opacity: 0.85;
}

.slot-day-date {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.slot-times-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.slot-card {
    flex: 0 0 auto;
    min-width: 110px;
    padding: 0.95rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.slot-card:hover {
    background: var(--surface-hover);
    border-color: rgba(138,180,162,0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138,180,162,0.12);
}

.slot-card.selected {
    background: rgba(138,180,162,0.10);
    border-color: var(--sage);
    color: var(--sage);
    box-shadow: 0 0 0 2px rgba(138,180,162,0.2);
}

@media (max-width: 600px) {
    .slot-times-row { gap: 0.5rem; }
    .slot-card { min-width: 95px; padding: 0.8rem 1.2rem; font-size: 1.2rem; }
}

.slots-empty {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.8;
}

.slots-empty a {
    color: var(--bordeaux-bright);
    text-decoration: none;
}

/* ── Booking panel ─────────────────────────────────────────────── */

.booking-panel {
    margin-top: 2rem;
    background: var(--surface);
    border: 1px solid var(--border-medium);
    border-top: 3px solid var(--bordeaux);
    border-radius: 12px;
    padding: 2rem;
    animation: panel-in 0.3s ease;
}

@keyframes panel-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}

.booking-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.booking-panel-slot-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.booking-panel-pre {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.booking-panel-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--bordeaux-bright);
}

.booking-panel-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
}

.booking-panel-close:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

/* ── Booking form ──────────────────────────────────────────────── */

#bookingForm .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
    margin-bottom: 0.875rem;
}

#bookingForm input,
#bookingForm select,
#bookingForm textarea {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 15px;
    transition: border-color 0.2s, background 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

#bookingForm select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a7e84' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

#bookingForm select option {
    background: #1a0e24;
    color: var(--text-primary);
}

#bookingForm input::placeholder,
#bookingForm select::placeholder {
    color: var(--text-muted);
}

#bookingForm input:focus,
#bookingForm select:focus {
    outline: none;
    border-color: var(--bordeaux);
    background: rgba(107, 45, 78, 0.08);
}

.btn-prenota {
    margin-top: 1.25rem;
    width: 100%;
    padding: 0.9rem 2rem;
    background: var(--button-gradient);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.btn-prenota:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.booking-error {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(180, 40, 60, 0.12);
    border: 1px solid rgba(180, 40, 60, 0.3);
    border-radius: 8px;
    color: #e88;
    font-size: 14px;
}

/* ── Toast ─────────────────────────────────────────────────────── */

.booking-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: var(--bordeaux);
    color: #fff;
    padding: 0.85rem 1.75rem;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
    z-index: 999;
    white-space: nowrap;
}

.booking-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Responsive ────────────────────────────────────────────────── */

@media (max-width: 600px) {

    #bookingForm .form-row {
        grid-template-columns: 1fr;
    }

    .booking-panel {
        padding: 1.25rem;
    }

    .booking-panel-label {
        font-size: 15px;
    }

    .booking-toast {
        width: 90%;
        text-align: center;
        white-space: normal;
    }
}

/* ─── Autofill override (browser loves white) ──────────────── */
#bookingForm input:-webkit-autofill,
#bookingForm input:-webkit-autofill:hover,
#bookingForm input:-webkit-autofill:focus,
#bookingForm input:-webkit-autofill:active,
#bookingForm select:-webkit-autofill {
    -webkit-text-fill-color: var(--text-primary) !important;
    -webkit-box-shadow: 0 0 0 1000px #100a1c inset !important;
    box-shadow: 0 0 0 1000px #100a1c inset !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: var(--text-primary);
    border: 1px solid var(--border-soft) !important;
}

/* ─── Consent checkbox (override global form CSS) ──────────── */
#bookingForm .consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 13px;
    font-weight: 300;
    color: var(--text-secondary);
    text-align: left;
    margin-top: 1rem;
    cursor: pointer;
    line-height: 1.6;
}

#bookingForm .consent-label input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
    margin: 3px 0 0 0;
    padding: 0;
    background-color: #ede5e8 !important;
    accent-color: var(--bordeaux-bright);
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: auto;
    color-scheme: light;
}

#bookingForm .consent-label span {
    flex: 1;
}

#bookingForm .consent-label a {
    color: var(--bordeaux-bright);
    text-decoration: underline;
    font-weight: 600;
}

/* ─── Submit button loading state ───────────────────────────── */
.btn-prenota .btn-loading { display: none; }

#bookingForm.htmx-request .btn-prenota {
    opacity: 0.75;
    cursor: wait;
    pointer-events: none;
}

#bookingForm.htmx-request .btn-prenota .btn-text    { display: none; }
#bookingForm.htmx-request .btn-prenota .btn-loading { display: inline-flex; align-items: center; }

.btn-prenota .dots::after {
    display: inline-block;
    margin-left: 2px;
    content: '';
    animation: dots-anim 1.4s infinite;
    width: 1.2em;
    text-align: left;
}

@keyframes dots-anim {
    0%, 20%  { content: ''; }
    40%      { content: '.'; }
    60%      { content: '..'; }
    80%, 100%{ content: '...'; }
}
.arrow-loader {
    display: none;
    text-align: center;
    padding: 16px 0;
    min-height: 60px;
}

.arrow-loader-logo {
    width: 90px !important;
    height: auto !important;
    max-width: 90px !important;
    display: inline-block !important;
    animation: arrow-dust 1.4s ease-in-out infinite alternate;
}

@keyframes arrow-dust {
    0%   { clip-path: inset(0 100% 0 0); opacity: 0.3; }
    100% { clip-path: inset(0 0% 0 0);   opacity: 1; }
}

form.htmx-request .arrow-loader,
form.is-submitting .arrow-loader {
    display: block !important;
}

form.htmx-request button[type="submit"],
form.is-submitting button[type="submit"] {
    display: none !important;
}