/**
 * Reload Stay — Single Stay Styles (Clean Card & Hospitality UX)
 * Estilos modernos para la ficha de hospedaje: Mosaico 5 fotos, Grid de comodidades,
 * Sidebar sticky de conversión, Lightbox modal a pantalla completa y Mobile Bottom Booking Bar.
 */

/* ── Contenedor General de la Ficha ── */
.stay-single-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  box-sizing: border-box;
  font-family: inherit;
  color: #1e293b;
}

/* ── Encabezado de la Ficha ── */
.stay-header {
  margin-bottom: 20px;
}
.stay-header__title {
  font-size: clamp(1.6rem, 1.3rem + 1.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  color: #0f172a;
  margin: 0 0 8px;
}
.stay-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: #64748b;
}
.stay-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: #334155;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.stay-badge--primary {
  background: #0f3b5c;
  color: #ffffff;
}

/* ── Mosaico de 5 Fotos (Patrón Airbnb / Listeo) ── */
.stay-gallery-mosaic {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: repeat(2, 210px);
  gap: 8px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 32px;
  position: relative;
}
.stay-gallery-mosaic__item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #e2e8f0;
}
.stay-gallery-mosaic__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.stay-gallery-mosaic__item:hover img {
  transform: scale(1.04);
}
.stay-gallery-mosaic__main {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}
.stay-gallery__btn-all {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.15);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.16);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  transition: all 0.2s ease;
}
.stay-gallery__btn-all:hover {
  background: #0f172a;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
}

/* Contador de fotos: Oculto en Desktop */
.stay-gallery__counter {
  display: none;
}

/* ── Slider Móvil (<= 768px) ── */
@media (max-width: 768px) {
  .stay-gallery-mosaic {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    grid-template-columns: none;
    grid-template-rows: none;
    height: 280px;
    border-radius: 12px;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .stay-gallery-mosaic__item {
    flex: 0 0 100%;
    scroll-snap-align: start;
    height: 100%;
  }
  .stay-gallery-mosaic__item:not(:first-child) {
    display: block;
  }
  .stay-gallery__counter {
    display: block;
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.72);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 5;
  }
  .stay-gallery__btn-all {
    display: none; /* En móvil se navega deslizando con el dedo */
  }
}

/* ── Lightbox Modal a Pantalla Completa (Airbnb Style) ── */
.stay-lightbox-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(8, 10, 14, 0.97) !important;
  z-index: 999999999 !important;
  display: none;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
  -webkit-user-select: none;
  animation: stayFadeIn 0.2s ease;
}
.stay-lightbox-overlay.is-open {
  display: flex !important;
}
@keyframes stayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.stay-lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  color: #ffffff;
  z-index: 10;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
  flex-shrink: 0;
}
.stay-lightbox-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stay-lightbox-prop-title {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
  max-width: 450px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stay-lightbox-counter {
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.stay-lightbox-close {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.stay-lightbox-close:hover {
  background: #ffffff;
  color: #0f172a;
  transform: scale(1.04);
}
.stay-lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 10px 24px;
  overflow: hidden;
  min-height: 0;
}
.stay-lightbox-figure {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  position: relative;
}
.stay-lightbox-figure img {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8);
  transition: opacity 0.15s ease;
}
.stay-lightbox-nav {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  flex-shrink: 0;
}
.stay-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
}
.stay-lightbox-nav svg {
  width: 24px;
  height: 24px;
}
/* Tira de Miniaturas Inferior */
.stay-lightbox-thumbs-bar {
  padding: 12px 24px 16px;
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  display: flex;
  justify-content: center;
  overflow-x: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}
.stay-lightbox-thumbs-track {
  display: flex;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  scrollbar-width: thin;
}
.stay-lb-thumb-btn {
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  padding: 0;
  background: transparent;
  cursor: pointer;
  flex: 0 0 54px;
  height: 42px;
  opacity: 0.55;
  transition: all 0.2s ease;
}
.stay-lb-thumb-btn:hover {
  opacity: 0.9;
}
.stay-lb-thumb-btn.is-active {
  border-color: #ef4444;
  opacity: 1;
  transform: scale(1.08);
}
.stay-lb-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  .stay-lightbox-prop-title { display: none; }
  .stay-lightbox-stage { padding: 8px 12px; }
  .stay-lightbox-nav {
    width: 42px;
    height: 42px;
    background: rgba(0, 0, 0, 0.6);
  }
  .stay-lightbox-thumbs-bar { display: none; /* En móvil ahorramos espacio vertical */ }
  .stay-lightbox-figure img {
    max-height: calc(100vh - 140px);
  }
}

/* ── Layout 2 Columnas (Contenido + Sidebar) ── */
.stay-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}
@media (min-width: 992px) {
  .stay-content-grid {
    grid-template-columns: 1fr 360px;
  }
}

/* ── Fila de Especificaciones Clave (Pills) ── */
.stay-specs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 0 24px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 24px;
}
.stay-spec-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #334155;
}
.stay-spec-item svg {
  width: 20px;
  height: 20px;
  stroke: #0f3b5c;
  fill: none;
}

/* ── Secciones del Contenido (Separaciones y Ritmo Limpio Estilo Listeo Pro) ── */
.stay-section {
  padding-top: 36px;
  margin-top: 36px;
  border-top: 1px solid #e2e8f0;
}
.stay-section:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.stay-section__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

