/**
 * NovaFolio – Product Quick View Modal
 *
 * @package NovaFolio
 * @since   1.3.0
 */

/* ── Overlay & wrapper ──────────────────────────────────────────────── */

.nvf-quick-view {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s .35s;
}

.nvf-quick-view--open {
    pointer-events: auto;
    visibility: visible;
    transition-delay: 0s;
}

.nvf-quick-view__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    transition: opacity .3s ease;
}

.nvf-quick-view--open .nvf-quick-view__overlay {
    opacity: 1;
}

/* ── Modal panel ────────────────────────────────────────────────────── */

.nvf-quick-view__wrap {
    position: relative;
    z-index: 1;
    width: 850px;
    max-width: 92vw;
    max-height: 85vh;
    background: var(--nvf-bg, #fff);
    color: var(--nvf-text, #222);
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
    overflow-y: auto;
    transform: scale(.92) translateY(20px);
    opacity: 0;
    transition: transform .35s cubic-bezier(.4, 0, .2, 1), opacity .3s ease;
}

.nvf-quick-view--open .nvf-quick-view__wrap {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── Close button ───────────────────────────────────────────────────── */

.nvf-quick-view__close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 2;
    background: none;
    border: none;
    font-size: 28px !important;
    line-height: 1;
    cursor: pointer;
    color: var(--nvf-text-muted, #888);
    transition: color .2s;
    padding: 4px;
}

.nvf-quick-view__close:hover {
    color: var(--nvf-text, #222);
    border-radius: 20px !important;
    background-color: var(--nvf-surface);
}

/* ── Loader ─────────────────────────────────────────────────────────── */

.nvf-quick-view__loader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.nvf-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--nvf-border, #ddd);
    border-top-color: var(--nvf-color-accent, #222);
    border-radius: 50%;
    animation: nvf-spin .7s linear infinite;
}

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

/* ── Product layout (image + details side by side) ──────────────────── */

.nvf-quick-view__product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.nvf-quick-view__image {
    background: var(--nvf-surface, #f8f8f8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 8px 0 0 8px;
}

.nvf-quick-view__image img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.nvf-quick-view__details {
    padding: 30px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nvf-quick-view__title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.nvf-quick-view__title a {
    color: inherit;
    text-decoration: none;
}

.nvf-quick-view__title a:hover {
    text-decoration: underline;
}

.nvf-quick-view__price {
    font-size: 18px;
    font-weight: 700;
    color: var(--nvf-color-shop-list-price, var(--nvf-color-text, #222));
}

.nvf-quick-view__price del {
    color: var(--nvf-text-muted, #999);
    font-weight: 400;
    margin-right: 6px;
}

.nvf-quick-view__desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--nvf-text-muted, #555);
    max-height: 120px;
    overflow-y: auto;
}

.nvf-quick-view__desc p:last-child {
    margin-bottom: 0;
}

/* Add-to-cart button */
.nvf-quick-view__add-to-cart .button,
.nvf-quick-view__add-to-cart a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-radius: var(--nvf-woo-single-button-radius, var(--nvf-btn-radius, 4px));
    background: var(--nvf-woo-single-button-bg, var(--nvf-color-button-bg, #222));
    color: var(--nvf-woo-single-button-text, var(--nvf-color-button-text, #fff));
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity .2s;
}

.nvf-quick-view__add-to-cart .button:hover {
    opacity: .85;
}

/* Meta (SKU, categories) */
.nvf-quick-view__meta {
    font-size: 13px;
    color: var(--nvf-text-muted, #888);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nvf-quick-view__meta a {
    color: inherit;
}

.nvf-quick-view__full-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--nvf-color-accent, #222);
    text-decoration: none;
    margin-top: auto;
}

.nvf-quick-view__full-link:hover {
    text-decoration: underline;
}

/* ── Quick View button on product card (image hover overlay) ────────── */

/* Wrapper around the product link + Quick View button */
.nvf-product-thumb-wrap {
    position: relative;
    overflow: hidden;
}

/* Ensure the image is block-level inside the wrapper */
.nvf-product-thumb-wrap img {
    display: block;
    width: 100%;
    height: auto;
}

.nvf-quick-view-btn {
    position: absolute;
    bottom: 50%;
    left: 50%;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 16px !important;
    font-size: 11px !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
    white-space: nowrap;
    background: rgba(255, 255, 255, .92) !important;
    color: #222 !important;
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.85);
    transition: opacity .25s ease, transform .25s ease, background .2s ease;
    pointer-events: none;
    margin: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box;
    line-height: 1.3 !important;
}

/* Show on product card hover */
.nvf-product-thumb-wrap:hover > .nvf-quick-view-btn,
.nvf-product-thumb-wrap:focus-within > .nvf-quick-view-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.nvf-quick-view-btn:hover {
    background: #fff !important;
    color: #000 !important;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .22);
}

/* Touch devices: always show the button (no hover available) */
@media (hover: none) {
    .nvf-quick-view-btn {
        opacity: 1 !important;
        transform: translate(-50%, -50%) scale(1) !important;
        pointer-events: auto !important;
        background: rgba(255, 255, 255, .85) !important;
    }
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .nvf-quick-view__product {
        grid-template-columns: 1fr;
    }

    .nvf-quick-view__image {
        border-radius: 8px 8px 0 0;
        max-height: 250px;
        overflow: hidden;
    }

    .nvf-quick-view__details {
        padding: 20px;
    }
}

/* ── Body scroll lock ───────────────────────────────────────────────── */

body.nvf-quick-view-open {
    overflow: hidden;
}

/* ── Accessibility: reduce motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .nvf-quick-view,
    .nvf-quick-view__overlay,
    .nvf-quick-view__wrap,
    .nvf-quick-view__close,
    .nvf-quick-view__add-to-cart .button,
    .nvf-quick-view-btn {
        transition-duration: 1ms !important;
    }
    .nvf-quick-view--open .nvf-quick-view__wrap {
        transform: none;
    }
    .nvf-spinner {
        animation: none !important;
    }
}
