/* ==========================================================================
   BLOCKSY QUICK VIEW - STYLES & RESPONSIVE DESIGN
   ========================================================================== */

/* Posizionamento relativo sul contenitore immagine del prodotto in griglia */
.woocommerce ul.products li.product .ct-media-container,
.woocommerce ul.products li.product .product-img,
.woocommerce ul.products li.product figure {
    position: relative !important;
}

/* Pulsante Occhio - Centrato sull'immagine */
.custom-qv-icon-btn {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.7) !important;
    z-index: 20 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #111 !important;
    border: none !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.25s ease !important;
}

/* Hover Desktop */
@media (hover: hover) and (pointer: fine) {
    .ct-media-container:hover .custom-qv-icon-btn,
    .product-img:hover .custom-qv-icon-btn,
    figure:hover .custom-qv-icon-btn {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translate(-50%, -50%) scale(1) !important;
    }

    .custom-qv-icon-btn:hover {
        background: #000 !important;
        color: #fff !important;
        transform: translate(-50%, -50%) scale(1.12) !important;
    }
}

/* Mobile Touch */
@media (hover: none) or (max-width: 768px) {
    .custom-qv-icon-btn {
        opacity: 0.95 !important;
        visibility: visible !important;
        transform: translate(-50%, -50%) scale(0.85) !important;
        width: 40px !important;
        height: 40px !important;
    }
}

/* ==========================================================================
   MODAL POPUP STYLES
   ========================================================================== */

.qv-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 99998;
    display: none;
}

.qv-popup {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    padding: 30px;
    width: 90%;
    max-width: 720px;
    max-height: 88vh;
    overflow-y: auto;
    z-index: 99999;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    display: none;
}

.qv-modal.qv-open .qv-overlay,
.qv-modal.qv-open .qv-popup {
    display: block;
}

.qv-close {
    position: absolute;
    top: 14px; right: 18px;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    border: none;
    background: none;
    color: #64748b;
    font-weight: 300;
    transition: color 0.2s ease;
}
.qv-close:hover { color: #000; }

.qv-loader {
    text-align: center;
    padding: 60px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #475569;
}

.qv-popup .single-product-content {
    display: flex !important;
    gap: 25px !important;
    align-items: flex-start !important;
}

/* --------------------------------------------------------------------------
   FORZATURA DIMENSIONE RIGIDA PER L'IMMAGINE PRODOTTO (DESKTOP & MOBILE)
   -------------------------------------------------------------------------- */

/* Box Contenitore dell'immagine */
#qv-content .qv-image {
    flex: 0 0 280px !important;
    width: 280px !important;
    height: 280px !important;
    max-width: 280px !important;
    max-height: 280px !important;
    overflow: hidden !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    background-color: #f8fafc !important;
}

/* Tag Immagine effettivo e contenitori nativi Woo */
#qv-content .qv-image a,
#qv-content .qv-image figure,
#qv-content .qv-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important; /* Ritaglia l'immagine riempiendo il quadrato senza deformarla */
    object-position: center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Dettagli Prodotto a fianco */
#qv-content .qv-details {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

#qv-content .qv-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #0f172a;
    line-height: 1.3;
}

#qv-content .qv-price {
    font-size: 19px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
}

#qv-content .qv-description {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 20px;
}

#qv-content .qv-wishlist-wrapper {
    margin-top: 12px;
}

/* ==========================================================================
   RESPONSIVE TABLET E MOBILE
   ========================================================================== */

@media (max-width: 640px) {
    .qv-popup {
        padding: 24px 16px !important;
        width: 92% !important;
    }
    
    #qv-content .single-product-content {
        flex-direction: column !important;
        align-items: center !important;
        gap: 18px !important;
    }

    /* Dimensione quadrata compatta su Mobile */
    #qv-content .qv-image {
        flex: 0 0 220px !important;
        width: 220px !important;
        height: 220px !important;
        max-width: 220px !important;
        max-height: 220px !important;
    }

    #qv-content .qv-details {
        width: 100% !important;
    }

    #qv-content .qv-title {
        font-size: 18px !important;
    }
}