﻿/* ============================================
   Quick View modal — theme-matched
   Theme palette:
     primary: #D10024  (sale / danger / primary CTA)
     green:   #0d9e71  (secondary accent)
     dark:    #15161D  (text, dark surfaces)
     ink:     #1E1F29  (alt dark)
     body:    #2B2D42  (body text)
     grey:    #8D99AE  (secondary text)
     border:  #E4E7ED  (dividers)
     surface: #FBFBFC  (light bg)
   ============================================ */
.qv-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background: rgba(21, 22, 29, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0.28s;
}

.qv-overlay.qv-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0s;
}

.qv-modal {
    background: #ffffff;
    color: #2B2D42;
    border-radius: 4px;
    box-shadow:
        0 30px 80px rgba(21, 22, 29, 0.35),
        0 8px 24px rgba(21, 22, 29, 0.12),
        0 0 0 1px rgba(21, 22, 29, 0.04);
    width: 100%;
    max-width: 1080px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Header */
.qv-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid #E4E7ED;
    background: linear-gradient(180deg, #FBFBFC, #ffffff);
}

.qv-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.qv-header-meta .qv-brand {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #D10024;
    font-weight: 700;
    white-space: nowrap;
}

.qv-header-meta .qv-cat {
    color: #8D99AE;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qv-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: #FBFBFC;
    color: #8D99AE;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    border: 1px solid #E4E7ED;
}

.qv-close:hover {
    background: #D10024;
    color: #ffffff;
    border-color: #D10024;
    transform: rotate(90deg);
}

/* Body */
.qv-body {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 0;
}

/* Gallery */
.qv-gallery {
    padding: 24px;
    background: #FBFBFC;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-right: 1px solid #E4E7ED;
}

.qv-main-image-wrap {
    position: relative;
    flex: 1;
    min-height: 280px;
    background: #ffffff;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #E4E7ED;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qv-main-image {
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    transition: opacity 0.18s ease;
    display: block;
}

.qv-main-image.qv-fading { opacity: 0; }

.qv-badge-row {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.qv-badge {
    padding: 5px 10px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.qv-badge-new   { background: #D10024; color: #ffffff; }
.qv-badge-sale  { background: #ef233c; color: #ffffff; }
.qv-badge-stock { background: #0d9e71; color: #ffffff; }
.qv-badge-out   { background: #8D99AE; color: #ffffff; }
.qv-badge-low   { background: #f59e0b; color: #ffffff; }

.qv-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.qv-thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 4px;
    overflow: hidden;
    background: #ffffff;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.qv-thumb:hover { transform: translateY(-2px); }
.qv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qv-thumb.qv-active { border-color: #D10024; }

/* Info column */
.qv-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.qv-name {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    color: #15161D;
    margin: 0;
    text-transform: none;
}

.qv-rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #8D99AE;
}

.qv-stars {
    color: #D10024;
    font-size: 14px;
    letter-spacing: 1px;
}

.qv-rating-num {
    font-weight: 700;
    color: #15161D;
}

.qv-review-link {
    color: #D10024;
    text-decoration: none;
    font-weight: 600;
}

.qv-review-link:hover { text-decoration: underline; }

.qv-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.qv-price {
    font-size: 26px;
    font-weight: 700;
    color: #D10024;
}

.qv-old-price {
    font-size: 16px;
    color: #8D99AE;
    text-decoration: line-through;
}

.qv-discount-pill {
    background: #D10024;
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 700;
}

.qv-stock-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.qv-stock-row .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.qv-stock-row.in-stock        .dot { background: #0d9e71; }
.qv-stock-row.low-stock       .dot { background: #f59e0b; }
.qv-stock-row.out-of-stock    .dot { background: #D10024; }
.qv-stock-row.in-stock        { color: #0d9e71; }
.qv-stock-row.low-stock       { color: #f59e0b; }
.qv-stock-row.out-of-stock    { color: #D10024; }

.qv-description {
    color: #8D99AE;
    font-size: 14px;
    line-height: 1.55;
    max-height: 4.65em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Options */
.qv-option-group { display: flex; flex-direction: column; gap: 6px; }

.qv-option-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: #2B2D42;
}

.qv-option-pills { display: flex; flex-wrap: wrap; gap: 6px; }

.qv-option-pill {
    padding: 7px 14px;
    border-radius: 2px;
    border: 1px solid #E4E7ED;
    background: #ffffff;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.qv-option-pill:hover { border-color: #D10024; }

.qv-option-pill.qv-active {
    border-color: #D10024;
    background: #D10024;
    color: #ffffff;
    font-weight: 600;
}

/* Reviews preview */
.qv-reviews {
    border-top: 1px solid #E4E7ED;
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qv-reviews-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qv-reviews-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: #8D99AE;
    margin: 0;
}

.qv-review-item {
    padding: 12px;
    border-radius: 4px;
    background: #FBFBFC;
    border: 1px solid #E4E7ED;
}

.qv-review-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.qv-review-author {
    font-weight: 700;
    font-size: 13px;
    color: #15161D;
}

.qv-review-stars {
    color: #D10024;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.qv-review-body {
    font-size: 13px;
    line-height: 1.45;
    color: #8D99AE;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.qv-review-title {
    font-size: 13px;
    font-weight: 700;
    color: #15161D;
    margin: 4px 0;
}

.qv-reviews-empty {
    text-align: center;
    color: #8D99AE;
    font-size: 13px;
    padding: 12px 0;
}

/* Footer */
.qv-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: #FBFBFC;
    border-top: 1px solid #E4E7ED;
    flex-wrap: wrap;
}

.qv-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #E4E7ED;
    border-radius: 4px;
    overflow: hidden;
    background: #ffffff;
    position: relative;
}

.qv-qty button {
    width: 34px;
    height: 38px;
    border: 0;
    background: transparent;
    color: #2B2D42;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s ease, color 0.15s ease;
}

.qv-qty button:hover {
    background: #D10024;
    color: #ffffff;
}

.qv-qty input {
    width: 44px;
    height: 38px;
    border: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #15161D;
    background: transparent;
    -moz-appearance: textfield;
}

.qv-qty input::-webkit-outer-spin-button,
.qv-qty input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qv-secondary-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.qv-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #E4E7ED;
    background: #ffffff;
    color: #8D99AE;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.qv-icon-btn:hover {
    border-color: #D10024;
    color: #D10024;
}

.qv-icon-btn.qv-active {
    background: #D10024;
    border-color: #D10024;
    color: #ffffff;
}

.qv-icon-btn.qv-active.qv-compare {
    background: #15161D;
    border-color: #15161D;
    color: #ffffff;
}

.qv-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
    flex-wrap: wrap;
}

.qv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 22px;
    border-radius: 4px;
    border: 0;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.qv-btn:active { transform: translateY(1px); }

.qv-btn-cart {
    background: #D10024;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(209, 0, 36, 0.28);
}

.qv-btn-cart:hover { background: #b00020; }

.qv-btn-buy {
    background: #15161D;
    color: #ffffff;
}

.qv-btn-buy:hover { background: #1E1F29; }

.qv-btn[disabled],
.qv-btn.qv-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.qv-btn.qv-loading i { animation: qv-spin 0.8s linear infinite; }

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

.qv-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.qv-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(209, 0, 36, 0.15);
    border-top-color: #D10024;
    border-radius: 50%;
    animation: qv-spin 0.9s linear infinite;
}

.qv-error {
    padding: 32px;
    text-align: center;
    color: #8D99AE;
    font-size: 15px;
}

.qv-error i {
    font-size: 36px;
    color: #D10024;
    margin-bottom: 10px;
    display: block;
}

.qv-product-link {
    color: #D10024;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qv-product-link:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 900px) {
    .qv-overlay { padding: 12px; }
    .qv-modal { max-height: calc(100vh - 24px); }
    .qv-body { grid-template-columns: 1fr; }
    .qv-gallery {
        border-right: 0;
        border-bottom: 1px solid #E4E7ED;
        max-height: 360px;
    }
    .qv-main-image-wrap { min-height: 200px; }
    .qv-info { padding: 18px; }
    .qv-header { padding: 14px 18px; }
}

@media (max-width: 560px) {
    .qv-overlay { padding: 0; }
    .qv-modal {
        border-radius: 4px 4px 0 0;
        max-height: 100vh;
        max-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        width: 100%;
    }
    .qv-footer {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        gap: 10px;
    }
    .qv-footer .qv-secondary-actions,
    .qv-footer .qv-qty { align-self: flex-start; }
    .qv-actions { margin-left: 0; width: 100%; }
    .qv-actions .qv-btn { flex: 1; min-width: 0; }
    .qv-name { font-size: 19px; }
    .qv-price { font-size: 22px; }
}

body.qv-modal-open {
    overflow: hidden;
    padding-right: var(--qv-scrollbar-width, 0px);
}

@media (prefers-reduced-motion: reduce) {
    .qv-overlay,
    .qv-modal,
    .qv-btn,
    .qv-icon-btn,
    .qv-thumb,
    .qv-option-pill,
    .qv-close { transition: none !important; animation: none !important; }
}

.locale-rtl .qv-gallery {
    border-right: 0;
    border-left: 1px solid #E4E7ED;
}

.locale-rtl .qv-badge-row { left: auto; right: 12px; }

@media (max-width: 900px) {
    .locale-rtl .qv-gallery {
        border-left: 0;
        border-bottom: 1px solid #E4E7ED;
    }
}

.qv-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.qv-trigger:focus-visible {
    outline: 2px solid #D10024;
    outline-offset: 2px;
    border-radius: 6px;
}
