/* ================================================================
   MERCADO — Mayorista / Distribuidora (layout-compacto)
   ================================================================ */
body.layout-compacto { background: #f0f2f5; }

/* Header navy compacto */
body.layout-compacto header { background: var(--color-primario) !important; padding-top: 0; padding-bottom: 0; }
body.layout-compacto .header-inner { padding: 0.4rem 1.2rem; }
body.layout-compacto #category-buttons { background: var(--color-primario-deep) !important; }
body.layout-compacto .header-logo-text strong { color: #fff !important; font-size: 1rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
body.layout-compacto .nav-link-btn, body.layout-compacto .quick-pill, body.layout-compacto .dropdown-btn { color: rgba(255,255,255,.82) !important; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; }
body.layout-compacto .header-search-wrap { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); }
body.layout-compacto .header-search-wrap input { color: #fff; background: transparent; }
body.layout-compacto .header-search-wrap input::placeholder { color: rgba(255,255,255,.45); }

/* ── Catálogo: LISTA HORIZONTAL — imagen | nombre+precio | botón ── */
body.layout-compacto .product-grid {
    --catalog-cols: 1;
    gap: 0;
    background: #fff;
    border: 1px solid #dde3ec;
    border-radius: 8px;
    overflow: hidden;
}
body.layout-compacto .product {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.9rem;
    padding: 0.65rem 1rem 0.65rem 0.85rem;
    border-bottom: 1px solid #eaeff5;
    border-left: 3px solid transparent;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    overflow: visible;
    transition: background 0.15s ease, border-left-color 0.15s ease;
}
body.layout-compacto .product:last-child { border-bottom: none; }
body.layout-compacto .product:hover {
    background: #fafbff !important;
    border-left-color: var(--color-acento) !important;
    transform: none !important;
    box-shadow: none !important;
}
body.layout-compacto .prod-img-wrap {
    flex: 0 0 76px;
    width: 76px;
    height: 76px;
    min-width: 76px;
    aspect-ratio: 1 !important;
    border-radius: 8px !important;
    overflow: visible;
    background: #f3f4f6;
    border: 1px solid #e9edf3;
}
/* Imagen interior con overflow oculto */
body.layout-compacto .prod-img-wrap > img,
body.layout-compacto .prod-img-wrap > .prod-main-img { border-radius: 7px; }
/* Badge de etiqueta: abajo-izquierda */
body.layout-compacto .prod-stock-badge { font-size: 0.5rem; padding: 0.1rem 0.35rem; border-radius: 3px; bottom: -6px; left: 0; }
/* Corazón: arriba-derecha sin solaparse con badge llama */
body.layout-compacto .prod-fav-btn { top: -6px; right: -6px; bottom: unset; left: unset; width: 22px; height: 22px; font-size: 0.7rem; }
body.layout-compacto .product h3 {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    text-overflow: ellipsis;
    padding: 0; margin: 0;
    font-size: 0.875rem; font-weight: 500; color: #1e293b !important;
    line-height: 1.35;
}
body.layout-compacto .product p {
    flex: 0 0 auto;
    min-width: 90px;
    text-align: right;
    padding: 0; margin: 0;
    font-size: 1.1rem; font-weight: 800; color: var(--color-primario) !important;
    white-space: nowrap;
    letter-spacing: -0.02em;
}
body.layout-compacto .product > button:not(.quantity-controls button) {
    flex: 0 0 100px;
    width: 100px !important;
    background: var(--color-acento); color: var(--color-primario);
    border-radius: 6px !important;
    font-size: 0.78rem; font-weight: 700;
    padding: 0.52rem 0 !important;
    margin: 0 !important;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0;
    transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
    box-shadow: 0 1px 4px rgba(245,158,11,.25);
}
/* Controles de cantidad con mismo ancho que el botón para mantener alineación */
body.layout-compacto .product .quantity-controls {
    flex: 0 0 100px;
    width: 100px !important;
}
body.layout-compacto .product > button:not(.quantity-controls button):hover {
    background: var(--color-acento-hover) !important; color: #fff;
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(217,119,6,.35);
}
body.layout-compacto .product .quantity-controls button { width: 26px; height: 26px; font-size: 0.9rem; border-radius: 4px; color: var(--color-primario); }
body.layout-compacto .product .quantity-controls span { font-size: 0.82rem; }

/* Titulos */
body.layout-compacto .seccion-titulo { font-size: 0.62rem; color: var(--color-primario); letter-spacing: 0.2em; border-bottom: 2px solid var(--color-primario); padding-bottom: 0.4rem; }
/* Título de categoría: banda de supermercado full-width */
body.layout-compacto .category-title {
    background: var(--color-primario); color: #fff !important;
    padding: 0.45rem 1.2rem; margin: 0.2rem 0 0;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em;
    text-transform: uppercase; border: none; border-radius: 0;
    display: block;
}
body.layout-compacto .category-section { padding: 0.3rem 0.5rem 1rem; }
body.layout-compacto .strip-info { background: var(--color-acento); color: var(--color-primario); font-weight: 700; }
body.layout-compacto .strip-item strong, body.layout-compacto .strip-item span, body.layout-compacto .strip-item { color: var(--color-primario) !important; border-color: rgba(30,58,95,.2) !important; }
body.layout-compacto .precio-actual { color: var(--color-primario) !important; }
body.layout-compacto .hero-section {
    min-height: 140px !important;
    background: var(--color-primario);
    text-align: left;
}
body.layout-compacto .hero-content {
    max-width: none;
    padding: 1.6rem 2rem 1.8rem;
    margin: 0;
}
body.layout-compacto .hero-tag { display: none; }
body.layout-compacto .hero-titulo {
    font-size: 1.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    margin-bottom: 0.35rem;
}
body.layout-compacto .hero-sub {
    font-size: 0.78rem;
    color: rgba(255,255,255,.55);
    margin-bottom: 0;
    max-width: 500px;
}
body.layout-compacto .hero-cta { display: none; }
body.layout-compacto .hero-section.has-hero-bg .hero-overlay {
    background: rgba(0,0,0,.5) !important;
}
body.layout-compacto .cart-checkout-btn { background: var(--color-primario); border-radius: 4px; }
body.layout-compacto .cart-checkout-btn:hover { background: var(--color-acento); color: var(--color-primario); }

/* ── PRODUCTO DETALLE: FICHA TÉCNICA — limpio, moderno ── */
body.layout-compacto .pd-ab-hero {
    grid-template-columns: 360px 1fr;
    border: 1px solid #dde3ec;
    border-top: 3px solid var(--color-primario);
    border-radius: 6px;
    overflow: clip; /* clip = no scroll context, permite sticky en hijos */
    max-width: 980px;
    margin: 2rem auto;
    min-height: unset;
    box-shadow: 0 4px 20px rgba(30,58,95,.08);
    align-items: start;
}
body.layout-compacto .pd-ab-images {
    background: #f0f2f5;
    border-right: 1px solid #dde3ec;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: calc(50vh - 250px);
    align-self: start;
}
/* Reduce dead zone in panel — tighten spacing */
body.layout-compacto .pd-ab-payment-hint { margin-bottom: 0.6rem !important; }
body.layout-compacto .pd-ab-aviso { margin-top: 0.4rem !important; margin-bottom: 0.6rem !important; }
/* DT labels: no wrapping, fixed width */
body.layout-compacto .pd-ab-delivery-row dt {
    font-size: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    min-width: 90px;
}
body.layout-compacto .pd-ab-panel {
    background: #fff;
    border-left: none;
    border-top: none;
    padding: 2rem 2.2rem 2.4rem;
}
/* Título legible */
body.layout-compacto .pd-ab-title {
    font-family: var(--font-body);
    font-style: normal;
    font-weight: 700;
    font-size: clamp(1.25rem, 2.2vw, 1.7rem);
    letter-spacing: -0.01em;
    text-transform: none;
    color: #1e293b;
    border-bottom: 1px solid #eaeff5;
    padding-bottom: 0.75rem;
    margin-bottom: 0.85rem;
    line-height: 1.25;
}
body.layout-compacto .pd-price { color: var(--color-primario) !important; font-size: 2.4rem; font-weight: 900; letter-spacing: -0.03em; }
body.layout-compacto .pd-ab-btn-main {
    background: var(--color-acento); color: var(--color-primario);
    border-radius: 4px; font-weight: 700;
    transition: background 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 2px 8px rgba(245,158,11,.3);
}
body.layout-compacto .pd-ab-btn-main:hover:not(:disabled) {
    background: var(--color-acento-hover); color: #fff;
    box-shadow: 0 4px 16px rgba(217,119,6,.4);
}
body.layout-compacto .pd-ab-btn-main.agregado { background: #15803d; box-shadow: 0 2px 8px rgba(21,128,61,.3); }
body.layout-compacto .pd-ab-btn-main:disabled,
body.layout-compacto .pd-ab-btn-main.pd-btn-disabled { background: #e5e7eb; color: #9ca3af; box-shadow: none; }
body.layout-compacto .pd-carousel-frame { min-height: 300px; max-height: 500px; }
body.layout-compacto .pd-ab-main-img { width: 100%; min-height: 300px; max-height: 500px; object-fit: cover; background: #f0f2f5; display: block; }
body.layout-compacto .pd-ab-editorial { background: #f8fafc; border-top: 1px solid #eaeff5; }
body.layout-compacto .pd-ab-section-label { color: #94a3b8; font-size: 0.62rem; letter-spacing: 0.14em; }
body.layout-compacto .pd-ab-related-section,
body.layout-compacto .pd-ab-reviews-section,
body.layout-compacto .pd-ab-cta { background: #f0f2f5; }
body.layout-compacto .pd-car-thumbs {
    background: rgba(248,250,252,0.95);
    border-top: 1px solid #eaeff5;
    justify-content: center;
    width: 100%; box-sizing: border-box;
    position: relative; bottom: unset; left: unset; transform: none;
    backdrop-filter: none;
}
/* ── Relacionados: reset al layout de cards (no fila horizontal) ── */
body.layout-compacto .pd-ab-related-section .product,
body.layout-compacto .pd-ab-rec-track .product {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 0 0 0.5rem !important;
    border: none !important;
    border-bottom: none !important;
    border-left: 3px solid transparent !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #fff !important;
}
body.layout-compacto .pd-ab-related-section .product:hover,
body.layout-compacto .pd-ab-rec-track .product:hover {
    border-left-color: transparent !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 20px rgba(30,58,95,.12) !important;
}
body.layout-compacto .pd-ab-related-section .prod-img-wrap,
body.layout-compacto .pd-ab-rec-track .prod-img-wrap {
    flex: unset !important;
    width: 100% !important;
    height: auto !important;
    min-width: unset !important;
    aspect-ratio: 4/3 !important;
    border-radius: 0 !important;
    border: none !important;
    overflow: hidden !important;
}
body.layout-compacto .pd-ab-related-section .product h3,
body.layout-compacto .pd-ab-rec-track .product h3 {
    flex: unset !important;
    padding: 0.5rem 0.6rem 0.1rem !important;
    white-space: normal !important;
}
body.layout-compacto .pd-ab-related-section .product p,
body.layout-compacto .pd-ab-rec-track .product p {
    flex: unset !important;
    min-width: unset !important;
    text-align: left !important;
    padding: 0 0.6rem 0.4rem !important;
    font-size: 1rem !important;
}
body.layout-compacto .pd-ab-related-section .product > button:not(.quantity-controls button),
body.layout-compacto .pd-ab-rec-track .product > button:not(.quantity-controls button) {
    flex: unset !important;
    width: calc(100% - 1.2rem) !important;
    margin: 0 0.6rem 0.4rem !important;
    padding: 0.52rem 0 !important;
}
body.layout-compacto .pd-ab-related-section .quantity-controls,
body.layout-compacto .pd-ab-rec-track .quantity-controls {
    flex: unset !important;
    width: calc(100% - 1.2rem) !important;
    margin: 0 0.6rem 0.4rem !important;
}

@media (max-width: 780px) {
    body.layout-compacto .pd-ab-hero { grid-template-columns: 1fr; margin: 0; border-radius: 0; border-left: none; border-right: none; border-top: 3px solid var(--color-primario); align-items: stretch; }
    body.layout-compacto .pd-ab-images { border-right: none; border-bottom: 1px solid #dde3ec; position: static; align-self: auto; }
    body.layout-compacto .pd-carousel-frame { min-height: 56vw; max-height: 56vw; }
    body.layout-compacto .pd-ab-main-img { min-height: 56vw; max-height: 56vw; }
}

/* ── Carrito acorde al tema ── */
body.layout-compacto .header-cart-btn { background: var(--color-acento) !important; color: var(--color-primario) !important; border-radius: 4px; font-weight: 800; box-shadow: none; }
body.layout-compacto .header-cart-btn:hover { background: var(--color-acento) !important; }
body.layout-compacto #cart-count { background: var(--color-primario); color: #fff; border-radius: 3px; }
body.layout-compacto .cart-header { background: var(--color-primario); }
