/**
 * WIZ v2: QuickView — CSS
 * All defaults from production v1 settings.
 * Elementor controls override via class selectors.
 * z-index: 99999 (same as all v2 modals)
 */

/* ================================================================
   Body scroll lock
   ================================================================ */
body.wiz-quickview--body-locked {
    overflow: hidden !important;
}

/* ================================================================
   Root — hidden by default, no layout impact until opened
   ================================================================ */
.wiz-quickview {
    display: none;
}

.wiz-quickview--open {
    display: block;
}

/* ================================================================
   Overlay
   ================================================================ */
.wiz-quickview__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.wiz-quickview--open .wiz-quickview__overlay {
    opacity: 1;
    pointer-events: auto;
}

/* ================================================================
   Modal container
   ================================================================ */
.wiz-quickview__modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: min(72vw, 1200px);
    height: min(85vh, 800px);
    background: #fff;
    border-radius: 0;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.wiz-quickview--open .wiz-quickview__modal {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

/* ================================================================
   Quick View inner — flex column for header + content
   ================================================================ */
.wiz-qv {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    position: relative;
}

/* ================================================================
   Header
   ================================================================ */
.wiz-qv__header {
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    display: none;
}

.wiz-qv__header-title {
    font-size: 14px;
}

.wiz-qv__close {
    padding: 0;
    margin: 0;
    margin-left: auto;
    display: inline-flex;
    background: none;
    border: none;
    cursor: pointer;
}

.wiz-qv__close-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wiz-qv__close-icon svg {
    width: 20px;
    height: 20px;
    color: #26282D;
}

/* ================================================================
   Content close button (top-right X)
   ================================================================ */
.wiz-qv__close--content {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    padding: 0;
    margin: -7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #26282D;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
}

.wiz-qv__close--content .wiz-qv__close-icon svg {
    width: 16px;
    height: 16px;
}

/* ================================================================
   Content wrapper (scrollable)
   ================================================================ */
.wiz-qv__body-wrapper {
    overflow-y: auto;
    flex: 1;
}

/* ================================================================
   Content — flex row: left (images) + right (details)
   ================================================================ */
.wiz-qv__body {
    display: flex;
    padding: 32px 36px;
    gap: 40px;
}

/* ================================================================
   Left section — image + carousel
   ================================================================ */
.wiz-qv__left {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.wiz-qv__main-image {
    width: 450px;
    height: 450px;
    overflow: hidden;
}

.wiz-qv__main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.15s;
}

/* Match video sizing to image so QuickView's hero area renders
   videos at identical height + centering. The atom's __video-wrap
   absolute-fills the slide; these rules guarantee the <video>
   inside gets the same width/height/contain treatment as <img>. */
.wiz-qv__main-image video,
.wiz-qv__main-image .wiz-main-image__video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
}

.wiz-qv__main-image .wiz-main-image__video-wrap {
    width: 100%;
    height: 100%;
}

/* ================================================================
   Image carousel
   ================================================================ */
.wiz-qv__carousel {
    position: relative;
}

.wiz-qv__carousel.horizontal {
    width: 450px;
    height: 80px;
}

.wiz-qv__carousel.vertical {
    width: 80px;
    height: 450px;
}

.wiz-qv__thumbs {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 10px;
    scrollbar-width: thin;
}

.wiz-qv__carousel.horizontal .wiz-qv__thumbs {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
}

