/* =========================================================
   Ristorante Prenotazioni Pro – Frontend CSS v2.1
   Mobile-first · Compatibile PatioTime + Elementor
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
    --rp-gold:   #c9a96e;
    --rp-dark:   #1a1a1a;
    --rp-cream:  #f8f5f0;
    --rp-border: #e5e0d8;
    --rp-green:  #2e9e5b;
    --rp-red:    #e04646;
    --rp-amber:  #e8a000;
    --rp-shadow: 0 4px 24px rgba(0,0,0,.08);
}

/* ── Wrap ───────────────────────────────────────────────── */
.rp-wrap {
    font-family: 'DM Sans', sans-serif;
    max-width: 720px;
    width: 100%;          /* si adatta al container padre */
    min-width: 0;         /* evita overflow in container stretti */
    margin: 0 auto;
    padding: 0 12px;
}
@media(min-width: 480px) { .rp-wrap { padding: 0 20px; } }

/* Tutti i figli devono rispettare il container */
.rp-wrap * {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

/* ── Card ───────────────────────────────────────────────── */
.rp-card {
    background: #fff;
    border: 1px solid var(--rp-border);
    box-shadow: var(--rp-shadow);
    overflow: hidden;
}

/* ── Card header ────────────────────────────────────────── */
.rp-card-header {
    padding: 28px 20px 0;
    text-align: center;
    margin-bottom: 24px;
}
@media(min-width: 560px) { .rp-card-header { padding: 44px 44px 0; } }

.rp-gold-line { width: 48px; height: 2px; background: var(--rp-gold); margin: 0 auto 16px; }
.rp-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--rp-dark);
    margin: 0 0 8px;
    letter-spacing: .5px;
}
@media(min-width: 480px) { .rp-title { font-size: 32px; } }
@media(min-width: 560px) { .rp-title { font-size: 34px; } }

