/* ================================
   AJUSTES GENERALES PARA CELULAR
   (ancho menor o igual a 768px)
   ================================ */
@media (max-width: 768px) {
  /* ---------- HEADER ---------- */

  .app-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 10px 16px;
  }

  .logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .logo-mark {
    font-size: 1.1rem;
  }

  .logo-sub {
    font-size: 0.7rem;
  }

  .app-nav {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    gap: 1rem;
    font-size: 0.8rem;
    overflow-x: auto;
  }

  .header-actions {
    width: 100%;
    display: flex;
    justify-content: space-between; /* bienvenida a la izquierda, iconos a la derecha */
    align-items: center;
    gap: 0.5rem;
  }

  .header-welcome {
    font-size: 0.8rem;
    margin-left: 0;
  }

  .header-actions .icon-btn {
    width: 32px;
    height: 32px;
  }

  /* Menú perfil un poco más angosto en celu */
  #profileMenu {
    right: 8px !important;
    left: auto !important;
    min-width: 180px;
  }

  /* ---------- CONTENIDO PRINCIPAL ---------- */

  #app {
    padding-inline: 12px;
  }

  /* ---------- GRILLA DE PRODUCTOS (HOME) ---------- */
  /* Aplica a las grillas que tengas para productos/comercios.
     Puse varios selectores para “pescar” las clases reales que uses. */

  .products-grid,
  .productos-grid,
  .comercios-grid,
  .lista-productos,
  .grid-productos {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-card,
  .producto-card,
  .comercio-card,
  .card-producto {
    max-width: 100%;
    margin: 0;
  }

  .product-card img,
  .producto-card img {
    max-height: 110px;
    object-fit: contain;
  }

  /* ---------- BOTONES “AGREGAR” MÁS COMPACTOS ---------- */

  .product-card .btn-primary,
  .producto-card .btn-primary {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  /* ---------- PANEL DEL COMERCIO: LISTA DE PRODUCTOS ---------- */

  .panel-productos-grid,
  .panel-comercio-productos,
  .panel-comercio-lista,
  .productos-panel-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .panel-producto-card,
  .panel-comercio-card,
  .producto-panel-card {
    max-width: 100%;
    margin: 0;
  }

  /* Si tenés tabla de productos en forma de filas, las hacemos más compactas */
  .tabla-productos,
  .table-productos {
    font-size: 0.8rem;
  }
}

/* ================================
   PANTALLAS MUY CHICAS (≤ 480px)
   ================================ */
@media (max-width: 480px) {
  .products-grid,
  .productos-grid,
  .comercios-grid,
  .lista-productos,
  .grid-productos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-card,
  .producto-card,
  .comercio-card,
  .card-producto {
    border-radius: 14px;
  }

  .app-header {
    padding-inline: 10px;
  }
}
/* =========================================================
   AJUSTE REAL PARA MOSTRAR PRODUCTOS DE A 2 POR FILA
   FUNCIONA CON TU HTML ACTUAL
   ========================================================= */
@media (max-width: 768px) {
  /* --- Contenedor real donde aparecen los productos --- */
  .productos-container,
  .lista-productos,
  .contenedor-productos,
  .home-productos {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
    padding: 0 10px;
  }

  /* --- Card REAL de producto --- */
  .item-producto,
  .producto-card,
  .productoItem {
    background: #111827;
    border-radius: 18px;
    padding: 10px;
    overflow: hidden;
    width: 100% !important;
    margin: 0 !important;
  }

  /* --- Imagen más chica, centrada --- */
  .item-producto img,
  .producto-card img {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    display: block;
    margin: 0 auto 6px;
  }

  /* --- Títulos centrados y más chiquitos --- */
  .item-producto h3,
  .producto-card h3 {
    font-size: 0.9rem;
    text-align: center;
    margin: 6px 0;
  }

  .item-producto p,
  .producto-card p {
    font-size: 0.75rem;
    text-align: center;
    color: #d1d5db;
  }

  /* --- Botón agregar más compacto --- */
  .item-producto button,
  .producto-card .btnAgregar,
  .add-btn {
    width: 100%;
    padding: 6px 0;
    font-size: 0.8rem !important;
    border-radius: 10px;
  }
}

/* =========================================================
   PARA PANTALLAS MUY CHICAS (≤ 480px)
   ========================================================= */
@media (max-width: 480px) {
  .productos-container {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .item-producto img {
    max-height: 100px;
  }
}
