/* ── Variables ─────────────────────────────────────────── */
:root {
  --verde-primario: #537e75;
  --verde-oscuro:   #22584e;
  --verde-claro:    #84ada5;
  --blanco:         #ffffff;
  --gris-claro:     #f8f9fa;
  --gris:           #6c757d;
  --gris-oscuro:    #495057;
  --rojo:           #e74c3c;
  --verde-ok:       #27ae60;
}

/* ── Reset & Base ───────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; line-height: 1.6; color: var(--gris-oscuro); background: var(--gris-claro); }

/* ── Header ─────────────────────────────────────────────── */
header { position: fixed; top: 0; width: 100%; background: var(--blanco); box-shadow: 0 2px 10px rgba(0,0,0,0.08); z-index: 1000; padding: 0.5rem 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo-link { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.logo-img { width: 200px; height: 90px; object-fit: contain; }
nav { display: flex; gap: 2rem; align-items: center; }
nav a { color: var(--gris); text-decoration: none; font-weight: 400; font-size: 0.95rem; transition: color 0.3s; }
nav a:hover { color: var(--verde-primario); }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.8rem; color: var(--verde-primario); cursor: pointer; z-index: 1001; }

/* ── Main ───────────────────────────────────────────────── */
main { padding-top: 80px; min-height: calc(100vh - 200px); }

/* ── Hero & Galería ─────────────────────────────────────── */
.property-hero { background: var(--blanco); padding: 4rem 0 2rem; }
.property-title { font-size: 3rem; font-weight: 300; color: var(--verde-oscuro); margin-bottom: 0.5rem; letter-spacing: -1px; }
.property-location { font-size: 1.2rem; color: var(--verde-primario); font-weight: 500; margin-bottom: 2rem; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0; }
.gallery-main { grid-column: span 2; grid-row: span 2; height: 655px; background-size: cover; background-position: center; border-radius: 15px; cursor: pointer; transition: opacity 0.2s; }
.gallery-item  { height: 320px; background-size: cover; background-position: center; border-radius: 15px; cursor: pointer; transition: opacity 0.2s; }
.gallery-main:hover, .gallery-item:hover { opacity: 0.85; }

/* ── Layout contenido ───────────────────────────────────── */
.content-wrapper { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; padding: 3rem 0; }

/* ── Detalles ───────────────────────────────────────────── */
.property-details { background: var(--blanco); padding: 2rem; border-radius: 20px; }
.details-section { margin-bottom: 2rem; }
.details-section h3 { font-size: 1.5rem; font-weight: 500; color: var(--verde-oscuro); margin-bottom: 1rem; }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1rem; }
.feature-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.8rem; background: var(--gris-claro); border-radius: 10px; }
.feature-icon { width: 24px; height: 24px; color: var(--verde-primario); flex-shrink: 0; }
.price-highlight { background: var(--verde-claro); padding: 1.5rem; border-radius: 15px; margin: 2rem 0; }
.price-highlight h4 { font-size: 1.2rem; color: var(--verde-oscuro); margin-bottom: 0.5rem; }
.price-amount { font-size: 2rem; font-weight: 600; color: var(--verde-oscuro); }

/* ── Panel de reserva ───────────────────────────────────── */
.booking-panel { background: var(--blanco); padding: 2rem; border-radius: 20px; position: sticky; top: 100px; height: fit-content; box-shadow: 0 10px 40px rgba(0,0,0,0.08); }
.booking-title { font-size: 1.8rem; font-weight: 500; color: var(--verde-oscuro); margin-bottom: 1.5rem; }

