/* =========================================================
   components.css — Tarjetas, calendario, modal, lightbox
   La Llar de Pometes
   ========================================================= */

/* =========================================================
   TARJETAS DE SERVICIO
   ========================================================= */
.service-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(123, 174, 142, 0.4);
}

.service-icon-wrap {
  width: 52px;
  height: 52px;
  background: var(--sky);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.service-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.service-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.84rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* =========================================================
   TARJETAS DE PRECIO
   ========================================================= */
.price-card {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.price-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-md);
}

.price-card--high {
  background: var(--navy);
  border-color: var(--navy);
}

.price-card--high .price-season,
.price-card--high .price-months {
  color: rgba(255, 255, 255, 0.7);
}

.price-card--high .price-num,
.price-card--high .price-unit {
  color: var(--white);
}

.price-season {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}

.price-amount {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.price-unit {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--text-mid);
}

.price-months {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  color: var(--text-light);
}

/* =========================================================
   CALENDARIO
   ========================================================= */
.calendar-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  position: relative;
}

/* Header del calendario */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.cal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sky);
  color: var(--navy);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  border: 1px solid var(--border);
  line-height: 1;
}

.cal-nav-btn:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* Cabecera de días de la semana */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 8px;
}

.cal-weekdays span {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-light);
  text-align: center;
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Grid de días */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  min-height: 220px;
  position: relative;
}

/* Spinner de carga dentro del calendario */
.cal-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-md);
  z-index: 2;
}

/* Celdas de días */
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 400;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  color: var(--text);
  user-select: none;
}

/* Día vacío (relleno de inicio de mes) */
.cal-day--empty {
  cursor: default;
}

/* Día pasado */
.cal-day--past {
  color: var(--text-light);
  cursor: default;
  opacity: 0.5;
}

/* Día de hoy */
.cal-day--today {
  color: var(--teal);
  font-weight: 700;
}

.cal-day--today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--teal);
  border-radius: 50%;
}

/* Día libre (hover) */
.cal-day--free:not(.cal-day--past):hover {
  background: var(--sky-mid);
  color: var(--navy);
}

/* Día ocupado */
.cal-day--occupied {
  background: rgba(224, 123, 84, 0.1);
  color: var(--occupied);
  cursor: not-allowed;
  font-weight: 500;
  text-decoration: line-through;
}

/* Día seleccionado (check-in / check-out) */
.cal-day--selected {
  background: var(--navy);
  color: var(--white) !important;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

/* Rango entre fechas seleccionadas */
.cal-day--range {
  background: var(--sky-mid);
  color: var(--navy);
  border-radius: 0;
}

/* Primer día del rango */
.cal-day--range-start {
  background: var(--navy);
  color: var(--white) !important;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* Último día del rango */
.cal-day--range-end {
  background: var(--navy);
  color: var(--white) !important;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Leyenda del calendario */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  color: var(--text-mid);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-occupied {
  background: rgba(224, 123, 84, 0.3);
  border: 1px solid var(--occupied);
}

.legend-selected {
  background: var(--navy);
}

.legend-range {
  background: var(--sky-mid);
  border: 1px solid var(--sky-mid);
}

.legend-free {
  background: var(--sky);
  border: 1px solid var(--border);
}

/* Panel de total */
.cal-total {
  margin-top: 20px;
  padding: 18px 20px;
  background: var(--sage-pale);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(123, 174, 142, 0.25);
}

.cal-total-dates {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text-mid);
  font-weight: 500;
}

.cal-total-price {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
}

/* =========================================================
   LIGHTBOX
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 40, 0.95);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-inner {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-inner img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.25);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  line-height: 1;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.25);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* =========================================================
   MODAL DE RESERVA
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 40, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 8000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 900px;
  max-height: 92vh;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

/* Layout 2 columnas */
.modal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
  flex: 1;
}

.modal-panel-left {
  background: var(--sand);
  padding: 40px 36px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.modal-panel-right {
  padding: 40px 36px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* La pantalla de éxito ocupa todo el modal */
#modalSuccessView {
  padding: 48px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sky);
  color: var(--text-mid);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--occupied);
  color: var(--white);
}

