/* ===== Ristorante Booking — Public CSS =====
   Variabili da sovrascrivere nel customizer Flatsome / tema:
   --rb-primary  —  colore principale
   --rb-radius   —  arrotondamento
*/

.rb-wrap {
    --rb-primary:       #B45309;
    --rb-primary-hover: #92400E;
    --rb-radius:        10px;
    --rb-border:        #E5E7EB;
    --rb-bg:            #FAFAF9;
    --rb-text:          #1C1917;
    --rb-muted:         #78716C;

    font-family: inherit;
    color: var(--rb-text);
    max-width: 640px;
    margin: 0 auto;
}

/* ── Info box (step 0) ─────────────────────────────────────── */
.rb-info-box {
    display: flex;
    gap: 1rem;
    background: var(--rb-bg);
    border: 1.5px solid var(--rb-border);
    border-left: 4px solid var(--rb-primary);
    border-radius: var(--rb-radius);
    padding: 1.25rem;
}
.rb-info-icon { font-size: 1.5rem; flex-shrink: 0; }
.rb-info-text strong { display: block; font-size: 15px; margin-bottom: .4rem; }
.rb-info-text p { font-size: 14px; color: var(--rb-muted); margin: .3rem 0 0; line-height: 1.6; }
.rb-info-text a { color: var(--rb-primary); }

/* ── Step title ────────────────────────────────────────────── */
.rb-step-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 1.1rem;
    color: var(--rb-text);
}

/* ── Field layout ──────────────────────────────────────────── */
.rb-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: .85rem;
}
@media (max-width: 480px) { .rb-field-row { grid-template-columns: 1fr; } }

.rb-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.rb-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--rb-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.rb-field input,
.rb-field select,
.rb-field textarea {
    border: 1.5px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: .6rem .85rem;
    font-size: 15px;
    color: var(--rb-text);
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.rb-field input:focus,
.rb-field select:focus,
.rb-field textarea:focus {
    outline: none;
    border-color: var(--rb-primary);
    box-shadow: 0 0 0 3px rgba(180,83,9,.1);
}

/* Flatsome compatibility — override any conflicting input resets */
.rb-wrap input[type="text"],
.rb-wrap input[type="email"],
.rb-wrap input[type="tel"],
.rb-wrap input[type="date"],
.rb-wrap select,
.rb-wrap textarea {
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
}

/* ── Closed note ───────────────────────────────────────────── */
.rb-closed-note {
    font-size: 13px;
    color: #991B1B;
    margin-top: 4px;
}

/* ── Loading ───────────────────────────────────────────────── */
.rb-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--rb-muted);
    font-size: 14px;
    margin: 1rem 0;
}
.rb-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--rb-border);
    border-top-color: var(--rb-primary);
    border-radius: 50%;
    animation: rb-spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes rb-spin { to { transform: rotate(360deg); } }

/* ── Slots ─────────────────────────────────────────────────── */
.rb-service-section { margin-bottom: 1.25rem; }
.rb-service-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--rb-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 0 0 8px;
}
.rb-slots-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.rb-slot {
    border: 1.5px solid var(--rb-border);
    border-radius: 8px;
    padding: .42rem .95rem;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: #fff;
    color: var(--rb-text);
    transition: all .15s;
    text-align: center;
    min-width: 72px;
    font-family: inherit;
}
.rb-slot:hover:not(.rb-slot--full) {
    border-color: var(--rb-primary);
    color: var(--rb-primary);
}
.rb-slot--selected {
    background: var(--rb-primary);
    border-color: var(--rb-primary);
    color: #fff !important;
}
.rb-slot--full { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.rb-slot-avail { display: block; font-size: 10px; font-weight: 400; margin-top: 2px; opacity: .75; }

/* ── Summary strip ─────────────────────────────────────────── */
.rb-selected-summary {
    background: var(--rb-bg);
    border: 1.5px solid var(--rb-border);
    border-radius: var(--rb-radius);
    padding: .65rem 1rem;
    font-size: 14px;
    margin-bottom: 1.1rem;
    color: var(--rb-muted);
}
.rb-selected-summary strong { color: var(--rb-text); }

/* ── Privacy checkbox ──────────────────────────────────────── */
.rb-privacy-wrap { margin: 1rem 0; }
.rb-privacy-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}
.rb-privacy-label input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--rb-primary);
    cursor: pointer;
}
.rb-privacy-label a { color: var(--rb-primary); }
.rb-privacy-note {
    font-size: 12px;
    color: var(--rb-muted);
    margin: .5rem 0 0 26px;
    line-height: 1.6;
}

