/* BotFlow Adaptive — Bootstrap grid + tamaños móvil/desktop */

:root {
  --bf-page-pad: 1.125rem;
  --bf-page-max: 1180px;
  --bf-gutter: 1rem;
}

@media (min-width: 768px) {
  :root {
    --bf-page-pad: 1.35rem;
    --bf-gutter: 1.5rem;
  }
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 4rem;
}

html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

.container {
  width: 100% !important;
  max-width: var(--bf-page-max) !important;
  padding-left: var(--bf-page-pad) !important;
  padding-right: var(--bf-page-pad) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

@media (min-width: 1200px) {
  .container {
    max-width: 1240px !important;
  }
}

.hero-section .hero-grid.row {
  display: flex !important;
  flex-wrap: wrap !important;
  --bs-gutter-x: var(--bf-gutter);
  --bs-gutter-y: 1rem;
  width: 100%;
  margin: 0;
}

.hero-section .hero-grid.row > * {
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
}

/* ── Móvil (< 768px) ── */
@media (max-width: 767.98px) {
  .nav-logo-img {
    height: 1.85rem !important;
    max-width: min(7.5rem, 36vw) !important;
  }

  .nav-logo-frame {
    top: max(0.4rem, env(safe-area-inset-top, 0px));
    right: max(var(--bf-page-pad), env(safe-area-inset-right, 0px));
  }

  .site-nav__inner {
    padding-right: 0 !important;
  }

  .hero-section.h-dvh {
    min-height: auto !important;
    height: auto !important;
    padding-top: 4.25rem !important;
    padding-bottom: 2rem !important;
  }

  .hero-grid__copy {
    padding-right: 0 !important;
    max-width: 100% !important;
  }

  .hero-title {
    font-size: 1.375rem !important;
    line-height: 1.24 !important;
    margin-bottom: 0.5rem !important;
  }

  .hero-visual--mobile {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    max-width: min(168px, 46vw) !important;
    margin: 0.15rem auto 0.65rem !important;
    min-height: 0 !important;
  }

  .hero-visual--mobile .hero-diagram {
    width: 100% !important;
    max-width: 168px !important;
  }

  .hero-section .hero-visual--desktop {
    display: none !important;
  }

  .p45-hero-info--v8 {
    gap: 0.75rem !important;
  }

  .p45-hero-info--v8 .p45-hero-info__intro {
    font-size: 1rem !important;
    line-height: 1.35 !important;
  }

  .p45-hero-info--v8 .p45-hero-info__summary {
    gap: 0.5rem !important;
  }

  .p45-hero-info--v8 .p45-hero-info__summary p,
  .p45-hero-info--v8 .p45-hero-info__summary-question {
    font-size: 0.9375rem !important;
    line-height: 1.52 !important;
  }

  .p45-hero-info--v8 .p45-hero-info__closing {
    font-size: 0.9rem !important;
    line-height: 1.45 !important;
  }

  .p45-hero-info__benefits-strip {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.45rem !important;
    padding-top: 0.55rem !important;
  }

  .p45-hero-info__benefit-item {
    flex: unset !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0.45rem 0.55rem !important;
    justify-content: flex-start !important;
  }

  .p45-hero-info__benefit-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 11.75rem;
    margin-inline: auto;
    justify-content: center !important;
  }

  .p45-hero-info__benefit-label {
    font-size: 0.78rem !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  .p45-hero-info__actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.55rem !important;
  }

  .p45-hero-info--v8 .p45-hero-info__link {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 0.9rem !important;
    padding: 0.7rem 1rem !important;
  }

  .p45-solutions__grid,
  .p45-ventajas__hero,
  .p45-detail__head,
  .p45-detail__hero,
  .p45-pricing__grid,
  .p45-about__grid {
    grid-template-columns: 1fr !important;
  }

  .p45-solutions__card-img {
    width: 58% !important;
  }

  .p45-ventajas__figure {
    justify-self: center;
    max-width: 180px;
  }

  .p45-detail__head-copy,
  .p45-detail__head .p45-detail__intro,
  .p45-detail__head-img,
  .p45-detail__intro {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .p45-detail__head-img {
    max-width: min(220px, 75%) !important;
    justify-self: center !important;
    margin-inline: auto !important;
  }

  section.py-\[120px\] {
    padding-top: clamp(2.75rem, 8vw, 4.5rem) !important;
    padding-bottom: clamp(2.75rem, 8vw, 4.5rem) !important;
  }
}

/* ── Tablet (768px – 1023px) ── */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .nav-logo-img {
    height: 2.25rem !important;
    max-width: min(9rem, 34vw) !important;
  }

  .hero-section.h-dvh {
    min-height: auto !important;
    height: auto !important;
    padding-top: 4.75rem !important;
    padding-bottom: 2.25rem !important;
  }

  .hero-title {
    font-size: clamp(1.45rem, 3.2vw, 1.85rem) !important;
  }

  .hero-visual--mobile {
    display: flex !important;
    justify-content: center !important;
    max-width: min(200px, 30vw) !important;
    margin: 0.2rem auto 0.75rem !important;
  }

  .hero-section .hero-visual--desktop {
    display: none !important;
  }

  .p45-solutions__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 720px;
    margin-inline: auto;
  }

  .p45-ventajas__hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) !important;
    align-items: center;
  }

  .p45-detail__head,
  .p45-detail__hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.75fr) !important;
  }
}

