/* =========================================================
   QueBuscasRD — Productos en «vista tienda» (2-nov-2026)
   Lo carga negocio.php (plantillas Profesional y sus temas,
   menos restaurantes) y pone body.pr-vista-tienda.

   - La sección de productos usa todo el ancho de la pantalla.
   - Tarjetas compactas: foto cuadrada, disponibilidad, nombre,
     y abajo el precio con un botón «+» redondo.
   - 4 a 6 por fila según la pantalla (2 en el celular), y
     negocio-pro.js muestra 2 filas completas antes de «Ver más».
   Va al final de los estilos para ganarle a los temas.
   ========================================================= */

/* ---------- Toda la pantalla ---------- */
html body.pr-vista-tienda #productos#productos > .contenedor {
    width: 100% !important; max-width: 1840px !important;
    padding-left: clamp(14px, 3vw, 48px) !important; padding-right: clamp(14px, 3vw, 48px) !important;
}
html body.pr-vista-tienda #productos#productos .tarjeta-seccion { max-width: none !important; width: auto !important; }
/* La caja de «¿Prefieres escribir tu lista?» no se estira tanto */
html body.pr-vista-tienda #productos#productos .le { max-width: 980px; margin-left: auto !important; margin-right: auto !important; }

/* ---------- La cuadrícula ---------- */
html body.pr-vista-tienda #productos#productos .pr-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
    gap: 18px !important;
}

/* ---------- La tarjeta ---------- */
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) {
    padding: 12px !important; border-radius: 14px !important;
}
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-imagen {
    height: auto !important; aspect-ratio: 1 / 1 !important; margin: 0 0 10px !important;
    background: #FFFFFF !important; border-radius: 10px !important;
}
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-imagen > img {
    object-fit: contain !important; padding: 6px !important; box-sizing: border-box !important;
}
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-imagen .favorito-btn {
    width: 32px !important; height: 32px !important; right: 8px !important; bottom: 8px !important;
}

/* Información: todo a lo ancho y, al final, precio a la izquierda y botón + a la derecha */
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-info {
    display: flex !important; flex-direction: row !important; flex-wrap: wrap !important;
    align-items: center !important; align-content: flex-start; column-gap: 8px; row-gap: 4px;
}
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-info > * {
    flex: 0 0 100% !important; min-width: 0;
}
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .disponibilidad { order: 1 !important; margin: 0 !important; width: auto !important; }
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .cond-prod { order: 2 !important; flex: 0 0 auto !important; margin: 0 !important; }
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-info h3 {
    order: 3 !important; font-size: 15px !important; line-height: 1.3 !important;
    display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 2.6em;
}
/* La descripción se ve al tocar la foto (visor), aquí ocupa mucho */
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-info > p { display: none !important; }

