/* =============================================================
   quickview.css — Estilos aislados para modal Quick View
   ============================================================= */

/* ── Icono expandir en tarjeta ─────────────────────────────── */
.qv-trigger-wrap {
    position: relative;
    display: block;
    cursor: pointer;
}

.qv-expand-btn {
    position: absolute;
    bottom: 0.4rem;
    left: 0.4rem;
    z-index: 10;
    width: 28px;
    height: 28px;
    background: rgba(10, 10, 11, 0.82);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(20, 121, 255, 0.45);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1479FF;
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
    pointer-events: none;
}

.qv-expand-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Desktop: visible solo en hover */
@media (min-width: 769px) {
    .qv-expand-btn {
        opacity: 0;
        width: 32px;
        height: 32px;
    }
    .qv-expand-btn svg {
        width: 16px;
        height: 16px;
    }
    .product-card:hover .qv-expand-btn {
        opacity: 1;
        transform: scale(1.08);
        background: rgba(20, 121, 255, 0.18);
    }
}

/* Móvil: pequeño, abajo-izquierda */
@media (max-width: 768px) {
    .qv-expand-btn {
        opacity: 1;
        width: 22px;
        height: 22px;
        bottom: 0.35rem;
        left: 0.35rem;
        border-radius: 4px;
        background: rgba(10, 10, 11, 0.75);
    }
    .qv-expand-btn svg {
        width: 11px;
        height: 11px;
    }
}

/* Zoom suave imagen al hover */
.qv-trigger-wrap .product-image-wrapper img,
.qv-trigger-wrap .product-placeholder {
    transition: transform 0.35s ease, filter 0.35s ease;
}
@media (min-width: 769px) {
    .product-card:hover .qv-trigger-wrap .product-image-wrapper img {
        transform: scale(1.04);
        filter: brightness(0.88);
    }
}

/* ── Overlay ───────────────────────────────────────────────── */
.qv-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(5, 5, 7, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 2rem);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.qv-overlay.qv-visible {
    display: flex;
    opacity: 0;
}

.qv-overlay.qv-in {
    opacity: 1;
}

/* ── Modal ─────────────────────────────────────────────────── */
.qv-modal {
    background: var(--grafito, #141417);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    width: 100%;
    max-width: 880px;
    max-height: 90vh;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7),
                0 0 0 1px rgba(20, 121, 255, 0.08);
    transform: scale(0.94) translateY(20px);
    transition: transform 0.32s cubic-bezier(0.34, 1.3, 0.64, 1),
                opacity 0.28s ease;
    opacity: 0;
    position: relative;
}

.qv-overlay.qv-in .qv-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── Columna imagen ────────────────────────────────────────── */
.qv-img-col {
    position: relative;
    background: linear-gradient(135deg,
        rgba(20, 121, 255, 0.07) 0%,
        rgba(217, 37, 37, 0.07) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    overflow: hidden;
}

/* ✅ FIX: imagen siempre visible, sin opacity:0 que dependa de JS */
.qv-img-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 1;
}

.qv-img-placeholder {
    font-size: 5rem;
    opacity: 0.25;
}

/* ── Loader ────────────────────────────────────────────────── */
.qv-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: var(--grafito, #141417);
    z-index: 2;
    transition: opacity 0.3s ease;
}

.qv-loader.qv-loader-hide {
    opacity: 0;
    pointer-events: none;
}

.qv-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(20, 121, 255, 0.2);
    border-top-color: #1479FF;
    border-radius: 50%;
    animation: qv-spin 0.75s linear infinite;
}

@keyframes qv-spin {
    to { transform: rotate(360deg); }
}

.qv-loader-text {
    color: var(--gris-texto, #B8B8BB);
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
}

/* ── Columna info ──────────────────────────────────────────── */
.qv-info-col {
    padding: clamp(1.5rem, 3vw, 2.5rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-height: 90vh;
}

.qv-category {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    background: rgba(20, 121, 255, 0.1);
    border: 1px solid rgba(20, 121, 255, 0.25);
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1479FF;
    width: fit-content;
    font-family: 'Inter', sans-serif;
}

.qv-name {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: var(--blanco-tecnico, #F2F2F4);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.qv-description {
    color: var(--gris-texto, #B8B8BB);
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
    line-height: 1.65;
    font-family: 'Inter', sans-serif;
}

.qv-stock-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
}

.qv-stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.qv-stock-dot.in-stock  { background: #28A745; box-shadow: 0 0 6px rgba(40,167,69,0.6); }
.qv-stock-dot.low-stock { background: #D92525; box-shadow: 0 0 6px rgba(217,37,37,0.6); }
.qv-stock-dot.out-stock { background: #555; }

.qv-stock-label { color: var(--gris-texto, #B8B8BB); }
.qv-stock-qty   { color: var(--blanco-tecnico, #F2F2F4); font-weight: 600; margin-left: auto; }

.qv-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 0;
}

.qv-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.qv-price-label {
    font-size: 0.8rem;
    color: var(--gris-texto, #B8B8BB);
    font-family: 'Inter', sans-serif;
}

.qv-price {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: #1479FF;
    letter-spacing: -0.03em;
}

.qv-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: #D92525;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    margin-top: auto;
}

.qv-cta-btn:hover {
    background: #B01E1E;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 37, 37, 0.35);
}

/* ── Botón cerrar ──────────────────────────────────────────── */
.qv-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    width: 36px;
    height: 36px;
    background: rgba(20, 20, 23, 0.85);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    color: var(--gris-texto, #B8B8BB);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    line-height: 1;
}

.qv-close-btn:hover {
    background: rgba(217, 37, 37, 0.85);
    color: #fff;
    transform: rotate(90deg);
}

/* ── Responsive móvil ──────────────────────────────────────── */
@media (max-width: 640px) {
    .qv-modal {
        grid-template-columns: 1fr;
        grid-template-rows: 220px 1fr;
        max-height: 92vh;
        border-radius: 14px;
    }

    .qv-img-col {
        min-height: 220px;
        border-radius: 14px 14px 0 0;
    }

    .qv-info-col {
        max-height: 52vh;
        padding: 1.2rem;
    }

    .qv-price {
        font-size: 1.5rem;
    }

    .qv-cta-btn {
        padding: 0.75rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .qv-modal {
        max-width: 680px;
    }
    .qv-img-col {
        min-height: 300px;
    }
}

.qv-info-col::-webkit-scrollbar { width: 4px; }
.qv-info-col::-webkit-scrollbar-track { background: transparent; }
.qv-info-col::-webkit-scrollbar-thumb {
    background: rgba(20, 121, 255, 0.4);
    border-radius: 4px;
}