/* ==========================================================
   ALERTA MUNICIPAL
========================================================== */

.vt-alert {
  position: relative;
  z-index: 10000;
  background: #fff7e6;
  border-bottom: 1px solid #f0d59a;
  color: var(--color-primary-dark);
}

.vt-alert__inner {
  max-width: var(--container);
  margin-inline: auto;
  min-height: 64px;
  padding: .75rem clamp(1rem, 4vw, 2.5rem);

  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1rem;
}

.vt-alert__badge {
  width: 42px;
  height: 42px;
  border-radius: 999px;

  display: grid;
  place-items: center;

  background: rgba(180, 35, 24, .09);
  color: #b42318;
  font-size: 1.15rem;
}

.vt-alert__content {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: .45rem;
  flex-wrap: wrap;
}

.vt-alert__title {
  color: var(--color-primary-dark);
  font-weight: 750;
  letter-spacing: -.015em;
}

.vt-alert__text {
  color: var(--color-text);
  font-size: .96rem;
  line-height: 1.45;
}

.vt-alert__link {
  display: inline-flex;
  align-items: center;
  gap: .65rem;

  min-height: 42px;
  padding: 0 1rem;

  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.72);
  color: var(--color-primary-dark);

  font-size: .92rem;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;

  grid-column: 3;

}

.vt-alert__link:hover {
  background: #fff;
  color: var(--color-primary);
  text-decoration: none !important;
}

.vt-alert__link i {
  font-size: .8rem;
}

.vt-alert__close {
  width: 42px;
  height: 42px;
  border: 0;
  border-left: 1px solid rgba(17,53,85,.12);
  background: transparent;
  color: var(--color-primary-dark);
  cursor: pointer;
  font-size: 1.1rem;

  grid-column: 4;
}

/* Tipos */

.vt-alert--info {
  background: var(--color-primary-soft);
  border-bottom-color: #d5e5f4;
}

.vt-alert--info .vt-alert__badge {
  background: rgba(17, 53, 85, .08);
  color: var(--color-primary);
}

.vt-alert--aviso {
  background: #fff7e6;
  border-bottom-color: #f0d59a;
}

.vt-alert--aviso .vt-alert__badge {
  background: rgba(180, 83, 9, .10);
  color: #b45309;
}

.vt-alert--emergencia {
  background: #fdf2f2;
  border-bottom-color: #f0b4b4;
}

.vt-alert--emergencia .vt-alert__badge {
  background: rgba(180, 35, 24, .10);
  color: #b42318;
}

.vt-alert--emergencia .vt-alert__title {
  color: #b42318;
}

/* Móvil */

@media (max-width: 700px) {
  .vt-alert__inner {
    min-height: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .8rem;
    padding-block: .85rem;
  }

  .vt-alert__badge {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .vt-alert__content {
    display: block;
  }

  .vt-alert__title,
  .vt-alert__text {
    display: block;
  }

  .vt-alert__title {
    font-size: .95rem;
    line-height: 1.25;
  }

  .vt-alert__text {
    margin-top: .15rem;
    font-size: .88rem;
    line-height: 1.4;
  }

  .vt-alert__link {
    grid-column: 2 / 3;
    justify-self: start;
    min-height: 36px;
    margin-top: .35rem;
    padding-inline: .8rem;
    font-size: .84rem;

    grid-row: 2;
  }

  .vt-alert__close {
    grid-column: 3;
    grid-row: 1;
    width: 38px;
    height: 38px;
    border-left: 0;
  }
}

.vt-alert {
  animation: vtAlertIn .35s ease;
}

@keyframes vtAlertIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vt-alerts {
  position: relative;
  z-index: 10000;
}

.vt-alerts .vt-alert + .vt-alert {
  border-top: 1px solid rgba(17,53,85,.08);
}

/* ==========================================================
   STICKY HEADER MÓVIL + ALERTAS — DEFINITIVO
========================================================== */

@media (max-width: 900px) {

  :root {
    --vt-header-height: 76px;
  }

  body {
    padding-top: var(--vt-header-height) !important;
  }

  .site-header--mobile-sticky {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 10010;
  }

  body.has-active-alerts {
    padding-top: calc(var(--vt-alert-height, 0px) + var(--vt-header-height)) !important;
  }

  body.has-active-alerts .vt-alerts {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    z-index: 10020;
  }

  body.has-active-alerts .site-header--mobile-sticky {
    top: var(--vt-alert-height, 0px) !important;
  }

  body.has-active-alerts .mobile-menu {
    position: fixed !important;
    inset: calc(var(--vt-alert-height, 0px) + var(--vt-header-height)) 0 0 0 !important;
    z-index: 10000;
  }

  body:has(.site-header--mobile-sticky .site-search-panel.is-open) {
    padding-top: calc(76px + 150px) !important;
  }

  body.has-active-alerts:has(.site-header--mobile-sticky .site-search-panel.is-open) {
    padding-top: calc(var(--vt-alert-height, 0px) + var(--vt-header-height) + 150px) !important;
  }

}