.rp-sub { color: #aaa; font-size: 13px; font-weight: 300; margin: 0 0 24px; }
@media(min-width: 480px) { .rp-sub { font-size: 14px; } }

/* ── Steps ──────────────────────────────────────────────── */
.rp-step {
    padding: 0 16px 32px;
}
@media(min-width: 480px) { .rp-step { padding: 0 28px 36px; } }
@media(min-width: 560px) { .rp-step { padding: 0 44px 40px; } }

.rp-step-lbl {
    font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
    color: #999; margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
}
.rp-step-lbl em {
    font-style: normal; font-family: 'Cormorant Garamond', serif;
    font-size: 24px; color: var(--rp-gold); line-height: 1;
}
@media(min-width: 480px) { .rp-step-lbl em { font-size: 26px; } }

/* ── Fields ─────────────────────────────────────────────── */
.rp-field { margin-bottom: 16px; }
@media(min-width: 480px) { .rp-field { margin-bottom: 18px; } }

.rp-field label {
    display: block;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 6px;
}
@media(min-width: 480px) { .rp-field label { font-size: 11px; } }

.rp-field label small { text-transform: none; letter-spacing: 0; font-size: 10px; color: #aaa; }

.rp-field input,
.rp-field select,
.rp-field textarea {
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #ddd;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: var(--rp-dark);
    background: var(--rp-cream);
    outline: none;
    transition: border-color .2s, background .2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0;
}

/* Select: freccia chevron dorata + padding destro per non tagliare il testo */
.rp-field select {
    padding-right: 40px;
    line-height: 1.2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23c9a96e' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}
.rp-field select:focus { border-color: var(--rp-gold); background-color: #fff; }

@media(min-width: 480px) {
    .rp-field input, .rp-field select, .rp-field textarea { padding: 12px 14px; }
    .rp-field select { padding-right: 42px; }
}

/* ── Row (griglia 2 colonne) ────────────────────────────── */
/* Mobile: sempre 1 colonna */
.rp-row { display: grid; grid-template-columns: 1fr; gap: 0; }
/* Tablet+: 2 colonne */
@media(min-width: 480px) { .rp-row { grid-template-columns: 1fr 1fr; gap: 16px; } }

/* ── Slots grid ─────────────────────────────────────────── */
.rp-slots-grid {
    margin: 8px 0 18px;
}
@media(min-width: 480px) { .rp-slots-grid { gap: 0; } }

/* Slot uniformi: griglia con colonne tutte uguali */
.rp-slot-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}
.rp-slot-row .rp-slot { width: 100%; text-align: center; }

.rp-slot {
    padding: 9px 6px;
    border: 1px solid #ddd;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    background: var(--rp-cream);
    transition: all .15s;
    user-select: none;
    line-height: 1.2;
    text-align: center;
}
@media(min-width: 480px) { .rp-slot { padding: 10px 6px; font-size: 14px; } }

.rp-slot:hover  { border-color: var(--rp-gold); background: #fdf8f0; }
.rp-slot.active { border-color: var(--rp-gold); background: var(--rp-gold); color: #fff; }
.rp-slot-group {
    display: none; /* nascosta: gli orari parlano da soli */
}

/* ── Tables grid ────────────────────────────────────────── */
.rp-tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin: 8px 0 18px;
}
@media(min-width: 480px) {
    .rp-tables-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}

.rp-table-card {
    padding: 10px 14px;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 13px;
    background: var(--rp-cream);
    transition: all .15s;
}
.rp-table-card strong { display: block; font-size: 14px; margin-bottom: 2px; }
.rp-table-card small  { color: #999; font-size: 12px; }
.rp-table-card:hover  { border-color: var(--rp-gold); }
.rp-table-card.active { border-color: var(--rp-gold); background: #fdf8f0; }
.rp-table-note { font-size: 12px; color: #999; margin-bottom: 14px; }

/* ── Recap ───────────────────────────────────────────────── */
.rp-recap {
    background: var(--rp-cream);
    border-left: 3px solid var(--rp-gold);
    padding: 12px 16px;
    font-size: 13px;
    color: #555;
    margin-bottom: 20px;
}
@media(min-width: 480px) { .rp-recap { padding: 14px 18px; font-size: 14px; } }

/* ── Buttons ─────────────────────────────────────────────── */
.rp-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;             /* mobile: full width */
    padding: 14px 20px;
    background: var(--rp-dark);
    color: #fff;
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s;
    text-decoration: none;
}
@media(min-width: 480px) {
    .rp-btn-primary { width: auto; font-size: 13px; padding: 14px 30px; }
}
.rp-btn-primary:hover    { background: var(--rp-gold); color: #fff; }
.rp-btn-primary:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

.rp-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    background: transparent;
    border: 1px solid #ddd;
    color: #777;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    transition: all .15s;
    width: 100%;
}
@media(min-width: 480px) { .rp-btn-ghost { width: auto; padding: 14px 22px; } }
.rp-btn-ghost:hover { border-color: #999; color: #333; }

/* ── Actions row (indietro + submit) ───────────────────────
   Mobile: impilati verticalmente (submit prima per UX)
   Tablet+: affiancati
   ─────────────────────────────────────────────────────── */
.rp-actions {
    display: flex;
    flex-direction: column-reverse;   /* submit in alto su mobile */
    gap: 10px;
    margin-top: 8px;
}
@media(min-width: 480px) {
    .rp-actions {
        flex-direction: row;
        align-items: center;
        gap: 14px;
    }
}

/* ── Continue button ────────────────────────────────────── */
.rp-btn1 { width: 100%; }
@media(min-width: 480px) { .rp-btn1 { width: auto; } }

/* ── Alerts ──────────────────────────────────────────────── */
.rp-info-box {
    padding: 12px 14px;
    background: #f0f4ff;
    border-left: 3px solid #6b8cde;
    color: #446;
    font-size: 14px;
    margin: 10px 0 16px;
}
.rp-error-box {
    padding: 12px 14px;
    background: #fff0f0;
    border-left: 3px solid var(--rp-red);
    color: #c00;
    font-size: 14px;
    margin: 10px 0;
}

/* ── Success screen ─────────────────────────────────────── */
.rp-success {
    text-align: center;
    padding: 36px 20px;
    background: #f0faf4;
    border-bottom: 1px solid #a8d5b8;
}
@media(min-width: 480px) { .rp-success { padding: 48px 24px; } }

.rp-success-check {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--rp-green);
    color: #fff; font-size: 26px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
}
.rp-success h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px; margin: 0 0 8px;
}
@media(min-width: 480px) { .rp-success h3 { font-size: 26px; } }
.rp-success p { color: #555; margin: 6px 0; font-size: 14px; }

/* ── Spinner ─────────────────────────────────────────────── */
.rp-spin {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
    border-radius: 50%; animation: rp-spin .7s linear infinite; vertical-align: middle;
}
.rp-spin.dark { border-color: rgba(0,0,0,.15); border-top-color: var(--rp-gold); }
@keyframes rp-spin { to { transform: rotate(360deg); } }

/* ── Misc ────────────────────────────────────────────────── */
.rp-muted { color: #aaa; font-size: 13px; }

/* ── Event cards ─────────────────────────────────────────── */
.rp-events-list {
    max-width: 980px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media(min-width: 480px) {
    .rp-events-list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* Card: proporzione 4:5, immagine come sfondo */
.rp-event-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: var(--rp-dark);
    background-size: cover;
    background-position: center;
    transition: box-shadow .25s, transform .25s;
    cursor: pointer;
}
.rp-event-card:hover { box-shadow: 0 12px 40px rgba(0,0,0,.25); transform: translateY(-2px); }
.rp-event-card.rp-sold-out { opacity: .7; }

/* Gradiente overlay dal basso */
.rp-ec-body {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0;
    background: linear-gradient(to top,
        rgba(0,0,0,.82) 0%,
        rgba(0,0,0,.45) 50%,
        rgba(0,0,0,.0) 100%);
}
.rp-ec-content {
    padding: 20px 18px 18px;
}
@media(min-width: 480px) { .rp-ec-content { padding: 24px 22px 20px; } }

/* Elementi testo sulla card */
.rp-ec-date {
    font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--rp-gold); margin-bottom: 6px;
}
.rp-ec-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px; font-weight: 600; margin: 0 0 8px;
    color: #fff; line-height: 1.2;
}
@media(min-width: 480px) { .rp-ec-title { font-size: 22px; } }
.rp-ec-desc { display: none; } /* nascosta nella card, visibile nella pagina evento */
.rp-ec-footer {
    display: flex; flex-wrap: wrap; gap: 6px 12px;
    font-size: 12px; color: rgba(255,255,255,.8);
    margin-bottom: 14px; align-items: center;
}
.rp-ec-seats { font-size: 12px; }
.rp-ec-btn {
    display: inline-block;
    font-size: 11px; padding: 9px 18px;
    letter-spacing: 1.5px;
}

/* ── Event form banner ───────────────────────────────────── */
.rp-event-banner {
    height: 180px; background: var(--rp-dark);
    background-size: cover; background-position: center;
    position: relative; display: flex; align-items: flex-end;
}
@media(min-width: 480px) { .rp-event-banner { height: 220px; } }
.rp-event-overlay {
    background: linear-gradient(to top, rgba(0,0,0,.8), transparent);
    padding: 18px 20px; width: 100%;
}
@media(min-width: 480px) { .rp-event-overlay { padding: 24px 32px; } }
.rp-event-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px; color: #fff; margin: 0 0 6px;
}
@media(min-width: 480px) { .rp-event-title { font-size: 30px; } }
.rp-event-meta  { color: rgba(255,255,255,.75); font-size: 13px; }
.rp-event-desc  { padding: 16px 20px; color: #666; font-size: 14px; line-height: 1.7; border-bottom: 1px solid var(--rp-border); }
@media(min-width: 480px) { .rp-event-desc { padding: 20px 32px; font-size: 15px; } }

/* ── Elementor ───────────────────────────────────────────── */
.elementor-widget-rp_booking_form .rp-wrap { margin: 0; }

/* ── Container molto stretti (widget laterale, colonne Elementor) ── */
/* Sotto 360px: riduce padding e font per adattarsi */
@media(max-width: 360px) {
    .rp-wrap { padding: 0 8px; }
    .rp-card-header { padding: 20px 12px 0; }
    .rp-step { padding: 0 12px 24px; }
    .rp-title { font-size: 22px; }
    .rp-field input, .rp-field select, .rp-field textarea { padding: 10px; font-size: 14px; }
    .rp-slot { padding: 7px 10px; font-size: 12px; }
    .rp-btn-primary { padding: 12px 16px; font-size: 11px; }
    .rp-table-card { padding: 8px 10px; min-width: 0; }
}

/* Protezione overflow globale per widget in colonne strette */
.rp-card { overflow: hidden; }
.rp-slots-grid { overflow: hidden; }
.rp-row { overflow: hidden; }

/* ── Pagina ringraziamento ──────────────────────────────────────── */
.rp-thankyou { max-width: 560px; margin: 40px auto; }
.rp-ty-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--rp-gold); color: #fff;
    font-size: 28px; font-weight: 700; margin-bottom: 20px;
}
.rp-ty-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px; font-weight: 600; color: var(--rp-dark); margin: 0 0 12px;
}
.rp-ty-msg { font-size: 16px; color: #555; line-height: 1.7; margin: 0 0 16px; }
