/* ==========================================================================
   Royal Space — Espaços disponíveis, janelas de preços/reserva e carrossel
   ========================================================================== */

.btn-sm { min-height: 42px; padding: 0 18px; font-size: .85rem; }

/* ---------- Grelha de espaços ---------- */
.esp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; perspective: 1400px; }
.esp-card {
  display: flex; flex-direction: column; background: #fff; border-radius: 28px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(4, 24, 90, .03);
}
.esp-card[data-tilt].is-tilting { box-shadow: var(--shadow); }
.esp-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-soft); }
.esp-media[data-reservar] { cursor: pointer; }
.esp-media img { width: 100%; height: 100%; object-fit: cover; transition: scale .8s var(--ease-out); }
.esp-card:hover .esp-media img { scale: 1.06; }
.esp-media-empty { width: 100%; height: 100%; background: var(--yellow) var(--pat-arcs-white) 0 0 / 64px 64px; opacity: .9; }
.esp-badges { position: absolute; top: 14px; left: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.esp-badge { padding: 6px 12px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; background: rgba(255,255,255,.92); color: var(--ink); backdrop-filter: blur(6px); }
.esp-badge.is-gold { background: var(--yellow); color: var(--blue-900); }
.esp-badge.is-open::before, .esp-badge.is-closed::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: #1aa35b; vertical-align: 1px; }
.esp-badge.is-closed::before { background: #c62828; }
.esp-body { padding: 22px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.esp-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.esp-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.esp-meta svg { width: 15px; height: 15px; flex: none; }
.esp-rating { color: var(--ink); }
.esp-rating svg { color: var(--yellow); }
.esp-rating small { color: var(--muted); font-weight: 500; }
.esp-rating.is-new { padding: 3px 10px; border-radius: 999px; background: #e5ecff; color: var(--blue); font-size: .72rem; }
.esp-title { font-size: 1.2rem; letter-spacing: -.01em; }
.esp-desc { font-size: .9rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.esp-facts { font-size: .82rem; color: var(--muted); }
.esp-facts span { display: inline-flex; align-items: center; gap: 6px; }
.esp-facts svg { width: 16px; height: 16px; color: var(--blue); }
.esp-foot { margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 14px; }
.esp-price small { display: block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.esp-price strong { font-size: 1.35rem; color: var(--blue); font-weight: 800; }
.esp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.esp-actions .btn { width: 100%; }

.esp-empty { grid-column: 1 / -1; text-align: center; padding: 56px 24px; border-radius: 28px; background: #fff; border: 1px dashed var(--line); }
.esp-empty p { color: var(--muted); margin: 8px auto 18px; max-width: 46ch; }

/* Esqueleto de carregamento */
.esp-skeleton .esp-media, .esp-skeleton .esp-body span {
  background: linear-gradient(90deg, var(--bg-soft) 0%, #e9edf7 50%, var(--bg-soft) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.esp-skeleton .esp-body span { display: block; height: 14px; border-radius: 8px; }
.esp-skeleton .esp-body span:nth-child(1) { width: 40%; }
.esp-skeleton .esp-body span:nth-child(2) { width: 75%; height: 20px; }
.esp-skeleton .esp-body span:nth-child(3) { width: 55%; margin-top: 30px; height: 28px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.esp-more { display: flex; justify-content: center; margin-top: 40px; }
.esp-more .btn svg { transition: translate .3s var(--ease-out); }
.esp-more .btn:hover svg { translate: 4px 0; }

/* Filtros (espacos.html) */
.esp-filtros { display: grid; grid-template-columns: 1fr 220px auto; gap: 12px; margin-top: 32px; max-width: 760px; position: relative; z-index: 1; }
.esp-filtros input, .esp-filtros select {
  width: 100%; min-height: 54px; padding: 0 18px; font: inherit; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 16px; background: #fff;
}
.esp-filtros input:focus, .esp-filtros select:focus { outline: none; border-color: var(--blue); }
.esp-filtros .search { position: relative; }
.esp-filtros .search svg { position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.esp-filtros .search input { padding-left: 46px; }
.esp-status { margin-top: 14px; font-size: .9rem; font-weight: 600; color: var(--muted); position: relative; z-index: 1; }

/* ---------- Janelas (dialog) ---------- */
.dialog-open { overflow: hidden; }
.rs-dialog {
  border: 0; padding: 0; margin: auto; width: min(760px, calc(100% - 24px)); max-height: min(88vh, 900px);
  border-radius: 28px; background: #fff; color: var(--text); box-shadow: 0 40px 120px -30px rgba(4, 24, 90, .55);
  overflow: hidden;
}
.rs-dialog[open] { display: flex; flex-direction: column; animation: dlg-in .45s var(--ease-out); }
.rs-dialog::backdrop { background: rgba(4, 24, 90, .55); backdrop-filter: blur(6px); animation: fade-in .3s var(--ease-out); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(16px) scale(.97); filter: blur(4px); } }
@keyframes fade-in { from { opacity: 0; } }
.rs-dialog-sm { width: min(520px, calc(100% - 24px)); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.dlg-head h3 { font-size: 1.3rem; }
.dlg-close { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-soft); flex: none; transition: background-color .2s var(--ease-out); }
.dlg-close:hover { background: var(--yellow); }
.dlg-close svg { width: 18px; height: 18px; }
.dlg-body { padding: 22px 24px; overflow-y: auto; overscroll-behavior: contain; }
.dlg-body h4 { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 26px 0 12px; }
.dlg-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: var(--bg-soft); }

/* Preços */
.pr-hero { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: start; }
.pr-hero img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; }
.pr-loc { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; color: var(--ink); font-size: .92rem; }
.pr-loc svg { width: 18px; height: 18px; color: var(--blue); flex: none; margin-top: 2px; }
.pr-desc { font-size: .9rem; color: var(--muted); margin-top: 8px; }
.pr-cats { display: grid; gap: 12px; }
.pr-cat { display: grid; grid-template-columns: 88px 1fr; gap: 14px; padding: 12px; border-radius: 18px; background: var(--bg-soft); align-items: center; }
.pr-cat img { width: 88px; height: 72px; object-fit: cover; border-radius: 12px; }
.pr-cat strong { display: block; color: var(--ink); }
.pr-cat-meta { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.pr-cat-meta svg { width: 14px; height: 14px; }
.pr-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pr-chips li { padding: 4px 10px; border-radius: 999px; background: #fff; font-size: .74rem; font-weight: 600; color: var(--blue); display: inline-flex; align-items: center; gap: 6px; }
.pr-chips-lg li { background: var(--bg-soft); font-size: .82rem; padding: 7px 12px; }
.pr-chips li svg { width: 13px; height: 13px; }
.pr-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 12px; }
.pr-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 440px; }
.pr-table caption { text-align: left; padding: 12px 16px; font-weight: 700; color: var(--ink); background: #fff; }
.pr-table th, .pr-table td { padding: 12px 16px; text-align: left; vertical-align: top; }
.pr-table th { background: var(--bg-soft); color: var(--muted); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; }
.pr-table tr + tr td { border-top: 1px solid var(--line); }
.pr-table .num { text-align: right; white-space: nowrap; font-weight: 700; color: var(--blue); }
.pr-table small { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; }
.pr-pacotes { display: grid; gap: 10px; }
.pr-pacote { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); }
.pr-pacote strong { display: block; color: var(--ink); }
.pr-pacote span { display: block; font-size: .84rem; color: var(--muted); }
.pr-pacote b { color: var(--blue); white-space: nowrap; }
.pr-note { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: var(--yellow-50); color: var(--ink); font-size: .86rem; }
.esp-loading { display: flex; gap: 8px; justify-content: center; padding: 48px 0; }
.esp-loading span { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); animation: dots 1s var(--ease-out) infinite; }
.esp-loading span:nth-child(2) { animation-delay: .15s; background: var(--yellow); }
.esp-loading span:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 50% { transform: translateY(-8px); opacity: .5; } }

/* Reservar */
.res-intro { color: var(--muted); }
.res-intro strong { color: var(--ink); }
.res-options { display: grid; gap: 12px; margin-top: 20px; }
.res-option {
  display: grid; grid-template-columns: 48px 1fr 24px; gap: 14px; align-items: center;
  padding: 18px; border-radius: 20px; border: 1.5px solid var(--line); color: var(--ink);
  transition: border-color .25s var(--ease-out), background-color .25s var(--ease-out), translate .25s var(--ease-out);
}
.res-option:hover { border-color: var(--blue); background: #f5f8ff; translate: 0 -2px; }
.res-option.is-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.res-option.is-primary:hover { background: var(--blue-700); }
.res-option .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--bg-soft); color: var(--blue); }
.res-option.is-primary .ic { background: var(--yellow); color: var(--blue-900); }
.res-option .ic svg { width: 22px; height: 22px; }
.res-option strong { display: block; font-size: 1rem; }
.res-option small { display: block; font-size: .84rem; opacity: .75; line-height: 1.4; }
.res-option > svg { width: 20px; height: 20px; transition: translate .25s var(--ease-out); }
.res-option:hover > svg { translate: 4px 0; }
.res-steps { margin-top: 20px; display: grid; gap: 8px; font-size: .84rem; color: var(--muted); counter-reset: s; }
.res-steps li { list-style: none; display: flex; gap: 10px; align-items: flex-start; }
.res-steps li::before { counter-increment: s; content: counter(s); width: 22px; height: 22px; border-radius: 50%; background: var(--yellow-50); color: #8a6400; font-weight: 800; font-size: .72rem; display: grid; place-items: center; flex: none; }
.res-app { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: .84rem; color: var(--muted); }
.res-app a { color: var(--blue); font-weight: 700; }

/* ---------- Carrossel infinito ---------- */
.gallery { cursor: grab; }
.gallery.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.gallery.is-dragging figure { pointer-events: none; }
.gallery.is-jumping { scroll-snap-type: none; scroll-behavior: auto; }
.gallery figure { position: relative; transition: box-shadow .5s var(--ease-out); }
.gallery figure.is-active { box-shadow: 0 30px 60px -20px rgba(4, 24, 90, .45), 0 0 0 4px var(--yellow); }
.gallery figure img { -webkit-user-drag: none; user-select: none; }
.gallery-controls { align-items: center; }
.carousel-dots { display: flex; gap: 8px; align-items: center; margin: 0 8px; }
.carousel-dot { width: 10px; height: 10px; border-radius: 999px; background: #cfd6ea; overflow: hidden; position: relative; transition: width .45s var(--ease-out), background-color .3s var(--ease-out); }
.carousel-dot.is-active { width: 44px; background: #dfe5f4; }
.carousel-dot span { position: absolute; inset: 0; background: var(--blue); transform-origin: left; transform: scaleX(0); border-radius: inherit; }
.carousel-dot.is-active span { animation: dot-progress 3.8s linear forwards; }
.is-paused .carousel-dot.is-active span { animation-play-state: paused; }
@keyframes dot-progress { to { transform: scaleX(1); } }

/* ---------- Página espacos.html ---------- */
.esp-hero { padding-bottom: 40px; }
.esp-page { padding: 48px 0 clamp(72px, 10vw, 120px); }

/* ---------- Responsivo ---------- */
@media (max-width: 1024px) { .esp-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .esp-grid { grid-template-columns: 1fr; }
  .esp-filtros { grid-template-columns: 1fr; }
  .pr-hero { grid-template-columns: 1fr; }
  .rs-dialog { max-height: 92vh; border-radius: 24px; }
  .dlg-head, .dlg-body, .dlg-foot { padding-inline: 18px; }
  .dlg-foot .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .rs-dialog[open], .rs-dialog::backdrop { animation: none; }
  .esp-skeleton .esp-media, .esp-skeleton .esp-body span, .esp-loading span { animation: none; }
  .carousel-dot.is-active span { animation: none; transform: scaleX(1); }
  .esp-card:hover .esp-media img { scale: none; }
}

/* Cabeçalho de secção com acção à direita */
.section-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; max-width: none; }
.section-head-row > div { max-width: 640px; }
.section-head-row .lead { margin-top: 16px; }
