/* FLAMA-WEB-20 · frontend móvil. Se carga DESPUÉS de los estilos de tienda actuales.
   No modifica el POS, la vista del repartidor ni la lógica de pedidos/pagos.
   En móvil, el banner de campaña se oculta; en escritorio sigue visible. */
@media (max-width: 991.98px) {
  body[data-scope="store"] {
    --fl20-safe-bottom: env(safe-area-inset-bottom, 0px);
    background: #f7faf7;
    min-height: 100dvh;
  }
  body[data-scope="store"] #screen {
    /* Reservar espacio para el dock: evita tapar botones, checkout e historial. */
    padding-bottom: calc(94px + var(--fl20-safe-bottom)) !important;
    min-height: calc(100dvh - 135px);
  }
  /* El footer es útil en escritorio, pero no debe duplicar el dock móvil. */
  body[data-scope="store"] .store-footer {
    display: none !important;
  }
  /* Campañas: conservar funcionalidad y contenido en escritorio, no ocupar la portada móvil. */
  body[data-scope="store"] .fl6-promotion,
  body[data-scope="store"] .store-app-promotions {
    display: none !important;
  }
  /* Navegación realmente apoyada en el borde, incluidos teléfonos con indicador de inicio. */
  body[data-scope="store"] .store-app-dock.mobile-dock {
    display: grid !important;
    position: fixed;
    inset: auto 0 0 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    grid-template-columns: repeat(4, minmax(0, 105px));
    justify-content: center;
    align-items: stretch;
    gap: clamp(1px, 1vw, 7px);
    min-height: calc(69px + var(--fl20-safe-bottom)) !important;
    padding: 6px max(9px, env(safe-area-inset-right, 0px))
             calc(7px + var(--fl20-safe-bottom))
             max(9px, env(safe-area-inset-left, 0px)) !important;
    border: 0 !important;
    border-top: 1px solid #dde8df !important;
    border-radius: 18px 18px 0 0 !important;
    background: #fffefa !important;
    box-shadow: 0 -9px 32px rgba(21, 64, 45, .11) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 1025;
  }
  body[data-scope="store"] .store-app-dock.mobile-dock a {
    min-height: 54px;
    padding: 5px 3px;
    border-radius: 13px;
    gap: 3px;
    color: #587265;
    text-align: center;
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  body[data-scope="store"] .store-app-dock.mobile-dock a:is(.is-active,[aria-current="page"]) {
    color: #165940;
    background: #e9f5eb;
  }
  body[data-scope="store"] .store-app-dock .store-app-tab-label {
    font-size: 11px;
    line-height: 1.15;
    white-space: normal;
  }
  body[data-scope="store"] .store-app-dock .store-app-icon {
    width: 23px;
    height: 23px;
  }
  body[data-scope="store"] .toast-container {
    bottom: calc(82px + var(--fl20-safe-bottom)) !important;
  }
  /* El teclado virtual no debe cubrir el campo activo con la barra del sitio. */
  body[data-scope="store"].fl20-keyboard-open .store-app-dock.mobile-dock {
    visibility: hidden;
    pointer-events: none;
    transform: translateY(110%);
  }
  body[data-scope="store"].fl20-keyboard-open .toast-container {
    bottom: 12px !important;
  }
  /* Portada más compacta, sin quitar accesos ni precios. */
  body[data-scope="store"] .fl6-hero {padding-top: 12px;}
  body[data-scope="store"] .fl6-hero-panel {box-shadow: 0 14px 30px rgba(21,65,46,.14);}
  body[data-scope="store"] .fl6-trust {scroll-padding-inline: 13px;}
  body[data-scope="store"] .fl6-catalog {scroll-margin-top: 142px;}
  /* La lista de filtros se desplaza horizontalmente, nunca sobrepasa la pantalla. */
  body[data-scope="store"] .fl6-filter-chips {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  body[data-scope="store"] .fl6-filter-chips::-webkit-scrollbar {display: none;}
  body[data-scope="store"] .fl6-filter-chips [data-category] {
    flex: none;
    scroll-snap-align: start;
    min-height: 42px;
  }
  /* Tarjetas uniformes: el botón queda alineado aun con nombres de marca extensos. */
  body[data-scope="store"] .fl6-catalog .product-card .card-body {
    display: flex;
    flex-direction: column;
  }
  body[data-scope="store"] .fl6-catalog .product-card .card-body > .d-flex:last-child {
    margin-top: auto;
  }
  body[data-scope="store"] .fl6-catalog .product-image-flags .product-brand-badge {
    overflow-wrap: anywhere;
    white-space: normal;
  }
  body[data-scope="store"] .fl6-catalog .product-card .btn-primary {
    min-height: 44px;
  }
  /* Carrito seguro en móvil: scroll de productos y resumen accesible. */
  body[data-scope="store"] #cartDrawer {
    max-height: 100dvh;
  }
  body[data-scope="store"] #cartDrawer .offcanvas-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding-bottom: calc(14px + var(--fl20-safe-bottom));
  }
  body[data-scope="store"] #cartDrawer .store-cart-checkout,
  body[data-scope="store"] #cartDrawer [data-checkout-link] {
    min-height: 46px;
  }
  /* Checkout, pedidos y cuenta: campos cómodos y accesibles con el pulgar. */
  body[data-scope="store"] .fl6-checkout-page .fl6-payment-option {min-height: 49px;}
  body[data-scope="store"] .fl6-checkout-page #confirmCheckout {min-height: 54px;}
  body[data-scope="store"] .fl6-checkout-page .checkout-summary {top: auto;}
}
@media (max-width: 575.98px) {
  body[data-scope="store"] .fl6-hero-showcase {height: 170px; min-height: 170px;}
  body[data-scope="store"] .fl6-hero-art {max-height: 170px;}
  body[data-scope="store"] .fl6-hero-art svg {max-height: 170px;}
  body[data-scope="store"] .fl6-hero-copy {padding: 23px 19px 0;}
  body[data-scope="store"] .fl6-hero-mini {margin-top: 10px;}
  body[data-scope="store"] .fl6-hero-float {max-width: 42%;}
  body[data-scope="store"] .fl6-catalog-controls {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 38%);
    gap: 8px;
  }
  body[data-scope="store"] .fl6-catalog-controls .catalog-search,
  body[data-scope="store"] .fl6-catalog-controls .catalog-brand-filter {
    width: 100%;
    min-width: 0;
    min-height: 45px;
    font-size: 13px;
  }
  body[data-scope="store"] .fl6-catalog .product-card .product-title {
    font-size: 12px;
    line-height: 1.35;
  }
  body[data-scope="store"] .fl6-catalog .product-price {font-size: 17px;}
  body[data-scope="store"] .fl6-catalog .product-card .btn-primary {font-size: 12px;}
  body[data-scope="store"] .fl6-catalog #productGrid > .col {min-width: 0;}
  body[data-scope="store"] .fl6-checkout-page {padding-top: 17px !important;}
  /* Checkout ya tiene un heading completo; no duplicar el texto de introducción. */
  body[data-scope="store"] .fl6-checkout-intro {display: none;}
  body[data-scope="store"] .fl6-checkout-page .fl6-checkout-card {border-radius: 19px;}
  body[data-scope="store"] .fl6-checkout-page fieldset legend {font-size: 15px;}
  body[data-scope="store"] .fl6-checkout-page .option-card {min-height: 66px;}
}
@media (prefers-reduced-motion: reduce) {
  body[data-scope="store"] .store-app-dock.mobile-dock {transition: none !important;}
}
