/**
 * Calendario doble (misma familia visual que detalle-propiedad-alquiler-vaca).
 * Ámbito: popover del hero vacacional en home-view.php
 */
.hero-vaca-calendar-pop {
  --primary: #0f766e;
  --border: #e2e8f0;
  --muted: #64748b;
  box-sizing: border-box;
  font-family: "Inter", system-ui, sans-serif;
  text-align: left;
  background: #fff;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  padding: 16px 16px 12px;
  max-width: min(920px, calc(100vw - 24px));
  max-height: min(90vh, 640px);
  overflow-y: auto;
  margin-left: auto;
  margin-right: auto;
  z-index: 200;
  -webkit-overflow-scrolling: touch;
}

.hero-vaca-calendar-pop[hidden] {
  display: none !important;
}

.hero-vaca-calendar-pop .calendario-reserva-layout {
  display: block;
  margin: 0;
}

.hero-vaca-calendar-pop .calendario-reserva-layout #hero-calendario-reserva-container,
.hero-vaca-calendar-pop #hero-calendario-reserva-container {
  min-width: 0;
}

.hero-vaca-calendar-pop .calendario-reserva-doble {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 0;
}

.hero-vaca-calendar-pop .mes-calendario {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.hero-vaca-calendar-pop .mes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hero-vaca-calendar-pop .mes-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
}

.hero-vaca-calendar-pop .mes-header button {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  color: #334155;
}

.hero-vaca-calendar-pop .mes-header button:hover:not(:disabled) {
  background: #f1f5f9;
}

.hero-vaca-calendar-pop .mes-header button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.hero-vaca-calendar-pop .calendario-grid-reserva {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.hero-vaca-calendar-pop .dia-header-reserva {
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  padding: 6px 2px;
}

.hero-vaca-calendar-pop .dia-reserva {
  min-height: 48px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  padding: 4px 2px;
  box-sizing: border-box;
}

.hero-vaca-calendar-pop .dia-reserva-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  text-align: center;
  line-height: 1.1;
}

.hero-vaca-calendar-pop .dia-reserva .dia-num {
  font-size: 13px;
  font-weight: 800;
}

.hero-vaca-calendar-pop .dia-reserva .dia-precio {
  display: none;
}

.hero-vaca-calendar-pop .dia-reserva.dia-reserva--base:not(.past):not(.no-disponible):not(.seleccionado):not(.en-rango) {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.hero-vaca-calendar-pop .dia-reserva.empty {
  border: none;
  background: transparent;
  cursor: default;
}

.hero-vaca-calendar-pop .dia-reserva.past {
  opacity: 0.3;
  cursor: not-allowed;
  background: #f5f5f5;
}

.hero-vaca-calendar-pop .dia-reserva.no-disponible {
  background: #f8d7da;
  border-color: #dc3545;
  cursor: not-allowed;
  color: #721c24;
}

.hero-vaca-calendar-pop .dia-reserva.seleccionado {
  background: #667eea;
  color: #fff;
  border-color: #667eea;
}

.hero-vaca-calendar-pop .dia-reserva.en-rango {
  background: rgba(102, 126, 234, 0.2);
  border-color: #667eea;
}

.hero-vaca-calendar-pop .dia-reserva:not(.past):not(.no-disponible):hover {
  transform: scale(1.04);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.hero-vaca-cal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.hero-vaca-cal-btn-secondary {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
}

.hero-vaca-cal-btn-secondary:hover {
  background: #e2e8f0;
}

/* Contenedor: el pop se posiciona bajo el bloque de fechas */
#hero-dates.hero-dates--vacacional {
  position: relative;
  z-index: 6;
  width: 100%;
  justify-content: center;
  align-items: flex-end;
}

#hero-dates .hero-vaca-calendar-pop {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 10px;
  width: 100%;
}

