/* ==========================================================================
   PREMIUM LAYER — se carga después de main.css (no lo modifica)
   Barra de progreso, estado "abierto ahora", mapa en escala de grises,
   panel de contacto único, footer con datos, detalles de acabado.
   ========================================================================== */
::selection {
  background: var(--c-red);
  color: #fff
}

html {
  scroll-padding-top: 84px
}

/* Barra de progreso de lectura */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--c-red);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 300;
  pointer-events: none
}

/* Header de un solo nivel (sin barra de utilidades) */
.hero__inner {
  padding-top: calc(var(--header-h) + 3.5rem)
}

.header-inner {
  transition: height .3s var(--ease)
}

.site-header.is-scrolled .header-inner {
  height: 62px
}

.brand img {
  height: 44px;
  width: auto
}

.site-header.is-scrolled .brand img {
  height: 38px
}

.brand img {
  transition: height .3s var(--ease)
}

/* Logo en footer: si no hay versión clara, se invierte a blanco */
.site-footer .brand:not(.brand--light) img {
  filter: brightness(0) invert(1)
}

/* Hero: movimiento muy lento en la foto */
.hero__bg img {
  animation: kb 28s ease-in-out infinite alternate;
  transform-origin: 68% 50%
}

@keyframes kb {
  from {
    transform: scale(1)
  }

  to {
    transform: scale(1.07)
  }
}

/* Tarjetas: degradé inferior para legibilidad del número + estado */
.branch__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, .5), transparent 55%);
  pointer-events: none
}

.branch__num {
  z-index: 2
}

.status {
  position: absolute;
  top: .8rem;
  left: .8rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255, 255, 255, .96);
  color: var(--c-black);
  padding: .38rem .85rem;
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: var(--fw-bold);
  letter-spacing: .02em
}

.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9a9a9a;
  flex: none
}

.status--open i {
  background: #1faa59;
  animation: pulse 2s infinite
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 170, 89, .55)
  }

  70% {
    box-shadow: 0 0 0 7px rgba(31, 170, 89, 0)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(31, 170, 89, 0)
  }
}

/* Mapa: tiles en escala de grises para que resalten los pines rojos */
.map--gray .leaflet-tile-pane {
  filter: grayscale(1) contrast(1.05) brightness(1.03)
}

.leaflet-popup-content {
  width: 220px !important
}

.pop__img {
  display: block;
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: .75rem
}

/* Contacto: un solo panel con un solo CTA */
.contact {
  background: #fff
}

.contact::after {
  display: none
}

.contact__box {
  position: relative;
  overflow: hidden;
  background: var(--c-red);
  color: #fff;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: clamp(2rem, 5vw, 4.2rem);
  padding-top: clamp(2.6rem, 5.5vw, 4.6rem);
  border-radius: 0 var(--radius-frame) var(--radius-frame) var(--radius-frame);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut))
}

.contact__box::after {
  content: "";
  position: absolute;
  right: -10%;
  top: -70%;
  width: 540px;
  height: 540px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .2);
  box-shadow: 0 0 0 70px rgba(255, 255, 255, .05);
  pointer-events: none
}

.contact__box>div {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .9rem;
  align-content: center
}

.contact__box .eyebrow {
  color: #fff
}

.contact__box .eyebrow::before {
  background: #fff
}

.contact__box .lead {
  color: rgba(255, 255, 255, .93)
}

.contact__actions {
  justify-items: start
}

.contact .btn--white svg {
  color: #25D366
}

.contact__hint {
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .85
}

/* Footer: sucursales con dirección y teléfono (sin repetir WhatsApp) */
.footer-grid {
  grid-template-columns: 1fr 2fr
}

.footer-branches ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem
}

.fb strong {
  display: block;
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: .45rem
}

.fb span,
.fb a {
  display: block;
  font-size: .92rem;
  line-height: 1.55
}

.social a svg {
  width: 18px;
  height: 18px
}

@media (max-width:860px) {
  .contact__box {
    grid-template-columns: 1fr
  }

  .footer-grid {
    grid-template-columns: 1fr
  }

  .footer-branches ul {
    grid-template-columns: 1fr
  }

  .brand img {
    height: 38px
  }
}

/* Especificidad: el pill de estado gana al span del placeholder de foto */
.branch .branch__photo .status {
  color: var(--c-black);
  font-size: .72rem;
  letter-spacing: .02em;
  text-transform: none
}

/* Panel de contacto con imagen (opcional: images.contact) */
.contact__media {
  display: none
}

.contact__box--img {
  grid-template-columns: 1.25fr 1fr;
  grid-template-rows: auto auto;
  column-gap: 0;
  padding-right: 0;
  padding-bottom: clamp(2rem, 5vw, 4.2rem)
}

.contact__box--img::after {
  display: none
}

.contact__box--img>div:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
  padding-right: 2rem
}

.contact__box--img .contact__actions {
  grid-column: 1;
  grid-row: 2;
  padding-right: 2rem
}

.contact__box--img .contact__media {
  display: block;
  position: absolute;
  inset: 0 0 0 auto;
  width: 46%;
  z-index: 0;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%);
  margin: 0
}

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

.contact__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(218, 41, 28, .35), transparent 45%)
}

@media (max-width:860px) {
  .contact__box--img {
    padding-right: clamp(2rem, 5vw, 4.2rem);
    grid-template-columns: 1fr;
    padding-bottom: 0
  }

  .contact__box--img>div:nth-child(1),
  .contact__box--img .contact__actions {
    padding-right: 0
  }

  .contact__box--img .contact__media {
    position: relative;
    inset: auto;
    width: calc(100% + 2 * clamp(2rem, 5vw, 4.2rem));
    margin: 1.6rem calc(-1 * clamp(2rem, 5vw, 4.2rem)) 0;
    height: 220px;
    grid-column: 1;
    grid-row: 3;
    clip-path: none
  }
}

/* Mobile: la etiqueta del respaldo arriba, para que no la tape el panel */
@media (max-width:860px) {
  .about__tag {
    bottom: auto;
    top: 1rem
  }
}

/* Modal de WhatsApp: hover legible (fondo oscuro + texto blanco) */
.wa-modal__list .wa-btn {
  background: var(--c-gray-100);
  color: var(--c-black)
}

.wa-modal__list .wa-btn:hover,
.wa-modal__list .wa-btn:focus-visible {
  background: var(--c-black);
  color: #fff;
  transform: translateY(-2px)
}

.wa-modal__list .wa-btn:hover small,
.wa-modal__list .wa-btn:focus-visible small {
  color: rgba(255, 255, 255, .75);
  opacity: 1
}

/* Header: logo más grande + botón de contacto más bajo */
.brand img {
  height: 54px
}

.site-header.is-scrolled .brand img {
  height: 46px
}

.main-nav .nav-cta {
  padding: .6rem 1.35rem;
  font-size: .78rem;
  line-height: 1.2
}

@media (max-width:860px) {
  .brand img {
    height: 46px
  }
}

/* El mapa no puede superponerse al header ni al modal (Leaflet usa z-index de hasta 1000) */
.map-box {
  isolation: isolate;
  z-index: 0
}

.site-header {
  z-index: 1000
}

.wa-modal {
  z-index: 1100
}

.toast {
  z-index: 1200
}

.progress {
  z-index: 1300
}