/* ── Lo que este lugar ofrece (Grid 2 Columnas Estilo Listeo Pro) ── */
.stay-amenities-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 40px;
  margin-top: 12px;
}
@media (max-width: 640px) {
  .stay-amenities-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
.stay-amenity-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  font-size: 1rem;
  color: #1e293b;
}
.stay-amenity-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 1.25rem;
  color: #334155;
  flex-shrink: 0;
}
.stay-amenity-item__name {
  font-weight: 500;
  color: #1e293b;
  line-height: 1.4;
}

/* ── Desglose de Camas (Clean Modern Cards) ── */
.stay-beds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.stay-bed-box {
  padding: 18px 20px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.stay-bed-box:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.stay-bed-box__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.98rem;
  color: #0f172a;
  margin-bottom: 6px;
}
.stay-bed-box__sub {
  font-size: 0.88rem;
  color: #64748b;
}

/* ── Políticas y Normas (Tabla Estilo Listeo Pro) ── */
.stay-rules-table {
  border-top: 1px solid #f1f5f9;
  margin-top: 10px;
}
.stay-rule-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #f1f5f9;
}
.stay-rule-row__label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1rem;
  color: #1e293b;
  font-weight: 500;
}
.stay-rule-row__val {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}
.stay-rule-row__sub {
  font-size: 0.88rem;
  font-weight: 400;
  color: #64748b;
}
.stay-rule-icon {
  color: #475569;
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}
.stay-house-rules {
  margin-top: 24px;
}
.stay-house-rules__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 14px;
}
.stay-house-rules__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.stay-house-rules__list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
}
.stay-house-rules__list li::before {
  content: "•";
  position: absolute;
  left: 6px;
  color: #94a3b8;
  font-size: 1.1rem;
}
.stay-bed-box__sub {
  font-size: 0.85rem;
  color: #64748b;
}

/* ── Calendario de Disponibilidad (Zero-CLS & Smooth Preload) ── */
.stay-calendar-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px;
  margin-top: 14px;
  min-height: 480px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: min-height 0.2s ease;
}
.stay-calendar-box .r34ics {
  max-width: 100% !important;
}
.stay-calendar-box .r34ics-ajax-container.loading {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fafbfc;
  border-radius: 8px;
}

/* ── Sidebar Sticky de Conversión (Desktop) ── */
.site-header {
  z-index: 99999 !important;
}
.stay-sidebar-col {
  position: relative;
  height: 100%;
}
.stay-booking-card {
  position: -webkit-sticky;
  position: sticky;
  top: 195px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  z-index: 20;
  transition: top 0.2s ease;
}
body.admin-bar .stay-booking-card {
  top: 227px;
}
@media (min-width: 992px) and (max-width: 1050px) {
  .stay-booking-card {
    top: 85px;
  }
  body.admin-bar .stay-booking-card {
    top: 117px;
  }
}
@media (max-width: 991px) {
  .stay-booking-card {
    position: static;
    top: auto;
  }
}

/* ── Iconos Vectoriales Modernos (Font Awesome / SVG) ── */
.stay-icon-vector {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-right: 6px !important;
  font-size: 0.9em !important;
  color: var(--rn-primary, #01173f);
  vertical-align: -1px !important;
  line-height: 1 !important;
}
.stay-icon-vector.stay-icon--accent,
.stay-icon-vector.stay-icon--red {
  color: var(--rn-accent, #cc0000) !important;
}
.stay-icon-vector.stay-icon--green {
  color: #16a34a !important;
}
.stay-icon-vector.stay-icon--amber {
  color: #d97706 !important;
}
.stay-pricing-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}
.stay-price-amount {
  font-size: 1.9rem;
  font-weight: 800;
  color: #0f172a;
}
.stay-price-period {
  font-size: 0.95rem;
  color: #64748b;
}

/* Botones de Conversión */
.stay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 1.02rem;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  letter-spacing: -0.01em;
}
.stay-btn svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}
.stay-btn--whatsapp {
  background: #25d366;
  color: #ffffff !important;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}
.stay-btn--whatsapp:hover {
  background: #1ebd5b;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}
.stay-btn--airbnb {
  background: #ff385c;
  color: #ffffff !important;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(255, 56, 92, 0.35);
}
.stay-btn--airbnb:hover {
  background: #e00b41;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 56, 92, 0.45);
}
.stay-booking-note {
  font-size: 0.82rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 14px;
}

/* ── Sticky Bottom Bar en Móvil (<= 1050px) ── */
.stay-mobile-bottom-bar {
  display: none;
}
@media (max-width: 1050px) {
  body.single-job_listing {
    padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .stay-mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(68px + env(safe-area-inset-bottom, 0px));
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    z-index: 999995;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
  }
  .stay-mobile-bottom-bar__price {
    display: flex;
    flex-direction: column;
  }
  .stay-mobile-bottom-bar__amount {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
  }
  .stay-mobile-bottom-bar__sub {
    font-size: 0.75rem;
    color: #64748b;
  }
  .stay-mobile-bottom-bar__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25d366;
    color: #ffffff !important;
    padding: 11px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
    transition: all 0.2s ease;
  }
  .stay-mobile-bottom-bar__btn svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
  }
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
  }
}
