/* Estilos propios de productos.php (se cargan después de style.css) */

/* =====================================================================
   Ficha del producto (ventana de detalle + relacionados)
   ===================================================================== */
.qv {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.qv[hidden] { display: none; }
.qv-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 14, 20, .72);
    opacity: 0;
    transition: opacity .25s ease;
}
.qv-panel {
    position: relative;
    width: min(1040px, 100%);
    max-height: calc(100vh - 48px);
    max-height: calc(100svh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 40px 90px rgba(0, 0, 0, .4);
    opacity: 0;
    transform: translateY(24px) scale(.97);
    transition: opacity .3s ease, transform .35s cubic-bezier(.22, .8, .24, 1);
}
.qv.is-open .qv-backdrop { opacity: 1; }
.qv.is-open .qv-panel { opacity: 1; transform: none; }
body.qv-open { overflow: hidden; }

.qv-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    color: var(--pest-navy);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    transition: background .2s ease, color .2s ease;
}
.qv-close:hover { background: var(--pest-green); color: #fff; }

.qv-main {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}
.qv-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f1f5f3;
    border-radius: 22px 0 0 0;
    overflow: hidden;
}
.qv-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: qv-img-in .4s ease;
}
@keyframes qv-img-in { from { opacity: 0; transform: scale(1.04); } }

.qv-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 40px 34px 30px;
    min-width: 0;
}
.qv-badge {
    align-self: flex-start;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--pest-green-dark);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.qv-badge.is-empresa { background: var(--pest-navy); }
.qv-info h2 {
    margin: 0;
    padding-right: 30px;
    font-size: clamp(22px, 2.4vw, 28px);
    line-height: 1.2;
    color: var(--pest-navy);
}
.qv-price strong { font-size: 32px; font-weight: 900; color: var(--pest-green-dark); }
.qv-price span { font-size: 14px; color: #8a9a94; }
.qv-desc { margin: 0; font-size: 15px; color: #4f625c; }
.qv-perks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--pest-green-dark);
}
.qv-perks li::before { content: '✓ '; font-weight: 900; }

.qv-buy { display: flex; gap: 10px; margin-top: 6px; }
.qv-qty {
    display: flex;
    align-items: center;
    border: 2px solid #dbe6e1;
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
}
.qv-qty button {
    width: 42px;
    height: 46px;
    border: 0;
    background: transparent;
    color: var(--pest-navy);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
}
.qv-qty button:hover { background: #eef6f1; }
.qv-qty span { min-width: 28px; text-align: center; font-weight: 800; font-size: 16px; }
.qv-add { flex: 1; }
.qv-wa { width: 100%; }

/* Relacionados */
.qv-related {
    padding: 24px 34px 30px;
    border-top: 1px solid #e7efe9;
    background: #f7faf8;
    border-radius: 0 0 22px 22px;
}
.qv-related-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.qv-related-head h3 { margin: 0; font-size: 18px; color: var(--pest-navy); }
.qv-arrows { display: flex; gap: 8px; }
.qv-arrows button {
    width: 36px;
    height: 36px;
    border: 2px solid #dbe6e1;
    border-radius: 50%;
    background: #fff;
    color: var(--pest-navy);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.qv-arrows button:hover { background: var(--pest-green); border-color: var(--pest-green); color: #fff; }
.qv-slider {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 6px;
    scrollbar-width: thin;
}
.qv-rel {
    flex: 0 0 180px;
    scroll-snap-align: start;
    padding: 0;
    border: 1px solid #e3ebe7;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}
.qv-rel:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(10, 25, 20, .12); }
.qv-rel img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f1f5f3; }
.qv-rel-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 9px 11px 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--pest-navy);
}
.qv-rel-price { display: block; padding: 4px 11px 11px; font-size: 14px; font-weight: 800; color: var(--pest-green-dark); }

/* Celular: la ficha sube desde abajo y ocupa casi toda la pantalla */
@media (max-width: 760px) {
    .qv { padding: 0; align-items: flex-end; }
    .qv-panel {
        max-height: 94vh;
        max-height: 94svh;
        border-radius: 20px 20px 0 0;
        transform: translateY(60px);
    }
    .qv-main { grid-template-columns: minmax(0, 1fr); }
    .qv-media { aspect-ratio: 4 / 3; border-radius: 20px 20px 0 0; }
    .qv-close { top: 10px; right: 10px; width: 38px; height: 38px; font-size: 24px; }
    .qv-info { padding: 18px 18px 20px; gap: 11px; }
    .qv-info h2 { padding-right: 0; font-size: 21px; }
    .qv-price strong { font-size: 26px; }
    .qv-desc { font-size: 14px; }
    .qv-related { padding: 18px 18px 24px; border-radius: 0; }
    .qv-arrows { display: none; }
    .qv-rel { flex-basis: 44%; }
}

@media (prefers-reduced-motion: reduce) {
    .qv-panel, .qv-backdrop { transition: none; }
    .qv-media img { animation: none; }
}

/* =====================================================================
   Hogar / Empresa en celular: slider compacto, una tarjeta a la vez
   ===================================================================== */
.split-dots { display: none; }

@media (max-width: 640px) {
    .split-grid {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .split-grid::-webkit-scrollbar { display: none; }
    .split-card {
        flex: 0 0 100%;
        scroll-snap-align: center;
        padding: 0 18px 16px;
    }
    .split-card:hover { transform: none; }
    .split-card.filter-panel.active { outline-offset: -3px; }   /* el slider recortaría el borde exterior */
    .split-bg { height: 96px; margin: 0 -18px; }
    .split-icon { font-size: 26px; margin-top: -26px; }
    .split-card h3 { font-size: 19px; margin: 4px 0 6px; }
    .split-card p {
        margin: 0 0 10px;
        font-size: 13px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .split-cta { font-size: 13px; }

    .split-dots { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
    .split-dots span {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: #c9d8d1;
        cursor: pointer;
        transition: width .25s ease, background .25s ease;
    }
    .split-dots span.is-active { width: 22px; background: var(--pest-green); }
}

/* Información ampliada en la ficha del producto */
.qv-details { margin: 4px 0 8px; display: grid; gap: 10px; }
.qv-details:empty { display: none; }
.qv-details dt { font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--pest-green-dark); }
.qv-details dd { margin: 2px 0 0; font-size: 14px; line-height: 1.55; color: #4b5a56; }

/* Página de producto (/producto/nombre) */
.pd-crumb { font-size: 14px; color: #6f827c; margin-bottom: 18px; }
.pd-crumb a { color: var(--pest-green-dark); font-weight: 700; }
.pd-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.pd-media { border-radius: 22px; overflow: hidden; background: #f1f5f3; aspect-ratio: 1 / 1; }
.pd-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-info { padding: 0; }
.pd-info h1 { margin: 0; font-size: clamp(24px, 3vw, 34px); line-height: 1.2; color: var(--pest-navy); }
.pd-related-title { margin: 44px 0 18px; font-size: 22px; color: var(--pest-navy); }
.pd-related { margin-top: 0; }
@media (max-width: 760px) { .pd-grid { grid-template-columns: 1fr; gap: 20px; } }

/* Advertencia visible (cebos, etc.) */
.product-warning { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: #fff4e0; border: 1px solid #f2c777; color: #7a4b00; font-size: 12.5px; font-weight: 700; line-height: 1.4; }
.product-warning[hidden] { display: none; }
