/**
 * Reglas responsive (Mobile-first: 320px -> 390px -> 640px Tablet -> 1024px Desktop)
 * y Vista de Impresión de Códigos QR (FASE 9)
 */

/* Ajustes para celulares compactos (320px - 380px) */
@media (max-width: 380px) {
  .container {
    padding: 0 0.75rem;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .header-cart-btn {
    padding: 0.42rem 0.65rem;
    font-size: 0.8rem;
  }

  #open-qr-manager-btn span {
    display: none;
  }

  .product-card-media {
    width: 96px;
    min-width: 96px;
  }

  .product-card-body {
    padding: 0.7rem 0.75rem;
  }

  .product-card-title {
    font-size: 0.96rem;
  }

  .product-price-value {
    font-size: 1rem;
  }

  .product-action-btn {
    padding: 0.42rem 0.7rem;
    font-size: 0.76rem;
  }

  .checkout-mode-grid {
    grid-template-columns: 1fr;
  }

  .product-modal-footer {
    flex-wrap: wrap;
  }

  .modal-submit-btn {
    width: 100%;
  }
}

/* Soporte para barras de gestos inferiores en iOS y Android */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .product-modal-footer,
  .cart-footer,
  .checkout-footer {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }

  .floating-cart-bar {
    bottom: calc(0.85rem + env(safe-area-inset-bottom));
  }
}

/* Tablet (640px+) */
@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.15rem;
  }

  .product-card-media {
    width: 132px;
    min-width: 132px;
  }

  .hero-banner-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .hero-meta-bar {
    border-top: none;
    padding-top: 0;
    flex-shrink: 0;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.35rem;
  }

  .category-title {
    font-size: 1.65rem;
  }
}

/* Vista de impresión para los códigos QR por mesa */
@media print {
  body {
    background: #ffffff !important;
    overflow: visible !important;
  }

  .no-print,
  .qr-manager-header,
  .qr-manager-controls,
  .qr-card-actions {
    display: none !important;
  }

  #qr-manager-modal {
    display: block !important;
    position: static !important;
  }

  .qr-manager-backdrop {
    position: static !important;
    background: none !important;
    padding: 0 !important;
    display: block !important;
  }

  .qr-manager-sheet {
    max-width: 100% !important;
    max-height: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  .qr-manager-body {
    padding: 0 !important;
    background: #ffffff !important;
    overflow: visible !important;
  }

  .qr-cards-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 14px !important;
  }

  .qr-card {
    border: 2px solid #222222 !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}
