/* ==========================================================
   Habitaciones Card (room-type card)
   - Independent component (CSS-only, no external libs)
   - Mobile-first, premium, and easy to extend later
   ========================================================== */

:root{
  --habCard-bg: rgba(255,255,255,.86);
  --habCard-border: rgba(31,58,51,.14);
  --habCard-line: rgba(34,34,34,.12);
  --habCard-shadow: var(--shadow-soft, 0 10px 26px rgba(0,0,0,.08));
  --habCard-shadow-top: none; /* ✅ sin sombra superior */
  --habCard-radius: 22px;
  --habCard-gutter: var(--gutter, 16px);
}

/* Mount wrapper (keeps index.html to a single “mount line”) */
.habitacionesGrid{
  display: grid;
  gap: 14px;
  margin-top: 0px;
  margin-bottom: 0px; /* 👈 espacio bajo la última card */
}

@media (min-width: 861px){
  .habitacionesGrid{
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* ==========================================================
   HERO placement
   - In the hero we want the 2 cards stacked (one under the other)
   ========================================================== */
/* Fondo sólido detrás de los espacios (márgenes + gaps) */
.heroRooms{
  margin-top: 0px;       /* el margen no se pinta */
  padding-top: 0px;      /* mismo espacio, pero ahora sí se ve el fondo */
  background: #eaeee6; /* liso, fijo, sin gradientes */
}

/* Full-bleed SOLO en móvil: hace que el inner container salga del .container y ocupe 100vw */
@media (max-width: 860px){
  .heroRooms__inner.container{
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: #eaeee6; /* asegura color sólido a todo lo ancho */
    padding-left: var(--habCard-gutter);
    padding-right: var(--habCard-gutter);
  }
}


.heroRooms [data-habitaciones]{
  background: #eaeee6;
  display: flow-root; /* evita colapso del margin-top del grid */
}

.heroRooms .habitacionesGrid{
  background: #eaeee6; /* el gap (espacio entre tarjetas) muestra este color */
}

@media (min-width: 861px){
  .heroRooms .habitacionesGrid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px; /* row-gap 14px, column-gap 10px */
  }
}

/* ✅ Desktop-only: el fondo detrás de las cards de habitaciones también se unifica */
@media (min-width: 861px){
  .heroRooms,
  .heroRooms [data-habitaciones],
  .heroRooms .habitacionesGrid{
    background: var(--page-bg, #f4f7ee);
  }
}


/* Edge-to-edge feel on mobile, matching the site’s main card treatment */
@media (max-width: 860px){
  .habitacionesGrid{
    margin-left: calc(var(--habCard-gutter) * -1);
    margin-right: calc(var(--habCard-gutter) * -1);
  }
}

.habCard{
  background: var(--habCard-bg);

  /* Borde perfecto tipo FAQ/Contact */
  border: 1px solid rgba(31,58,51,.14);

  /* Si quieres un pelín más “línea superior”, deja esto en 2px.
     Si lo quieres idéntico a FAQ, ponlo en 1px. */
  border-top-width: 1px;

  /* Para que las esquinas se vean “perfectas” también abajo */
  border-radius: var(--habCard-radius) var(--habCard-radius) 0 0; /* solo arriba redondeado */

  overflow: hidden;
    box-shadow: var(--habCard-shadow);
}


/* =============================
   Menu-tarjeta-superior
   ============================= */
.habCard__top.menu-tarjeta-superior{
  display: flex;
  gap: 12px;
  align-items: center;      /* como el topbar */
  padding: 14px 14px 6px;   /* menos alto => descripción más cerca */
}

.habCard__logo{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  flex: 0 0 auto;
  object-fit: cover;
  display: block;

  /* Igual que el logo del topbar */
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.6);

  transform: translateY(-2px); /* ajusta -1px, -2px, -3px según lo veas */
}


.habCard__head{
  min-width: 0;
  flex: 1 1 auto;
}

.habCard__title{
  margin: 0;
  font-family: var(--font-sans, inherit);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 1.06rem; /* matches .brand__name */
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.habCard__meta{
  margin-top: 2px;
  font-size: .88rem; /* matches .brand__tag */
  color: var(--muted, rgba(34,34,34,.65));
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =============================
   Descripción + Ver más
   ============================= */
.habCard__descWrap{
  padding: 6px 14px 12px; /* +3px entre meta y description */
  display: flow-root;

  /* Fuente/altura de la descripción (para que el botón use la MISMA métrica) */
  --desc-size: .98rem;
  --desc-lh: 1.28;
  --desc-line: calc(var(--desc-size) * var(--desc-lh)); /* 1 línea real */
}


.habCard__desc{
  margin: 0;

  font-family: var(--font-sans);
  font-size: var(--desc-size);
  font-weight: 400;
  letter-spacing: 0;

  --desc-lh: 1.28;
  line-height: var(--desc-lh);

  color: var(--muted);
}



/* Colapsado: 2 líneas visibles */
.habCard:not(.is-expanded) .habCard__desc{
  min-width: 0;

  overflow: hidden;
  white-space: normal;

  max-height: calc(2 * var(--desc-line));
}



.habCard__more{
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(34,34,34,.55);
  font-weight: 600;
  font-size: .92rem; /* prueba .90–.95 */
  cursor: pointer;
  padding: 4px 2px;  /* default */
  border-radius: 10px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.habCard__more:hover{ opacity: .92; }
.habCard__more:active{ transform: scale(.98); }

.habCard__more:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(15,183,166,.22);
}

/* Colapsado: “Ver más” alineado con la 2ª línea y sin robar ancho a la 1ª */
.habCard:not(.is-expanded) .habCard__more{
  float: right;
  margin-left: 8px;

  /* Arranca DESPUÉS de la 1ª línea real de la descripción */
  margin-top: calc(var(--desc-line) + 1px);

  /* Que su “caja” mida exactamente 1 línea de la descripción */
  height: var(--desc-line);

  /* Para centrar el texto dentro de esa caja */
  display: inline-flex;
  align-items: center;

  padding: 0 2px;
  white-space: nowrap;
}



/* Expandido: el botón va debajo del párrafo */
.habCard.is-expanded .habCard__descWrap{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

/* En expanded el DOM tiene el botón antes del <p>, así que ordenamos visualmente */
.habCard.is-expanded .habCard__desc{ order: 1; }

.habCard.is-expanded .habCard__more{
  order: 2;
  float: none;
  display: inline-flex;
  margin-top: 0;
  height: auto;
  line-height: normal;
  padding: 4px 2px;
  background: transparent;
}

.habCard.is-expanded .habCard__desc{
  display: block;
  overflow: visible;
  max-height: none;
  padding-right: 0;
}

/* =============================
   Zona de visualización (1:1)
   ============================= */
.habCard__media{
  border-top: 0;
  border-bottom: 0;
}

.habCard__mediaInner{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15,183,166,.14), rgba(47,125,232,.10)),
    radial-gradient(420px 320px at 20% 20%, rgba(241,194,123,.18), transparent 60%);
}

.habCard__mediaInner img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.habCard__mediaPh{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  color: rgba(34,34,34,.72);
  font-weight: 900;
}

.habCard__mediaPh small{
  display: block;
  margin-top: 8px;
  font-weight: 800;
  color: rgba(34,34,34,.58);
}

/* =============================
   Menu-tarjeta-inferior
   ============================= */
.habCard__bottom.menu-tarjeta-inferior{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 19px; /* +5px izquierda/derecha (14 -> 19) */
  background: #336633;
  color: #ffffff;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.habCard__bottom.menu-tarjeta-inferior:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,0,0,.22) inset; /* focus ring oscuro, cero “blanco” */
}

.habCard__bottom.menu-tarjeta-inferior:visited{
  color: #ffffff;
}

/* Two-line WhatsApp CTA (left-aligned) */
.habCard__bottomLeft{
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px; /* antes 2px */
}

.habCard__bottomPrimary,
.habCard__bottomSecondary{
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.habCard__bottomPrimary{
  font-size: 1rem;
  font-weight: 500; /* grosor del texto reservar via WhatsApp antes 950 */
  line-height: 1.05;
}

.habCard__bottomSecondary{
  /* matches .habCard__meta size */
  font-size: .76rem;   /* antes .88rem: un pelín más pequeña */
  font-weight: 500;
  line-height: 1.25; /* antes 1.05 */
  padding-bottom: 1px;      /* evita el “corte” de la g/p/y */
  color: rgba(255,255,255,.86);
}

.habCard__bottomChev{
  font-size: 1.5em;
  line-height: 1.5;
  font-weight: 900;
}



.habCard__cta{
  min-width: 0;
}

.habCard__ctaLabel{
  font-size: .80rem;
  font-weight: 950;
  letter-spacing: .10em;
  color: rgba(34,34,34,.58);
  text-transform: uppercase;
}

.habCard__ctaTitle{
  margin-top: 2px;
  font-size: 1.28rem;
  font-weight: 950;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.habCard__waBtn{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: 14px 18px;
  border-radius: 18px;

  border: 1px solid rgba(18,140,126,.22);
  background: #128C7E;
  color: #ffffff;

  font-weight: 950;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  box-shadow: 0 14px 30px rgba(18,140,126,.18);
  transition: transform .18s ease, opacity .18s ease, filter .18s ease;
}

.habCard__waBtn:hover{ filter: brightness(1.03); }
.habCard__waBtn:active{ transform: scale(.98); opacity: .96; }

.habCard__waBtn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(15,183,166,.22), 0 14px 30px rgba(18,140,126,.18);
}

.habCard__waIcon{
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

@media (prefers-reduced-motion: reduce){
  .habCard__waBtn,
  .habCard__more{
    transition: none;
  }
}