.modal-header {
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
}

.modal-dates {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--teal);
  font-weight: 600;
  background: var(--sage-pale);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  display: inline-block;
}

/* Formulario del modal */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.form-group label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.form-group input,
.form-group select,
.form-group textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--sky);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  background: var(--white);
  border-color: var(--teal);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-light);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: var(--occupied);
  background: rgba(224, 123, 84, 0.05);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Estado del formulario (éxito / error) */
.form-status {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  display: none;
}

.form-status.success {
  display: block;
  background: var(--sage-pale);
  color: var(--sage);
  border: 1px solid rgba(123, 174, 142, 0.3);
}

.form-status.error {
  display: block;
  background: rgba(224, 123, 84, 0.1);
  color: var(--occupied);
  border: 1px solid rgba(224, 123, 84, 0.25);
}

/* =========================================================
   RESUMEN DE RESERVA (dentro del modal)
   ========================================================= */
.booking-summary {
  background: var(--sky);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-dates-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.summary-date-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.summary-date-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}

.summary-date-val {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
}

.summary-arrow {
  font-size: 1rem;
  color: var(--teal);
  font-weight: 600;
  flex-shrink: 0;
}

.summary-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.summary-nights {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--text-mid);
}

.summary-total {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--teal);
}

/* ----- Error inline bajo campos del formulario ----- */
.field-error {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--occupied);
  margin-top: 3px;
  display: block;
}

/* =========================================================
   PANTALLA DE ÉXITO (dentro del modal)
   ========================================================= */
.success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px 8px 8px;
  text-align: center;
}

.success-icon {
  font-size: 3.5rem;
  line-height: 1;
  animation: successPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes successPop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.success-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text);
}

/* ── GDPR checkbox ── */
.gdpr-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.5;
}

.gdpr-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--teal);
  cursor: pointer;
}

.gdpr-label a {
  color: var(--teal);
  text-decoration: underline;
}

/* ── Botón de idioma ── */
#langToggle {
  font-size: 0.78rem;
  padding: 5px 12px;
  border: 1.5px solid var(--border);
}

/* ── Tabla de servicios extra (modal reserva) ── */
.services-table-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 10px;
}

.services-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
}

.services-table thead th {
  padding: 6px 10px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  border-bottom: 1.5px solid var(--border);
}

.services-table thead th:last-child { text-align: center; }

.services-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.services-table tbody tr:last-child { border-bottom: none; }
.services-table tbody tr:hover      { background: rgba(255,255,255,0.6); }

.services-table td {
  padding: 10px 10px;
  vertical-align: middle;
  color: var(--text);
}

.svc-icon-cell { font-size: 1.2rem; width: 32px; text-align: center; }

.svc-name-wrap { display: flex; flex-direction: column; gap: 2px; }
.svc-name      { font-weight: 600; }
.svc-desc      { font-size: 0.78rem; color: var(--text-light); }

.svc-price-cell {
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  text-align: right;
}

.svc-check-cell {
  text-align: center;
  width: 40px;
}

.svc-check-cell input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--teal);
}

.svc-check-cell input[type="checkbox"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.svc-badge-mandatory {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #D1F2E0;
  color: #1a7a45;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
}

.services-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1.5px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.success-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-mid);
  max-width: 380px;
}

/* =========================================================
   RESPONSIVE COMPONENTES
   ========================================================= */
@media (max-width: 768px) {
  /* Calendario */
  .calendar-card {
    padding: 20px 16px;
  }

  .cal-day {
    font-size: 0.8rem;
  }

  /* Modal responsive */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-card { max-height: 95vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .modal-layout { grid-template-columns: 1fr; }
  .modal-panel-left  { padding: 28px 24px 20px; border-right: none; border-bottom: 1px solid var(--border); }
  .modal-panel-right { padding: 20px 24px 32px; }

  .form-row--2 {
    grid-template-columns: 1fr;
  }

  /* Lightbox */
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }

  /* Precio */
  .price-card {
    padding: 18px 16px;
  }
}
