/* ==========================================================================
   Domo Maddalena Beach Rooms - pagina prenotazione (stile portale booking)
   Usa le variabili colore di style.css (:root)
   ========================================================================== */

/* Override del layout centrato di style.css: qui vogliamo scroll dall'alto */
body.rooms-page {
    display: block;
    padding: 0;
    background: #f5f6f8;
}
img { max-width: 100%; display: block; }  /* rete di sicurezza: niente overflow */

/* IMPORTANTE: l'attributo hidden deve battere i display:flex sottostanti
   (altrimenti lightbox/calendario restano sempre visibili) */
[hidden] { display: none !important; }

/* ---- Top bar ---- */
.rp-top {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 12px;
    background: var(--flame);
    color: #fff;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.rp-back { color: #fff; text-decoration: none; font-weight: 600; font-size: 1rem; }
.rp-brand { font-weight: 600; font-size: .98rem; }

.rp-main { max-width: 720px; margin: 0 auto; padding: 0 0 60px; }

/* ---- Galleria ---- */
.rp-gallery { padding: 12px; display: grid; gap: 8px; }
.rp-gmain, .rp-gthumbs button {
    padding: 0; border: none; background: none; cursor: pointer;
    border-radius: 12px; overflow: hidden;
}
.rp-gmain { position: relative; }
.rp-gmain img { width: 100%; height: 240px; object-fit: cover; }
.rp-seeall {
    position: absolute; right: 10px; bottom: 10px;
    background: rgba(0,0,0,.65); color: #fff; font-size: .85rem; font-weight: 600;
    padding: 8px 14px; border-radius: 999px; backdrop-filter: blur(2px);
}
.rp-gthumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rp-gthumbs img { width: 100%; height: 80px; object-fit: cover; }

/* ---- Intestazione ---- */
.rp-head { background: #fff; margin: 0 12px 12px; padding: 18px; border-radius: 12px; box-shadow: var(--shadow); }
.rp-head h1 { font-size: 1.4rem; margin-bottom: 6px; }
.rp-loc { color: var(--muted); font-size: .92rem; margin-bottom: 10px; }
.rp-desc { font-size: .95rem; color: var(--text); margin-bottom: 14px; }
.rp-desc em { color: var(--muted); font-size: .85rem; }
.rp-amen { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.rp-amen li { background: #f0ebe2; border-radius: 999px; padding: 6px 12px; font-size: .85rem; }

/* ---- Camere ---- */
.rp-rooms { margin: 0 12px 12px; }
.rp-rooms h2, .rp-quote h2 { font-size: 1.15rem; margin: 18px 4px 10px; }
.rp-roomlist { display: grid; gap: 12px; }
.rp-room {
    display: grid; grid-template-columns: 120px 1fr; gap: 12px;
    background: #fff; border: 2px solid transparent; border-radius: 12px;
    overflow: hidden; box-shadow: var(--shadow); transition: border-color .2s;
}
.rp-room.selected { border-color: var(--flame); }
.rp-room img { width: 120px; height: 100%; min-height: 110px; object-fit: cover; }
.rp-room-body { padding: 12px 12px 12px 0; display: flex; flex-direction: column; gap: 4px; }
.rp-room-body h3 { font-size: 1.02rem; }
.rp-room-meta { font-size: .82rem; color: var(--muted); }
.rp-room-desc { font-size: .85rem; color: var(--text); flex: 1; }
.rp-room-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rp-room-info {
    background: #fff; color: var(--flame); border: 1px solid var(--flame);
    padding: 8px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: .88rem;
}
.rp-room-pick {
    background: var(--flame); color: #fff; border: none;
    padding: 8px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: .88rem;
}
.rp-room.selected .rp-room-pick { background: #2e7d32; }

/* ---- Modale dettagli camera ---- */
.rp-modal {
    position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.5);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 20px; overflow-y: auto;
}
.rp-modal-card {
    position: relative; background: #fff; border-radius: 14px;
    width: 100%; max-width: 560px; padding: 18px; margin: auto;
}
.rp-modal-close {
    position: absolute; top: 10px; right: 12px;
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: rgba(0,0,0,.55); color: #fff; font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.rm-carousel { position: relative; margin-bottom: 8px; }
.rm-img { width: 100%; height: 240px; object-fit: cover; border-radius: 10px; display: block; }
.rm-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 50%; border: none;
    background: rgba(0,0,0,.55); color: #fff; font-size: 1.5rem; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.rm-nav.prev { left: 8px; }
.rm-nav.next { right: 8px; }
.rm-count {
    position: absolute; bottom: 8px; right: 10px;
    background: rgba(0,0,0,.6); color: #fff; font-size: .78rem;
    padding: 3px 9px; border-radius: 999px;
}
.rm-thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.rm-thumb { flex: 0 0 auto; padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; overflow: hidden; }
.rm-thumb.on { border-color: var(--flame); }
.rm-thumb img { width: 64px; height: 48px; object-fit: cover; }
#roomModalBody h2 { font-size: 1.2rem; margin-bottom: 4px; }
.rm-sub { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.rm-desc { font-size: .95rem; margin-bottom: 14px; }
#roomModalBody h4 { font-size: .95rem; margin: 14px 0 6px; }
.rm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rm-chips span { background: #f0ebe2; border-radius: 999px; padding: 5px 11px; font-size: .82rem; }
.rm-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.rm-list li { font-size: .86rem; padding-left: 16px; position: relative; }
.rm-list li::before { content: "✓"; position: absolute; left: 0; color: #2e7d32; }
#roomModalBody .rp-submit { margin-top: 18px; }
@media (max-width: 460px) { .rm-list { grid-template-columns: 1fr; } }

/* ---- Form preventivo ---- */
.rp-quote { background: #fff; margin: 0 12px; padding: 18px; border-radius: 12px; box-shadow: var(--shadow); }
.rp-quote-sub { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.rp-field { display: block; margin-bottom: 12px; }
.rp-field > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; }
.rp-field input, .rp-field select, .rp-field textarea {
    width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 1rem; font-family: inherit; background: #fff;
}
.rp-field input:focus, .rp-field select:focus, .rp-field textarea:focus {
    outline: none; border-color: var(--flame);
}

/* date buttons */
.rp-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.rp-datebtn {
    text-align: left; background: #fff; border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 12px; cursor: pointer;
}
.rp-datelbl { display: block; font-size: .72rem; color: var(--muted); }
.rp-dateval { display: block; font-size: .98rem; font-weight: 600; }
.rp-nights { font-size: .85rem; color: var(--flame); font-weight: 600; min-height: 1.1em; margin-bottom: 10px; }

/* ospiti */
.rp-guests { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.rp-stepper { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.rp-stepper > span { font-size: .82rem; color: var(--muted); display: block; margin-bottom: 6px; }
.rp-stepper > div { display: flex; align-items: center; justify-content: space-between; }
.rp-stepper button {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
    background: #fff; font-size: 1.2rem; cursor: pointer; color: var(--flame); line-height: 1;
}
.rp-stepper output { font-size: 1.1rem; font-weight: 600; min-width: 24px; text-align: center; }

.rp-error { color: #c0392b; font-size: .88rem; margin-bottom: 10px; }
.rp-submit {
    width: 100%; background: var(--flame); color: #fff; border: none;
    padding: 15px; border-radius: 10px; font-size: 1.05rem; font-weight: 600; cursor: pointer;
}
.rp-submit:hover { background: var(--flame-h); }
.rp-note { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 8px; }

/* ---- Calendario popup ---- */
.rp-cal-backdrop {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.rp-cal { background: #fff; border-radius: 14px; width: 100%; max-width: 360px; padding: 14px; }
.rp-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rp-cal-head strong { font-size: 1rem; text-transform: capitalize; }
.rp-cal-head button {
    width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
    background: #fff; font-size: 1.2rem; cursor: pointer;
}
.rp-cal-dow, .rp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.rp-cal-dow span { text-align: center; font-size: .72rem; color: var(--muted); padding: 4px 0; }
.rp-cal-grid button {
    aspect-ratio: 1; border: none; background: none; cursor: pointer;
    font-size: .9rem; border-radius: 8px; color: var(--text);
}
.rp-cal-grid button:disabled { color: #ccc; cursor: default; }
.rp-cal-grid button.in-range { background: #fde8e4; border-radius: 0; }
.rp-cal-grid button.edge { background: var(--flame); color: #fff; }
.rp-cal-grid button.edge.start { border-radius: 8px 0 0 8px; }
.rp-cal-grid button.edge.end { border-radius: 0 8px 8px 0; }
.rp-cal-grid .empty { visibility: hidden; }
.rp-cal-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.rp-cal-foot #calHint { font-size: .82rem; color: var(--muted); }
.rp-cal-foot #calDone {
    background: var(--flame); color: #fff; border: none; padding: 8px 18px; border-radius: 8px;
    font-weight: 600; cursor: pointer;
}

/* ---- Visualizzatore "tutte le foto" ---- */
.rp-viewer {
    position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.95);
    display: flex; align-items: center; justify-content: center;
}
.rp-viewer img { max-width: 94vw; max-height: 84vh; border-radius: 8px; }
.rp-viewer-close {
    position: absolute; top: 14px; right: 16px;
    width: 44px; height: 44px; border-radius: 50%; border: none;
    background: rgba(255,255,255,.18); color: #fff; font-size: 1.7rem; cursor: pointer; line-height: 1;
}
.rp-vnav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%; border: none;
    background: rgba(255,255,255,.18); color: #fff; font-size: 1.9rem; cursor: pointer; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.rp-vnav.prev { left: 12px; }
.rp-vnav.next { right: 12px; }
.rp-vcount {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    color: #fff; background: rgba(0,0,0,.5); padding: 5px 14px; border-radius: 999px; font-size: .85rem;
}

/* ---- Desktop ---- */
@media (min-width: 600px) {
    .rp-gmain img { height: 320px; }
    .rp-gthumbs img { height: 110px; }
}