.wiz-qv__carousel.vertical .wiz-qv__thumbs {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

.wiz-qv__thumb {
    width: 80px;
    height: 80px;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    transition: opacity 0.15s, border-color 0.15s;
    border: 1px solid transparent;
}

.wiz-qv__thumb.active {
    border: 1px solid #000;
    opacity: 1;
}

.wiz-qv__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Carousel nav buttons */
.wiz-qv__carousel-prev,
.wiz-qv__carousel-next {
    cursor: pointer;
    padding: 4px;
    background-color: #f0f0f0;
    border-radius: 50%;
    position: absolute;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    width: 28px;
    height: 28px;
}

.wiz-qv__carousel-prev svg,
.wiz-qv__carousel-next svg {
    width: 20px;
    height: 20px;
    color: #222222;
}

/* Horizontal nav positioning */
.wiz-qv__carousel.horizontal .wiz-qv__carousel-prev {
    top: 50%;
    left: -18px;
    transform: translateY(-50%);
}

.wiz-qv__carousel.horizontal .wiz-qv__carousel-next {
    top: 50%;
    right: -18px;
    transform: translateY(-50%);
}

/* Vertical nav positioning */
.wiz-qv__carousel.vertical .wiz-qv__carousel-prev {
    left: 50%;
    top: -18px;
    transform: translateX(-50%);
}

.wiz-qv__carousel.vertical .wiz-qv__carousel-next {
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
}

/* ================================================================
   Right section — content items
   ================================================================ */
.wiz-qv__right {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

/* Side-by-side container */
.wiz-qv__side-by-side {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.wiz-qv__side-by-side-item {
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
}

.wiz-qv__item {
    display: flex;
    width: 100%;
}

/* ================================================================
   Content components
   ================================================================ */
.wiz-qv__name {
    font-size: 32px;
    font-weight: 500;
}

.wiz-qv__sku {
    font-size: 16px;
    font-weight: 400;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wiz-qv__pricing {
    width: 100%;
}

.wiz-qv__atc,
.wiz-qv__volume-tiers,
.wiz-qv__variants {
    width: 100%;
}

.wiz-qv__view-details {
    width: 100%;
    padding: 10px;
    background-color: transparent;
    color: #000;
    border: 2px solid #E9EBED;
    border-radius: 5px;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}

.wiz-qv__view-details:hover {
    background: #f5f5f5;
}

/* ================================================================
   Discount chip
   ================================================================ */
.wiz-qv__discount-chip .product-attribute {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--primary, #8155D9);
    color: var(--primary-text, #fff);
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
}

/* ================================================================
   Attribute rows
   ================================================================ */
.wiz-qv__attr-container {
    width: 100%;
}

.wiz-qv__attr-row {
    margin: 4px 0;
    line-height: 1.2;
    word-break: break-word;
    width: var(--qv-attr-row-width, 100%);
    height: var(--qv-attr-row-height, auto);
    padding: var(--qv-attr-row-padding, 0);
    background-color: var(--qv-attr-bg-color, transparent);
}

.wiz-qv__attr-row[style*="--qv-attr-row-height"]:not([style*="--qv-attr-row-height:auto"]) {
    overflow-y: auto;
}

.qv-attr-row--horizontal {
    display: flex;
}

.qv-attr-row--horizontal > .wiz-detail-key {
    min-width: 120px;
    font-weight: 600;
    color: var(--qv-attr-key-color, inherit);
}

.qv-attr-row--vertical > .wiz-detail-key {
    margin-bottom: var(--qv-attr-gap, 2px);
    font-weight: 600;
    color: var(--qv-attr-key-color, inherit);
}

.wiz-qv__attr-container .wiz-detail-value,
.wiz-qv__attr-container .qv-attr-content {
    color: var(--qv-attr-value-color, inherit);
}

.qv-attr-value--h-gap {
    margin-left: var(--qv-attr-gap, 2px);
}

.qv-attr-toggle {
    color: var(--primary, #0066cc);
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
}

/* Collapsed: clamp to 3 lines with ellipsis */
.qv-attr-show-more-wrap.qv-attr-collapsed .qv-attr-content {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qv-attr-editor-hint {
    color: #999;
    font-style: italic;
    font-size: 12px;
    padding: 4px 0;
}

/* ================================================================
   Skeleton loader
   ================================================================ */
@keyframes wiz-qv-skeleton-shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.wiz-qv__loader {
    position: relative;
    overflow: hidden;
    background-color: #f5f7fa;
    pointer-events: none;
}

.wiz-qv__loader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f5f7fa 0%, #e8ecf1 20%, #f5f7fa 40%, #f5f7fa 100%);
    background-size: 1000px 100%;
    animation: wiz-qv-skeleton-shimmer 2s ease-in-out infinite;
    z-index: 1;
}

.wiz-qv__loader * {
    visibility: hidden !important;
}

.wiz-qv__attr-container.wiz-qv__loader {
    min-height: 24px;
}

.wiz-qv__discount-chip.wiz-qv__loader {
    min-height: 32px;
    min-width: 120px;
}

/* ================================================================
   Responsive — tablet
   ================================================================ */
@media (max-width: 1024px) {
    .wiz-quickview__modal {
        width: 100vw;
        max-height: 71vh;
    }

    .wiz-qv__header {
        display: flex;
    }

    .wiz-qv__body {
        flex-direction: row;
    }

    .wiz-qv__main-image {
        width: 350px;
        height: 350px;
    }

    .wiz-qv__carousel.horizontal {
        width: 350px;
    }

    .wiz-qv__carousel.vertical {
        height: 350px;
    }

    .wiz-qv__left {
        flex-direction: column;
        justify-content: flex-start;
    }
}

/* ================================================================
   Responsive — mobile
   ================================================================ */
@media (max-width: 767px) {
    .wiz-quickview__modal {
        width: 100vw;
        max-height: 100dvh;
        height: 100dvh;
        border-radius: 0;
    }

    .wiz-qv__header {
        display: flex;
        border-bottom: none;
    }

    .wiz-qv__close--content {
        display: none;
    }

    .wiz-qv__body {
        flex-direction: column;
        padding: 0 16px 16px 16px;
    }

    .wiz-qv__left {
        flex-direction: column;
        justify-content: flex-end;
    }

    .wiz-qv__main-image {
        width: 100%;
        height: auto;
    }

    .wiz-qv__main-image img,
    .wiz-qv__main-image video,
    .wiz-qv__main-image .wiz-main-image__video,
    .wiz-qv__main-image .wiz-main-image__video-wrap {
        aspect-ratio: 1/1;
    }

    /* Mobile: ensure the atom's main-image container also keeps a
       1:1 box so the video has a parent height to fill. Without this
       the atom's aspect-ratio:1/1 + height:100% chain can collapse on
       some mobile browsers when the QuickView wrapper is height:auto. */
    .wiz-qv__main-image .wiz-main-image,
    .wiz-qv__main-image .wiz-main-image__stage,
    .wiz-qv__main-image .wiz-main-image__slide--active {
        aspect-ratio: 1/1;
    }

    .wiz-qv__carousel.horizontal,
    .wiz-qv__carousel.vertical {
        width: 100%;
        height: 68px;
    }

    .wiz-qv__thumb {
        width: 58px;
        height: 58px;
    }

    .wiz-qv__name {
        font-size: 20px;
        margin-top: 16px;
    }
}

/* ================================================================
   Editor preview
   ================================================================ */
.wiz-quickview--editor-preview {
    display: block;
}

.wiz-quickview--editor-preview .wiz-quickview__modal {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    z-index: auto;
    border: 2px dashed #93c5fd;
}

.wiz-quickview--editor-preview .wiz-quickview__overlay {
    display: none;
}
