/**
 * Ajustes responsive móvil — hero interno, contenido legacy y FABs
 */

@media (max-width: 1050px) {
  :root {
    --nav-height: calc(var(--nav-main-height) + env(safe-area-inset-top, 0px));
  }

  #header-secundario.page-hero,
  #header-secundario:not(.header-minimal) {
    padding-top: calc(var(--mobile-header-h, var(--nav-main-height)) + 0.85rem) !important;
    padding-left: max(1rem, env(safe-area-inset-left)) !important;
    padding-right: max(1rem, env(safe-area-inset-right)) !important;
  }

  .page-hero-inner .breadcrumb {
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 0.2rem;
    font-size: 0.82rem;
    line-height: 1.45;
  }

  .page-hero-inner h1 {
    font-size: clamp(1.35rem, 5.2vw, 1.85rem) !important;
    line-height: 1.2 !important;
  }

  .page-hero-inner .lead {
    font-size: 0.95rem;
    padding: 0 0.15rem;
  }

  .page-hero-actions {
    gap: 0.45rem;
    padding: 0 0.15rem;
  }

  .page-hero-btn {
    min-height: 44px;
    font-size: 0.84rem;
  }
}

@media (max-width: 640px) {
  #main-productos,
  .productos-destacados .content-p-destacados div,
  #header .texto-header,
  #pagina #info-inicio div {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .page-internal .content-area img,
  .page-internal .content-prose img,
  .catalog-ficha-prose img,
  .content-prose iframe,
  .content-prose video {
    max-width: 100%;
    height: auto;
  }

  .page-internal .content-prose table,
  .page-internal .tabla-medidas,
  .catalog-ficha-prose table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.has-buy-sticky .site-fabs {
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  body.shop-has-mobile-bar .site-fabs {
    bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  }

  body.has-buy-sticky.shop-has-mobile-bar .site-fabs {
    bottom: calc(6.75rem + env(safe-area-inset-bottom, 0px));
  }

  .site-fabs .btn-whatsapp img,
  .site-fabs .btn-whatsapp svg {
    width: 48px;
    height: 48px;
  }

  .cookie-banner {
    bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  body.has-buy-sticky .cookie-banner.is-visible,
  body.shop-has-mobile-bar .cookie-banner.is-visible {
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 380px) {
  .page-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .page-hero-btn {
    width: 100%;
    justify-content: center;
  }

  .home-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .home-hero-actions .btn-hero {
    width: 100%;
    justify-content: center;
  }
}