/* ── Calendario ─────────────────────────────────────────── */
.calendar { margin-bottom: 2rem; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.calendar-nav { background: none; border: 1px solid var(--verde-primario); color: var(--verde-primario); width: 35px; height: 35px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; transition: all 0.3s; }
.calendar-nav:hover { background: var(--verde-primario); color: var(--blanco); }
.calendar-month { font-weight: 600; color: var(--verde-oscuro); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-day-name { text-align: center; font-size: 0.8rem; font-weight: 600; color: var(--gris); padding: 0.5rem 0; }
.calendar-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; transition: all 0.3s; font-size: 0.9rem; }
.calendar-day:hover:not(.disabled):not(.empty):not(.booked) { background: var(--verde-claro); }
.calendar-day.disabled { opacity: 0.3; cursor: not-allowed; }
.calendar-day.empty    { cursor: default; }
.calendar-day.selected { background: var(--verde-primario); color: var(--blanco); font-weight: 600; }
.calendar-day.range    { background: var(--verde-claro); }
.calendar-day.booked   { background: #f0e6e6; color: #b07070; cursor: not-allowed; text-decoration: line-through; text-decoration-color: #c09090; opacity: 0.7; }
.calendar-day.booked:hover { background: #f0e6e6; }
.calendar-note { font-size: 0.85rem; color: var(--gris); margin-top: 1rem; text-align: center; }

/* Leyenda */
.calendar-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.75rem; margin-bottom: 0.5rem; }
.legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: var(--gris); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-dot.available { background: #e8f5e9; border: 1px solid var(--verde-primario); }
.legend-dot.booked    { background: #f0e6e6; border: 1px solid #c09090; }
.legend-dot.selected  { background: var(--verde-primario); }

/* Sincronización */
.sync-status { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--gris); margin-bottom: 0.75rem; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #ccc; }
.sync-dot.ok      { background: #4caf50; }
.sync-dot.error   { background: #e57373; }
.sync-dot.loading { background: #ffb74d; animation: blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── Formulario ─────────────────────────────────────────── */
.booking-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; }
.form-label { font-size: 0.9rem; font-weight: 500; color: var(--gris-oscuro); margin-bottom: 0.5rem; }
.form-input { padding: 0.8rem; border: 1px solid #ddd; border-radius: 10px; font-size: 1rem; transition: border 0.3s; }
.form-input:focus { outline: none; border-color: var(--verde-primario); }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.field-error { display: none; color: var(--rojo); font-size: 0.82rem; margin-top: 0.3rem; }
.submit-btn { background: var(--verde-primario); color: var(--blanco); padding: 1rem; border: none; border-radius: 5px; font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: all 0.3s; margin-top: 1rem; }
.submit-btn:hover { background: var(--verde-oscuro); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,121,107,0.3); }
.form-success { display: none; text-align: center; padding: 2rem 1rem; }
.form-success .success-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.form-success h4 { font-size: 1.3rem; font-weight: 600; color: var(--verde-oscuro); margin-bottom: 0.5rem; }
.form-error-msg { display: none; padding: 1rem; background: #fff0f0; border-radius: 10px; margin-bottom: 1rem; color: #c0392b; font-size: 0.95rem; }

/* ── Footer ─────────────────────────────────────────────── */
footer { background: var(--verde-oscuro); color: var(--blanco); padding: 3rem 0 1.5rem; text-align: center; margin-top: 4rem; }
.footer-text { opacity: 0.9; margin-bottom: 1rem; }

/* ── Lightbox ───────────────────────────────────────────── */
.lightbox-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.92); z-index: 9999; align-items: center; justify-content: center; }
.lightbox-overlay.active { display: flex; }
.lightbox-img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 8px; box-shadow: 0 0 40px rgba(0,0,0,0.5); }
.lightbox-close { position: absolute; top: 1.5rem; right: 2rem; color: white; font-size: 2.5rem; cursor: pointer; background: none; border: none; line-height: 1; opacity: 0.8; transition: opacity 0.2s; }
.lightbox-close:hover { opacity: 1; }
.lightbox-arrow { position: absolute; top: 50%; transform: translateY(-50%); color: white; font-size: 3rem; cursor: pointer; background: rgba(255,255,255,0.1); border: none; padding: 0.5rem 1rem; border-radius: 8px; transition: background 0.2s; user-select: none; }
.lightbox-arrow:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-counter { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); color: white; font-size: 0.95rem; opacity: 0.7; }

/* ── WhatsApp flotante ──────────────────────────────────── */
.wa-container { position: fixed; bottom: 2rem; right: 2rem; display: flex; flex-direction: column; align-items: flex-end; gap: 0.75rem; z-index: 9999; }
.wa-container .wa-btn { width: 60px; height: 60px; border-radius: 50%; background: #25D366; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(37,211,102,0.4); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.wa-container .wa-btn:hover { box-shadow: 0 6px 25px rgba(37,211,102,0.5); }
.wa-container .wa-btn.open { transform: rotate(45deg); }
.wa-container .wa-options { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 0.3s ease, transform 0.3s ease; }
.wa-container .wa-options.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.wa-container .wa-option { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; background: white; padding: 0.6rem 1rem 0.6rem 1.2rem; border-radius: 50px; box-shadow: 0 2px 12px rgba(0,0,0,0.15); transition: transform 0.2s ease, box-shadow 0.2s ease; white-space: nowrap; }
.wa-container .wa-option:hover { transform: translateX(-4px); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
.wa-container .wa-label { font-size: 0.95rem; font-weight: 500; color: #333; }
.wa-container .wa-icon-sm { width: 34px; height: 34px; background: #25D366; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 992px) {
  .content-wrapper { grid-template-columns: 1fr; }
  .booking-panel { position: static; }
  .gallery { grid-template-columns: 1fr; }
  .gallery-main { grid-column: span 1; grid-row: span 1; height: 300px; }
  .property-title { font-size: 2.2rem; }
}

@media (max-width: 768px) {
  .logo-img { width: 150px; height: 80px; }
  nav { gap: 1rem; }
  .features { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .mobile-menu-btn { display: block !important; position: absolute; right: 1rem; top: 1.5rem; }
  #main-nav {
    position: fixed !important; top: 0 !important; right: -100% !important;
    width: 80vw !important; max-width: 300px !important; height: 100vh !important;
    background: var(--blanco) !important; flex-direction: column !important;
    gap: 2rem !important; padding: 7rem 1.5rem 2rem !important;
    transition: right 0.3s ease !important; box-shadow: -5px 0 25px rgba(0,0,0,0.2) !important;
    z-index: 999 !important;
  }
  #main-nav.active { right: 0 !important; }
  #main-nav a { font-size: 1.2rem !important; padding: 1rem 0 !important; border-bottom: 1px solid var(--gris-claro) !important; text-align: center !important; }
  .wa-container { bottom: 1.2rem; right: 1.2rem; }
  .wa-container .wa-btn { width: 50px; height: 50px; }
  .wa-container .wa-btn svg { width: 22px; height: 22px; }
  .wa-container .wa-option { padding: 0.55rem 1rem; }
  .wa-container .wa-label { font-size: 0.85rem; }
  .wa-container .wa-icon-sm { width: 30px; height: 30px; font-size: 0.9rem; }
}

@media (max-width: 480px) {
  .property-title { font-size: 1.8rem; }
  .gallery-main { height: 250px; }
  .gallery-item { height: 180px; }
}