/* ── Buttons ───────────────────────────────────────────────── */
.rb-actions { display: flex; gap: 10px; margin-top: 1rem; }
.rb-btn {
    border: none;
    border-radius: var(--rb-radius);
    padding: .7rem 1.5rem;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-family: inherit;
    line-height: 1.4;
}
.rb-btn-primary { background: var(--rb-primary); color: #fff !important; flex: 1; }
.rb-btn-primary:hover { background: var(--rb-primary-hover); }
.rb-btn-primary:active { transform: scale(.98); }
.rb-btn-back { background: transparent; color: var(--rb-muted) !important; border: 1.5px solid var(--rb-border); }
.rb-btn-back:hover { background: var(--rb-bg); }
.rb-btn-secondary { background: transparent; color: var(--rb-primary) !important; border: 1.5px solid var(--rb-primary); margin-top: 1rem; }
.rb-btn-secondary:hover { background: rgba(180,83,9,.06); }

/* ── Error ─────────────────────────────────────────────────── */
.rb-error {
    background: #FEE2E2;
    color: #991B1B;
    border-radius: var(--rb-radius);
    padding: .75rem 1rem;
    font-size: 13px;
    margin-top: 1rem;
    line-height: 1.5;
}

/* ── Success ───────────────────────────────────────────────── */
.rb-success { text-align: center; padding: 2rem 1rem; }
.rb-success-icon {
    width: 60px;
    height: 60px;
    background: #D1FAE5;
    color: #065F46;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    line-height: 60px;
    margin: 0 auto 1rem;
    letter-spacing: .02em;
}
.rb-success h3 { font-size: 1.25rem; margin: 0 0 .5rem; }
.rb-success p { color: var(--rb-muted); font-size: 15px; }

/* Calendar buttons */
.rb-cal-title { font-size: 13px; font-weight: 600; color: var(--rb-muted); margin: 1.5rem 0 .5rem; }
.rb-cal-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rb-btn-cal {
    padding: .5rem 1.1rem;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    border: 1.5px solid var(--rb-border);
    background: #fff;
    color: var(--rb-text) !important;
    cursor: pointer;
}
.rb-btn-cal:hover { border-color: var(--rb-primary); color: var(--rb-primary) !important; }
.rb-myaccount-cta { margin-top: 1.25rem; }

/* ── My Account table ──────────────────────────────────────── */
.rb-myaccount-wrap { font-size: 14px; }
.rb-no-bookings { color: var(--rb-muted); }
.rb-no-bookings a { color: var(--rb-primary); }
.rb-myaccount-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rb-cancel-btn { font-size: 12px !important; }
.rb-ics-btn { font-size: 12px !important; }

/* Badges (used in both admin and my account) */
.rb-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.rb-badge--confirmed       { background: #D1FAE5; color: #065F46; }
.rb-badge--arrivato        { background: #DBEAFE; color: #1E40AF; }
.rb-badge--annullata       { background: #FEE2E2; color: #991B1B; }
.rb-badge--non_presentato  { background: #F3E8FF; color: #6B21A8; }
.rb-badge--pending         { background: #D1FAE5; color: #065F46; }
.rb-badge--cancelled       { background: #FEE2E2; color: #991B1B; }

/* ── Flatsome-specific overrides ───────────────────────────── */
/* Flatsome resets button styles globally — force our styles */
.rb-wrap .rb-btn,
.rb-wrap .rb-slot,
.rb-wrap .rb-btn-cal {
    box-shadow: none;
    text-shadow: none;
    letter-spacing: normal;
}
/* Flatsome sometimes forces border-box on inputs */
.rb-wrap input,
.rb-wrap select,
.rb-wrap textarea {
    box-sizing: border-box;
    max-width: 100%;
}
/* Flatsome "nav-dark" header can bleed dark colors */
.rb-wrap label { color: var(--rb-muted); }

/* Pre-fill notice for logged-in users */
.rb-prefill-note {
    font-size: 13px;
    color: #065F46;
    background: #D1FAE5;
    border-radius: 6px;
    padding: .45rem .85rem;
    margin-bottom: 1rem;
}

/* ── Reschedule disabled label ─────────────────────────────── */
.rb-reschedule-disabled {
    font-size: 12px;
    color: var(--rb-muted);
    opacity: .5;
    cursor: not-allowed;
    padding: 4px 8px;
    border: 1px dashed var(--rb-border);
    border-radius: 4px;
}

/* ── Reschedule modal ──────────────────────────────────────── */
.rb-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
body.rb-modal-open { overflow: hidden; }

.rb-modal-box {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    overflow: hidden;
    animation: rb-modal-in .2s ease;
}
@keyframes rb-modal-in {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.rb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--rb-border);
}
.rb-modal-header h3 { margin: 0; font-size: 15px; font-weight: 600; }
.rb-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--rb-muted);
    line-height: 1;
    padding: 0 4px;
}
.rb-modal-close:hover { color: var(--rb-text); }

.rb-modal-body  { padding: 1.25rem; }
.rb-modal-footer {
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--rb-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.rb-resch-hint {
    font-size: 13px;
    color: var(--rb-muted);
    display: block;
    padding: .4rem 0;
}
.rb-resch-slots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