/* ── Compartido móvil + tablet ── */
@media (max-width: 1023.98px) {
  .site-nav__inner {
    padding-right: 0 !important;
  }

  .hero-grid__copy {
    padding-right: 0 !important;
    overflow-wrap: break-word;
  }

  .nav-menu-btn,
  .p45-mobile-nav__link,
  .p45-solutions__link,
  .p45-detail__back,
  .p45-price-card__btn,
  .p45-detail__btn,
  .p45-hero-info__link {
    min-height: 2.75rem;
  }

  #mobile-menu {
    padding-inline: var(--bf-page-pad);
  }
}

/* ── Desktop (≥ 1024px) ── */
@media (min-width: 1024px) {
  .hero-section.h-dvh {
    min-height: 100dvh !important;
    align-items: center !important;
    padding-top: 5.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .hero-section .hero-grid.row {
    flex-wrap: nowrap !important;
    align-items: center !important;
    --bs-gutter-y: 1.5rem;
  }

  .hero-section .hero-grid.row > .hero-grid__copy {
    flex: 0 0 auto !important;
    width: 58.33333333% !important;
    max-width: 58.33333333% !important;
  }

  .hero-section .hero-grid.row > .hero-visual--desktop {
    display: flex !important;
    flex: 0 0 auto !important;
    width: 41.66666667% !important;
    max-width: 41.66666667% !important;
    justify-content: center !important;
    margin: 0 !important;
    min-height: 200px;
  }

  .hero-section .hero-diagram {
    width: min(280px, 100%) !important;
    max-width: 300px !important;
  }

  .hero-visual--mobile {
    display: none !important;
  }

  .hero-section .hero-visual--desktop {
    display: flex !important;
  }

  .hero-title {
    font-size: clamp(1.55rem, 2.4vw, 2.15rem) !important;
    line-height: 1.12 !important;
  }
}

@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
}

body.is-touch .hero-spotlight {
  opacity: 0.65;
}

body.is-touch .bento-glow::before {
  opacity: 0.35;
}

@media (prefers-reduced-motion: no-preference) {
  html:not(.bf-stable-mobile) body:not(.page-ready) .hero-animate {
    animation: bf-hero-show 0.8s cubic-bezier(0.23, 1, 0.32, 1) 1.2s forwards;
  }
}

@keyframes bf-hero-show {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.page-ready .hero-animate {
  animation: none;
}

@media (scripting: none) {
  .hero-animate,
  .reveal-ready .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