/* Precio: abajo a la izquierda, grande, sin cápsula */
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-precio {
    order: 8 !important; flex: 1 1 0 !important; align-self: center !important;
    position: static !important; inset: auto !important; max-width: none !important;
    margin: 6px 0 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important;
    background: none !important; box-shadow: none !important;
    color: var(--pr-900, #111827) !important; font-size: 18px !important; font-weight: 800 !important; line-height: 1.2 !important;
    white-space: normal !important; overflow: visible !important;
}
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-precio .precio-por-confirmar {
    font-size: 12.5px !important; font-weight: 700 !important; color: var(--pr-600, #4B5563) !important;
}
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-precio:has(.precio-por-confirmar) {
    margin: 6px 0 0 !important; background: none !important; border: 0 !important;
}

/* Botón + redondo (el texto queda para lectores de pantalla) */
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-form {
    order: 9 !important; flex: 0 0 auto !important; width: auto !important; margin: 6px 0 0 !important; padding: 0 !important;
}
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-info > .producto-boton {
    order: 9 !important; flex: 0 0 auto !important; margin-top: 6px !important;
}
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-boton {
    width: 44px !important; height: 44px !important; min-height: 44px !important; padding: 0 !important;
    border-radius: 50% !important; gap: 0 !important;
    background: var(--pr-marca-btn, #1F4FC4) !important; border-color: var(--pr-marca-btn, #1F4FC4) !important; color: #FFFFFF !important;
}
html body.pr-vista-tienda.marca-clara #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-boton { color: var(--pr-900, #111827) !important; }
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-boton:disabled,
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-boton.agotado {
    background: var(--pr-100, #F3F4F6) !important; border-color: var(--pr-200, #E5E7EB) !important; color: var(--pr-600, #4B5563) !important;
}
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-boton svg { width: 22px !important; height: 22px !important; stroke-width: 2.6; }
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-boton .pb-txt {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-boton::before,
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-boton::after { content: none !important; display: none !important; }
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-boton svg { display: block !important; }
html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-boton:not(:disabled):not(.agotado):hover { filter: brightness(1.1); }

/* ---------- Celular: 2 por fila ---------- */
@media (max-width: 640px) {
    html body.pr-vista-tienda #productos#productos .pr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
    html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) { padding: 9px !important; }
    html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-info h3 { font-size: 14px !important; }
    html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-precio { font-size: 16px !important; }
    html body.pr-vista-tienda #productos#productos .pr-grid > article.producto:not(.producto-fila) .producto-boton { width: 40px !important; height: 40px !important; min-height: 40px !important; }
}

/* ---------- Páginas de lado (negocio-pro.js) ---------- */
html body.pr-vista-tienda #productos#productos .pr-mas { display: none !important; }
html body.pr-vista-tienda #productos .pr-paginas {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    margin: 26px auto 0; flex-wrap: wrap;
}
html body.pr-vista-tienda #productos .pr-paginas[hidden] { display: none !important; }
html body.pr-vista-tienda #productos .pr-pag-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 48px; height: 48px; padding: 0 14px; border-radius: 999px; cursor: pointer;
    border: 1.5px solid var(--pr-200, #E5E7EB); background: #FFFFFF; color: var(--pr-900, #111827);
    font: inherit; font-size: 15px; font-weight: 800; box-shadow: var(--pr-sombra, 0 4px 14px -6px rgba(0,0,0,.25));
}
html body.pr-vista-tienda #productos .pr-pag-sig { padding: 0 18px 0 22px; background: var(--pr-marca-btn, #1F4FC4); border-color: var(--pr-marca-btn, #1F4FC4); color: #FFFFFF; }
html body.pr-vista-tienda.marca-clara #productos .pr-pag-sig { color: var(--pr-900, #111827); }
html body.pr-vista-tienda #productos .pr-pag-btn:disabled { opacity: .35; cursor: default; box-shadow: none; }
html body.pr-vista-tienda #productos .pr-pag-btn:not(:disabled):hover { filter: brightness(1.08); }
html body.pr-vista-tienda #productos .pr-pag-btn:focus-visible { outline: 3px solid var(--pr-marca-btn, #1F4FC4); outline-offset: 3px; }
html body.pr-vista-tienda #productos .pr-pag-txt { font-size: 14px; font-weight: 700; color: var(--pr-600, #4B5563); min-width: 150px; text-align: center; }

/* Los productos nuevos entran de lado */
html body.pr-vista-tienda #productos .pr-grid.pr-entra-der { animation: prEntraDer .32s cubic-bezier(.2, .8, .2, 1); }
html body.pr-vista-tienda #productos .pr-grid.pr-entra-izq { animation: prEntraIzq .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes prEntraDer { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes prEntraIzq { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
html body.pr-vista-tienda #productos .pr-grid { touch-action: pan-y; }
@media (max-width: 640px) {
    html body.pr-vista-tienda #productos .pr-pag-txt { order: -1; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    html body.pr-vista-tienda #productos .pr-grid.pr-entra-der,
    html body.pr-vista-tienda #productos .pr-grid.pr-entra-izq { animation: none; }
}
