/* =============================
   RESPONSIVE (Catálogo App)
   ============================= */

/* Breakpoint helpers: Bootstrap 5
   sm: 576, md: 768, lg: 992, xl: 1200 */

/* Mobile-first tuning */

@media (max-width: 575.98px){
  .container{ padding-left: 14px; padding-right: 14px; }

  /* Top bar tighter */
  .navbar{ padding-top: 10px; padding-bottom: 10px; }
  #selectedSucursalInfo{ padding-bottom: 8px; }

  /* Hero smaller */
  .hero-banner{ min-height: 210px; }
  .hero-content{ padding: 18px 18px; }
  .hero-content h1{ font-size: 1.35rem; }
  .hero-content p{ font-size: .95rem; }

  /* Sticky filtros: pegado al navbar (sin separación extra) */
  #stickyFilters{ top: var(--nav-h); }

  /* Cards: 2 columns */
  #productsGrid .col-12{ flex: 0 0 50%; max-width: 50%; }
  #productsGrid .col-sm-6,
  #productsGrid .col-md-4,
  #productsGrid .col-lg-3{ flex: 0 0 50%; max-width: 50%; }

  .product-card{ border-radius: 18px; }
  .badge-preparado{ top: 10px; left: 10px; font-size: .76rem; padding: 6px 9px; }
  .discount-badge{ top: 10px; right: 10px; font-size: .76rem; padding: 6px 9px; }

  .btn-detail{ width: 40px; height: 40px; border-radius: 14px; }

  .qty-controls button{ width: 38px; height: 38px; border-radius: 14px; }

  /* Cart bar: mobile centered CTA */
  .cart-bar{
    left: 12px;
    right: 12px;
    width: calc(100% - 24px);
    bottom: calc(12px + env(safe-area-inset-bottom));
    border-radius: 18px;
    height: auto;
    padding: 12px 12px;
    gap: 8px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-wrap: wrap;
    transform: none !important;
  }

  #cartSummary{
    font-size: .93rem;
    width: 100%;
    text-align: center;
  }
  .cart-bar .btn{
    padding: 10px 14px;
    align-self: center;
    margin: 0 auto;
    width: 100%;
    max-width: 240px;
  }

  /* Floating buttons above cart bar */
  #btnCambiarTiendaIcono{ right: 12px; bottom: 92px; }
  .fab{ right: 12px; bottom: 150px; }

  /* Delivery-app feel: más aire y jerarquía */
  .hero-banner{ border-radius: 22px; }

  /* Barra de búsqueda estilo app */
  .search-wrap{ max-width: 100% !important; }

  /* Grid: más compacto y alineado como Rappi/Uber */
  #productsGrid{ row-gap: 14px; }
  #productsGrid .col-12{ padding-left: 8px; padding-right: 8px; }

  /* Cards: sombra suave y borde limpio */
  .product-card{
    box-shadow: 0 12px 28px rgba(15,23,42,.10);
    border: 1px solid rgba(15,23,42,.08);
  }

  /* Badges más “pill” */
  .badge-preparado,
  .discount-badge{
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  /* Floating buttons: siempre sobre la cart bar */
  #btnCambiarTiendaIcono{ right: 12px; bottom: calc(98px + env(safe-area-inset-bottom)); }
  .fab{ right: 12px; bottom: calc(156px + env(safe-area-inset-bottom)); }
}

@media (min-width: 576px) and (max-width: 767.98px){
  .hero-banner{ min-height: 230px; }
  #stickyFilters{ top: var(--nav-h); }
}

@media (min-width: 768px) and (max-width: 991.98px){
  .hero-banner{ min-height: 250px; }
  #stickyFilters{ top: var(--nav-h); }
}

@media (min-width: 992px){
  /* Desktop: más aire */
  .hero-banner{ min-height: 300px; }
  .hero-content h1{ font-size: 2.1rem; }
  .hero-content p{ font-size: 1.1rem; }
  #stickyFilters{ top: var(--nav-h); }
}

@media (min-width: 1200px){
  .container{ max-width: 1180px; }
}

@media (max-width: 576px){
  #heroCarousel{ margin-bottom: 6px !important; }
  #stickyFilters{ margin-top: -10px; }
  #stickyFilters .category-sticky{ border-radius: 16px; padding: 10px; }
  .category-pill{ padding: 9px 12px; font-weight: 900; }

  body[data-view="list"] .product-card{ grid-template-columns: 116px 1fr; gap: 12px; }
  body[data-view="list"] .product-card .product-image-wrapper{ height: 116px; }
}