.hero-date-field {
  min-width: 168px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  font-size: 15px;
  min-height: 48px;
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.hero-date-field:hover {
  border-color: #0f766e;
}

@media (max-width: 768px) {
  .hero-vaca-calendar-pop .calendario-reserva-doble {
    grid-template-columns: 1fr;
  }

  .hero-date-field {
    min-width: 0;
    width: 100%;
  }

  /* RESPONSIVE MOBILE — inicio
   * Hero vacacional calendar: WCAG AA, paleta Kasalia (pine/ink/sage/paper),
   * un mes visible, flechas ‹ Mes › en una fila (display:contents + grid; las flechas
   * viven en headers distintos — order CSS no basta), sin overflow 100vw.
   * Tokens locales --rwd-cal-* (no redefinen --primary/--muted Desktop).
   * Fallback hex = --pine / --ink / --sage / --paper de index-casa-panel (esta vista no los carga).
   */
  .hero-vaca-calendar-pop {
    --rwd-cal-brand: var(--pine, var(--ag-accent-dark, #174f2b));
    --rwd-cal-ink: var(--ink, #172016);
    --rwd-cal-surface: var(--white, #fff);
    --rwd-cal-brand-soft: color-mix(in srgb, var(--rwd-cal-brand) 22%, var(--rwd-cal-surface));
    --rwd-cal-past-bg: var(--paper, #fbfaf4);
    --rwd-cal-on-brand: var(--white, #fff);
    --rwd-cal-muted: color-mix(in srgb, var(--rwd-cal-ink) 72%, var(--rwd-cal-surface));
    --rwd-cal-line: color-mix(in srgb, var(--rwd-cal-brand) 22%, var(--rwd-cal-surface));
    --rwd-cal-hit: 44px;
    color: var(--rwd-cal-ink);
    text-shadow: none;
    box-sizing: border-box;
    padding: var(--rwd-space-xxs, 4px);
    max-width: 100%;
    max-height: min(80vh, 560px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  #hero-dates .hero-vaca-calendar-pop {
    left: 0;
    right: 0;
    transform: none;
    width: auto;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* ‹ título › + grid: display:contents sube botones/h4/grid al wrapper (Nivel 1). */
  .hero-vaca-calendar-pop .calendario-reserva-doble {
    display: grid;
    grid-template-columns: var(--rwd-cal-hit) minmax(0, 1fr) var(--rwd-cal-hit);
    grid-template-rows: auto auto;
    gap: 0;
    min-width: 0;
  }

  .hero-vaca-calendar-pop .mes-calendario {
    display: contents;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .hero-vaca-calendar-pop .mes-header {
    display: contents;
  }

  .hero-vaca-calendar-pop .mes-calendario:first-child .mes-header > button {
    grid-column: 1;
    grid-row: 1;
  }

  .hero-vaca-calendar-pop .mes-calendario:first-child .mes-header h4 {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    text-align: center;
    color: var(--rwd-cal-ink);
    font-size: var(--rwd-font-sm, 14px);
    margin: 0;
  }

  .hero-vaca-calendar-pop .mes-calendario:first-child .calendario-grid-reserva {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: var(--rwd-space-xs, 8px);
  }

  .hero-vaca-calendar-pop .mes-calendario:nth-child(2) .mes-header > button {
    grid-column: 3;
    grid-row: 1;
  }

  .hero-vaca-calendar-pop .mes-calendario:first-child .mes-header > div,
  .hero-vaca-calendar-pop .mes-calendario:nth-child(2) .mes-header > div,
  .hero-vaca-calendar-pop .mes-calendario:nth-child(2) .mes-header h4,
  .hero-vaca-calendar-pop .mes-calendario:nth-child(2) .calendario-grid-reserva {
    display: none;
  }

  .hero-vaca-calendar-pop .mes-header button {
    width: var(--rwd-cal-hit);
    height: var(--rwd-cal-hit);
    min-width: var(--rwd-cal-hit);
    min-height: var(--rwd-cal-hit);
    color: var(--rwd-cal-ink);
  }

  .hero-vaca-calendar-pop .mes-header button:disabled {
    opacity: 0.45;
  }

  .hero-vaca-calendar-pop .calendario-grid-reserva {
    gap: 0;
    min-width: 0;
  }

  .hero-vaca-calendar-pop .dia-header-reserva {
    color: var(--rwd-cal-muted);
    padding: var(--rwd-space-xxs, 4px) 0;
    font-size: var(--rwd-font-xs, 12px);
  }

  .hero-vaca-calendar-pop .dia-reserva {
    min-width: 0;
    min-height: var(--rwd-cal-hit);
    height: var(--rwd-cal-hit);
    border-width: 1px;
    border-radius: var(--rwd-space-xxs, 4px);
    color: var(--rwd-cal-ink);
    font-size: var(--rwd-font-base, 16px);
    background: var(--rwd-cal-surface);
  }

  .hero-vaca-calendar-pop .dia-reserva .dia-num {
    color: var(--rwd-cal-ink);
    font-size: var(--rwd-font-base, 16px);
    font-weight: 800;
    line-height: var(--rwd-line-height-base, 1.4);
    text-shadow: none;
    -webkit-text-fill-color: currentColor;
  }

  .hero-vaca-calendar-pop .dia-reserva.dia-reserva--base:not(.past):not(.no-disponible):not(.seleccionado):not(.en-rango) {
    background: var(--rwd-cal-surface);
    border-color: var(--rwd-cal-line);
    color: var(--rwd-cal-ink);
  }

  .hero-vaca-calendar-pop .dia-reserva.seleccionado {
    background: var(--rwd-cal-brand);
    border-color: var(--rwd-cal-brand);
    color: var(--rwd-cal-on-brand);
  }

  .hero-vaca-calendar-pop .dia-reserva.seleccionado .dia-num {
    color: var(--rwd-cal-on-brand);
    -webkit-text-fill-color: currentColor;
  }

  .hero-vaca-calendar-pop .dia-reserva.en-rango {
    background: var(--rwd-cal-brand-soft);
    border-color: color-mix(in srgb, var(--rwd-cal-brand) 35%, var(--rwd-cal-surface));
    color: var(--rwd-cal-ink);
  }

  .hero-vaca-calendar-pop .dia-reserva.en-rango .dia-num {
    color: var(--rwd-cal-ink);
    -webkit-text-fill-color: currentColor;
  }

  .hero-vaca-calendar-pop .dia-reserva.past {
    opacity: 1;
    background: var(--rwd-cal-past-bg);
    border-color: color-mix(in srgb, var(--rwd-cal-muted) 28%, var(--rwd-cal-surface));
    color: var(--rwd-cal-muted);
    cursor: not-allowed;
  }

  .hero-vaca-calendar-pop .dia-reserva.past .dia-num {
    color: var(--rwd-cal-muted);
    font-size: var(--rwd-font-sm, 14px);
    font-weight: 700;
    -webkit-text-fill-color: currentColor;
  }

  .hero-vaca-calendar-pop .dia-reserva.no-disponible {
    background: color-mix(in srgb, var(--rwd-cal-ink) 8%, var(--rwd-cal-surface));
    border-color: color-mix(in srgb, var(--rwd-cal-ink) 22%, var(--rwd-cal-surface));
    color: var(--rwd-cal-muted);
  }

  .hero-vaca-calendar-pop .dia-reserva.no-disponible .dia-num {
    color: var(--rwd-cal-muted);
    text-decoration: line-through;
    -webkit-text-fill-color: currentColor;
  }

  .hero-vaca-calendar-pop .dia-reserva:not(.past):not(.no-disponible):hover {
    transform: none;
  }

  .hero-vaca-cal-footer {
    justify-content: stretch;
    margin-top: var(--rwd-space-xs, 8px);
    padding-top: var(--rwd-space-xs, 8px);
    border-top-color: var(--rwd-cal-line);
  }

  .hero-vaca-cal-btn-secondary {
    width: 100%;
    min-height: var(--rwd-cal-hit);
    box-sizing: border-box;
    color: var(--rwd-cal-ink);
    background: var(--rwd-cal-surface);
    border-color: color-mix(in srgb, var(--rwd-cal-brand) 28%, var(--rwd-cal-surface));
  }
  /* RESPONSIVE MOBILE — fin */
}
