/* Publicidad limitada a negocios: columnas en flujo que reservan espacio al abrirse. */
.promoted-layout {
  display: flex;
  align-items: stretch;
  position: relative;
  isolation: isolate;
}
.promoted-layout__content {
  flex: 1;
  min-width: 0;
  width: auto;
}
.side-promo {
  position: relative;
  --promo-width: 14rem;
  flex: 0 0 var(--promo-width);
  transition: flex-basis .32s ease;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
/* El ancho reservado se anima hasta cero: no deja franja ni salta el contenido. */
.side-promo:not(.is-open) { flex-basis: 0; z-index: 5; }

.side-promo__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  color: #0b285b;
  background: #f8faff;
  border: 0.0625rem solid #dce6f2;
  box-shadow: 0 0 1rem #05234112;
}
.side-promo__header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
}
.side-promo__header h2 {
  font-size: 0.75rem;
  line-height: 1.4;
}
.side-promo__close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: inherit;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  font-size: 1.25rem;
}
/* Lista desplazable: mantiene la altura y separación de las tarjetas. */
.side-promo__list {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2rem;
  padding: 0 0.75rem 0.75rem;
}
.side-promo__tab {
  position: absolute;
  top: 5rem;
  width: 2.5rem;
  min-height: 8rem;
  padding: 0.65rem 0.5rem;
  border: 0;
  background: #087ef0;
  color: var(--color-white);
  writing-mode: vertical-rl;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  z-index: 2;
}
.side-promo--left .side-promo__tab {
  left: 0;
}
.side-promo--right .side-promo__tab {
  right: 0;
}
.side-promo__tab { transition: opacity .2s ease, visibility .2s; }
.side-promo.is-open .side-promo__tab { opacity: 0; visibility: hidden; pointer-events: none; }
.side-promo__ad {
  position: relative;
  flex-shrink: 0;
  min-height: 23rem;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  color: white;
  background: #122a3c;
}
.side-promo__ad > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.side-promo__ad::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #071522b8, #07152225 65%, #071522b8);
}
.side-promo__ad > :not(img) {
  position: relative;
  z-index: 1;
}
.side-promo__label {
  align-self: flex-start;
  background: #0006;
  border-radius: 1rem;
  padding: 0.2rem 0.45rem;
  font-size: 0.6rem;
  margin-bottom: 1.5rem;
}
.side-promo__brand {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.15;
}
.side-promo__ad h3 {
  font-size: 1.45rem;
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin-block: 1rem 0.5rem;
}
.side-promo__ad p {
  font-size: 0.75rem;
  margin-bottom: 2rem;
}
.side-promo__link {
  margin-top: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.6rem 0.5rem;
  border-radius: 2rem;
  background: #087ef0;
  color: white;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
}
.side-promo__ad--coffee .side-promo__link {
  background: #925723;
}
.side-promo__ad--home .side-promo__link {
  background: #785334;
}
.side-promo__ad--garden .side-promo__link {
  background: #267331;
}
.side-promotions :is(a, button):focus-visible {
  outline: 0.1875rem solid #ffc869;
  outline-offset: -0.1875rem;
}

/* Se conserva el ancho anterior sin convertir los paneles en una superposición. */
@media (max-width: 99.999rem) {
  .side-promo { --promo-width: min(15rem, 80vw); }
}

/* En teléfonos se muestra únicamente la publicidad del lado izquierdo.
   Laptop y escritorio conservan ambos lados. */
@media (max-width: 40rem) {
  .side-promo--right { display: none; }
}

/* El contenido publicitario no determina la altura de la página: las secciones de negocios la definen.
   Esto evita que añadir anuncios aumente la altura y provoque un relleno infinito. */
.side-promo__body { position: absolute; inset: 0; min-height: 0; }
.side-promo__list { min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }

/* La tarjeta mantiene su ancho durante la transición. La cortina sale hacia su borde.
   visibility se retrasa al cerrar para permitir la animación; inert lo controla JS. */
.side-promo__body { width: var(--promo-width); left: 0; right: auto; clip-path: inset(0); opacity: 1; visibility: visible; transition: clip-path .32s ease, opacity .32s ease, visibility 0s; }
.side-promo--right .side-promo__body { left: auto; right: 0; }
.side-promo:not(.is-open) .side-promo__body { opacity: 0; visibility: hidden; pointer-events: none; transition: clip-path .32s ease, opacity .32s ease, visibility 0s .32s; }
.side-promo--left:not(.is-open) .side-promo__body { clip-path: inset(0 100% 0 0); }
.side-promo--right:not(.is-open) .side-promo__body { clip-path: inset(0 0 0 100%); }
.side-promo.is-open .side-promo__body, .side-promo:not(.is-open) .side-promo__tab { pointer-events: auto; }
/* Respeta la preferencia del usuario por reducir movimiento. */
@media (prefers-reduced-motion: reduce) {
  .side-promo, .side-promo__body, .side-promo:not(.is-open) .side-promo__body, .side-promo__tab { transition: none; }
}

/* El contenedor mide el espacio real entre paneles. La especificidad adicional
   impide que los CSS de secciones, cargados después, anulen estas reglas. */
.promoted-layout__content { container-type: inline-size; overflow-wrap: normal; }
/* Flexbox cambia automáticamente de fila antes de comprimir una tarjeta.
   Conserva cuatro columnas con espacio suficiente y reduce a tres, dos o una. */
.promoted-layout__content .businesses__grid { display: flex; flex-wrap: wrap; }
/* Tope de ancho: una tarjeta filtrada no se estira sobre toda la fila. */
.promoted-layout__content .business-card { flex: 1 1 14rem; min-width: 0; max-width: min(100%, 18rem); }
.promoted-layout__content .business-card__name { overflow-wrap: break-word; }
.promoted-layout__content .business-card__rating { flex-wrap: wrap; }
.promoted-layout__content .business-card__stars,
.promoted-layout__content .business-card__rating-value,
.promoted-layout__content .business-card__reviews { white-space: nowrap; }
@container (max-width: 60rem) {
  .promoted-layout__content .business-directory__container { display: flex; flex-direction: column; }
  .promoted-layout__content .business-directory__results { width: 100%; }
  .promoted-layout__content .business-directory__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .promoted-layout__content .businesses__header { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
@container (max-width: 34rem) {
  .promoted-layout__content .business-directory__grid { grid-template-columns: minmax(0, 1fr); }
  .promoted-layout__content .business-directory__filters { min-width: 0; width: 100%; }
  .promoted-layout__content .directory-card { display: flex; flex-direction: column; }
  .promoted-layout__content .directory-card__image { width: 100%; }
}
/* En teléfonos, conservar el ancho del anuncio y una tarjeta legible requiere
   desplazamiento horizontal del bloque, en lugar de aplastar el contenido. */
@media (max-width: 40rem) {
  .promoted-layout { overflow-x: auto; }
  .promoted-layout__content { min-width: min(18rem, 90vw); }
}
