/* sticky-lead-top.css (COMPLETO) */

/* ---------- ESTADO GENERAL DEL STICKY ---------- */
.sticky-lead-top {
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  display: block;
  flex: none;
  height: auto;
  max-height: none;
}

.sticky-lead-top--hidden {
  display: none !important;
}

.sticky-lead-top--visible {
  display: block;
}

/* Ocultar el header SIN sacarlo del flujo (evita parpadeos) */
.hidden-small-when-stuck.c-gta4--region-header.is-hidden-by-sticky {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* ---------- LAYOUT BASE (común) ---------- */
.sticky-lead-top__buttons {
  display: flex;
  gap: 8px;
}

/* Alinear icono y texto del teléfono en la misma altura */
.sticky-lead-top__phone a,
.sticky-lead-top__phone .text-link,
.sticky-lead-top__phone .text-link__content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Ajuste fino del icono */
.sticky-lead-top__phone svg,
.sticky-lead-top__phone i {
  display: block;
}

/* =========================================================
   Left: desktop vs mobile
   ========================================================= */
.sticky-lead-top__left-mobile {
  display: none;
}

@media (max-width: 991px) {
  .sticky-lead-top__left-desktop {
    display: none !important;
  }
  .sticky-lead-top__left-mobile {
    display: block !important;
  }
}

/* ---------- DESKTOP (>= 992px) ---------- */
/* ✅ Desktop queda como estaba */
@media (min-width: 992px) {
  .sticky-top__container {
    position: relative;
    height: 80px; /* ajusta a la altura real del sticky */
  }

  .sticky-lead-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: max-content;
    padding: unset;
  }

  .sticky-lead-top__content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 8px 0px;
    flex-wrap: nowrap;
  }

  .sticky-lead-top__left {
    flex: 1 1 auto;
    min-width: 0;
  }

  .sticky-lead-top__right {
    flex: 0 1 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }

  .sticky-lead-top__price {
    flex: 0 0 auto;
    white-space: normal; /* ✅ el precio puede partir */
  }

  .sticky-lead-top__price * {
    white-space: normal;
  }

  .sticky-lead-top__buttons {
    margin-top: 0;
  }

  .sticky-lead-top__button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .sticky-lead-top__buttons,
  .sticky-lead-top__button,
  .sticky-lead-top__phone {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  /* ✅ En desktop NO mostramos el teléfono inline de móvil */
  .sticky-lead-top__phone--mobile-inline {
    display: none !important;
  }
}

/* ---------- MOBILE (< 992px) ---------- */
/* ✅ En móvil: grid 2x2 (title/price arriba, botones abajo) */
@media (max-width: 991px) {
  .sticky-lead-top {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
    background-color: #fff;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.08);
    padding: 0rem 0px !important;
  }
  .sticky-lead-top.sticky-lead-top--visible .sticky-lead-top__right .display-price--s .display-price__price {
    font-size: 1.5rem;
  }
  .sticky-lead-top__content {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "title price"
      "buttons buttons";
    column-gap: 12px;
    row-gap: 8px;
    align-items: center;
    padding: 16px 0px;
  }

  /* Título */
  .sticky-lead-top__left {
    grid-area: title;
  }

  /* El wrapper derecho no interfiere */
  .sticky-lead-top__right {
    display: contents;
  }

  /* Precio en el área price */
  .sticky-lead-top__price {
    grid-area: price;
    justify-self: end;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
  }

  /* Botones ocupando toda la fila inferior */
  .sticky-lead-top__buttons {
    grid-area: buttons;
    display: flex;
    gap: 8px;
    width: 100%;
    align-items: center;
  }

  /* Default: si no hay teléfono inline, los botones se reparten */
  .sticky-lead-top__button {
    flex: 1 1 0;
    white-space: normal;
  }

  /* En móvil ocultamos el teléfono desktop */
  .sticky-lead-top__phone--desktop {
    display: none !important;
  }

  /* Teléfono inline (a la derecha del botón) */
  .sticky-lead-top__phone--mobile-inline {
    display: none;          /* por defecto oculto */
    white-space: nowrap;
    align-items: center;
  }

  /* ✅ Cuando mostramos teléfono en móvil: 50% botón + 50% teléfono */
  .sticky-lead-top--mobile-show-phone .sticky-lead-top__buttons {
    width: 100%;
  }

  .sticky-lead-top--mobile-show-phone .sticky-lead-top__button {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .sticky-lead-top--mobile-show-phone .sticky-lead-top__phone--mobile-inline {
    display: inline-flex !important;
    flex: 0 0 50%;
    max-width: 50%;
    justify-content: center; /* ✅ alinea icono+número a la derecha */
  }

  /* Por si el componente interno intenta ocupar 100% */
  .sticky-lead-top--mobile-show-phone .sticky-lead-top__phone--mobile-inline .text-link,
  .sticky-lead-top--mobile-show-phone .sticky-lead-top__phone--mobile-inline a {
    width: auto;
  }

  /* Ocultar anchors-menu en sticky mobile */
  .sticky-lead-top__left .anchors-menu,
  .sticky-lead-top__left nav,
  .sticky-lead-top__left ul {
    display: none !important;
  }

  .sticky-lead-top__left {
    display: block;
  }

  .btn--small {
    padding: 0.5rem 0.5rem !important;
    width: 100% !important;
  }

  footer,
  .layout-footer,
  .region-footer {
    padding-bottom: 150px;
  }
}

/* =========================================================
   PRODUCTO + ANCLAS — DESKTOP (una sola línea, salvo precio)
   ========================================================= */
@media (min-width: 992px) {
  .sticky-lead-top__left .anchors-menu,
  .sticky-lead-top__left nav,
  .sticky-lead-top__left ul {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .sticky-lead-top__left li {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}