/* Shared layout fixes. Keep brand colours, typography and content intact. */
html,
body {
  overflow-x: clip;
}
section[id],
.hsec[id] {
  scroll-margin-top: 120px;
}

/* The even-card reveal rule used to override the completed animation. */
.js .reveal,
.js .reveal:nth-child(2n) {
  transform: translateY(18px);
}
.js .reveal.in,
.js .reveal.in:nth-child(2n) {
  opacity: 1;
  transform: none;
}

.ap-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.ap-grid .apc {
  min-width: 0;
  padding: 22px 16px 44px;
}
.apc .an,
.apc .an-sub {
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}
.apc .an {
  line-height: 1.45;
}
.apc .an-sub {
  font-size: 12px;
  line-height: 1.5;
}
.apc .ai {
  flex-shrink: 0;
}
.apc[href^="http"]::after,
.apc[href^="/"]::after {
  content: "Ver servicio →";
}
.hag .apc {
  padding-bottom: 40px;
}

.topbar > *,
.tb-brand,
.stat-item,
.feat,
.faq-list > *,
.rev {
  min-width: 0;
}
.tb-burger {
  flex-shrink: 0;
}
.tb-phone-top {
  white-space: nowrap;
}
.tb-phone {
  white-space: nowrap;
}
.tb-burger {
  width: 44px;
  min-height: 44px;
}
.hero-logo {
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
}
.hero-logo-wrap {
  padding: 8px 12px;
}
.schedule {
  display: block;
  max-width: 100%;
  text-wrap: pretty;
}
.faq-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.faq-list summary,
.modal-box,
.legal-content {
  overflow-wrap: anywhere;
}
.final-card {
  min-height: 420px;
}
.final-card > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.final-card .fc-in {
  position: relative;
  min-height: 420px;
  height: auto;
}
.final-card .fcall {
  max-width: 100%;
}
.sticky small {
  max-width: 100%;
  white-space: normal;
  text-align: center;
  text-wrap: balance;
}
.errtable,
.cookie-table {
  width: 100%;
  table-layout: fixed;
  overflow-wrap: anywhere;
}

@media (max-width: 899px) {
  .ap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  section[id],
  .hsec[id] {
    scroll-margin-top: 88px;
  }
  .ap-grid {
    gap: 12px;
  }
  .ap-grid .apc {
    padding: 18px 12px 42px;
  }
  .faq-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-logo-wrap {
    padding: 6px 8px;
  }
  .final-card .fc-in {
    padding: 30px 18px;
  }
  .final-card .fcall {
    padding-inline: 18px;
  }
  .cookie-bar .cookie-btns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cookie-bar .cookie-btn-prefs {
    grid-column: 1 / -1;
  }
}
@media (max-width: 379px) {
  .ap-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .tb-phone-top {
    font-size: 21px;
    padding-inline: 8px;
    gap: 6px;
  }
  .topbar .tb-brand-txt {
    font-size: 15px;
  }
  .topbar {
    padding-inline: 10px;
    gap: 6px;
  }
  .topbar .tb-burger {
    margin-right: 0;
  }
  .topbar .tb-phone {
    font-size: 12px;
    padding: 8px 9px;
    gap: 5px;
  }
  .topbar .tb-phone svg {
    display: none;
  }
  .sticky small {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .reveal,
  .js .reveal:nth-child(2n),
  .js .hero .in > * {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }
}
