.qv-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.qv-dialog {
    background: white;
    border-radius: 20px;
    max-width: 920px;
    width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    height: fit-content;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.25);
}

.qv-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.qv-close {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    right: 16px;
    z-index: 10;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    color: var(--navy, #0F2A44);
}

.qv-close:hover {
    background: #e0e0e0;
}

.qv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    gap: 16px;
    max-width: 100%;
    box-sizing: border-box;
}

.qv-loading p {
    max-width: 100%;
    text-align: center;
    overflow-wrap: break-word;
    line-height: 1.45;
    padding-inline: 8px;
}

/* Quick View skeleton loading */
.qv-skeleton {
    pointer-events: none;
}

.qv-skeleton-line,
.qv-skeleton-gallery,
.qv-skeleton-thumb,
.qv-skeleton-qty,
.qv-skeleton-btn {
    background: linear-gradient(90deg, #eceae4 25%, #f7f5f0 50%, #eceae4 75%);
    background-size: 200% 100%;
    animation: qv-skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes qv-skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.qv-skeleton-gallery {
    width: 100%;
    aspect-ratio: 1;
    max-height: min(52vh, 420px);
    border-radius: 12px;
}

.qv-skeleton-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.qv-skeleton-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    flex-shrink: 0;
}

.qv-skeleton-line {
    height: 14px;
    border-radius: 6px;
}

.qv-skeleton-brand {
    width: 72px;
    height: 12px;
    border-radius: 4px;
}

.qv-skeleton-title {
    height: 22px;
    border-radius: 8px;
}

.qv-skeleton-title--short {
    width: 72%;
    height: 18px;
}

.qv-skeleton-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.qv-skeleton-price {
    width: 120px;
    height: 24px;
    border-radius: 8px;
}

.qv-skeleton-wishlist {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-inline-start: auto;
    flex-shrink: 0;
}

.qv-skeleton-link {
    width: 140px;
    height: 14px;
    border-radius: 6px;
}

.qv-skeleton-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}

.qv-skeleton-qty {
    width: 132px;
    height: 48px;
    border-radius: 10px;
    align-self: flex-start;
}

.qv-skeleton-btn {
    width: 100%;
    height: 48px;
    border-radius: 10px;
}

.qv-skeleton-btn--outline {
    background: linear-gradient(90deg, #f3f1eb 25%, #faf8f4 50%, #f3f1eb 75%);
    background-size: 200% 100%;
}

.qv-body--loaded {
    animation: qv-content-fade-in 0.28s ease-out;
}

@keyframes qv-content-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qv-skeleton-line,
    .qv-skeleton-gallery,
    .qv-skeleton-thumb,
    .qv-skeleton-qty,
    .qv-skeleton-btn {
        animation: none;
        background: #eceae4;
    }

    .qv-skeleton-btn--outline {
        background: #f3f1eb;
    }

    .qv-body--loaded {
        animation: none;
    }
}

.qv-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top-color: var(--teal, #2BB8C8);
    border-radius: 50%;
    animation: qv-spin 0.8s linear infinite;
}

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

.qv-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 0;
}

.qv-gallery {
    padding: 24px;
    background: #f9f9f9;
    border-radius: 20px 0 0 20px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    align-self: start;
}

.qv-gallery .product-gallery--embedded {
    padding: 0;
    background: transparent;
    border: none;
    border-bottom: none;
    min-width: 0;
}

.qv-gallery .carousel-wrap {
    width: 100%;
    aspect-ratio: 1;
    max-height: min(52vh, 420px);
    border-radius: 12px;
}

.qv-gallery .carousel-main {
    width: 100%;
    height: 100%;
}

.qv-gallery .carousel-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.qv-gallery .thumbnail-strip {
    margin-top: 12px;
}

.qv-info {
    padding: 32px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    align-self: start;
    height: auto;
}

.qv-brand {
    font-size: 12px;
    font-weight: 600;
    color: var(--teal, #2BB8C8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.qv-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--navy, #0F2A44);
    margin: 0;
    line-height: 1.3;
    padding-inline-end: 44px;
}

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

.qv-price-row .wishlist-btn {
    margin-inline-start: auto;
    flex-shrink: 0;
}

.qv-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--navy, #0F2A44);
}

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

.qv-badge {
    background: #FF6B6B;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.qv-desc {
    font-size: 14px;
    color: var(--text-mid, #555);
    line-height: 1.6;
    margin: 0;
}

.qv-attrs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qv-attr-group label {
    font-size: 13px;
    font-weight: 700;
    color: var(--navy, #0F2A44);
    display: block;
    margin-bottom: 6px;
}

.qv-attr-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.qv-attr-btn {
    padding: 6px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.qv-attr-btn.selected {
    border-color: var(--teal, #2BB8C8);
    background: var(--teal, #2BB8C8);
    color: white;
}

.qv-attr-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.qv-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}

.qv-qty {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    align-self: flex-start;
}

.qv-qty button {
    width: 44px;
    height: 48px;
    border: none;
    background: #f5f5f5;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.15s;
}

.qv-qty button:hover:not(:disabled) {
    background: #e0e0e0;
}

.qv-qty button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.qv-qty span {
    padding: 0 16px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.qv-add-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--navy, #0F2A44);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1.35;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.qv-add-btn:hover:not(:disabled):not(.success):not(.adding) {
    background: var(--teal, #2BB8C8);
}

.qv-add-btn:disabled:not(.success):not(.adding) {
    background: #ccc;
    cursor: not-allowed;
}

.qv-add-btn.adding {
    background: var(--navy, #0F2A44);
    opacity: 0.85;
    cursor: wait;
}

.qv-add-btn.success,
.qv-add-btn.success:disabled {
    background: var(--navy, #0F2A44);
    cursor: default;
    opacity: 1;
}

.qv-add-checkout-btn {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    color: var(--navy, #0F2A44);
    border: 2px solid var(--navy, #0F2A44);
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.35;
    min-height: 48px;
}

.qv-add-checkout-btn:hover:not(:disabled):not(.adding) {
    background: var(--teal, #2BB8C8);
    border-color: var(--teal, #2BB8C8);
    color: white;
}

.qv-add-checkout-btn:disabled,
.qv-add-checkout-btn.adding {
    opacity: 0.55;
    cursor: not-allowed;
}

.qv-full-link {
    font-size: 13px;
    color: var(--teal, #2BB8C8);
    text-decoration: none;
    font-weight: 600;
    align-self: flex-start;
}

.qv-full-link--prominent {
    font-size: 14px;
    font-weight: 700;
    padding: 2px 0;
}

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

.qv-full-link--loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    opacity: 0.85;
    text-decoration: none;
}

.qv-full-link-spinner {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border: 2px solid rgba(15, 42, 68, 0.12);
    border-top-color: var(--teal, #2BB8C8);
    border-radius: 50%;
    animation: qv-spin 0.8s linear infinite;
}

.qv-nav-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(2px);
    border-radius: inherit;
    pointer-events: all;
}

.qv-nav-loading-overlay p {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--navy, #0F2A44);
    text-align: center;
    padding-inline: 24px;
    line-height: 1.45;
}

.qv-spinner--nav {
    width: 36px;
    height: 36px;
    border-width: 3px;
    border-color: rgba(15, 42, 68, 0.1);
    border-top-color: var(--teal, #2BB8C8);
}

.qv-close:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.qv-recent {
    border-top: 1px solid #eee;
    padding: 14px 20px 18px;
    flex-shrink: 0;
    background: #fafafa;
}

.qv-recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.qv-recent-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--navy, #0F2A44);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.qv-recent-clear {
    border: none;
    background: none;
    padding: 4px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--teal, #2BB8C8);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.qv-recent-clear:hover {
    color: var(--navy, #0F2A44);
}

.qv-recent-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 42, 68, 0.22) transparent;
}

.qv-recent-scroll::-webkit-scrollbar {
    height: 4px;
}

.qv-recent-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.qv-recent-scroll::-webkit-scrollbar-thumb {
    background: rgba(15, 42, 68, 0.2);
    border-radius: 999px;
}

.qv-recent-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 140px;
    width: 140px;
    scroll-snap-align: start;
    padding: 6px 8px 6px 6px;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    text-align: start;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.qv-recent-chip:hover {
    border-color: var(--teal, #2BB8C8);
    box-shadow: 0 2px 8px rgba(43, 184, 200, 0.12);
}

.qv-recent-thumb {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.qv-recent-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qv-recent-no-img {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e4e4e4 100%);
}

.qv-recent-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.qv-recent-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--navy, #0F2A44);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qv-recent-price {
    font-size: 11px;
    font-weight: 700;
    color: var(--teal, #2BB8C8);
}

.qv-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 64px 32px;
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
}

.qv-error p {
    margin: 0;
    color: var(--text-mid, #555);
    line-height: 1.5;
    overflow-wrap: break-word;
}

.qv-error-retry {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    background: var(--navy, #0F2A44);
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.qv-error-retry:hover {
    background: var(--teal, #2BB8C8);
}

@media (min-width: 681px) {
    .qv-dialog {
        height: fit-content;
        max-height: 90dvh;
    }

    .qv-body {
        flex: 0 1 auto;
        max-height: calc(90dvh - 2px);
    }

    .qv-info {
        padding: 28px 28px 20px;
        gap: 14px;
    }

    .qv-actions {
        margin-top: 4px;
    }
}

@media (max-width: 680px) {
    .qv-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .qv-dialog {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 92dvh;
        border-radius: 20px 20px 0 0;
    }

    .qv-body {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }

    .qv-dialog::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        border-radius: 999px;
        background: rgba(15, 42, 68, 0.14);
        margin: 10px auto 0;
        flex-shrink: 0;
    }

    .qv-content {
        grid-template-columns: 1fr;
    }

    .qv-gallery {
        padding: 12px 16px 8px;
        border-radius: 0;
        background: #fff;
    }

    .qv-gallery .carousel-wrap {
        max-height: min(34dvh, 240px);
        border-radius: 14px;
    }

    .qv-skeleton-gallery {
        max-height: min(34dvh, 240px);
        border-radius: 14px;
    }

    .qv-skeleton-thumbs {
        margin-top: 8px;
    }

    .qv-skeleton-thumb {
        width: 48px;
        height: 48px;
    }

    .qv-skeleton-title {
        height: 18px;
    }

    .qv-skeleton-title--short {
        height: 16px;
    }

    .qv-skeleton-price {
        width: 100px;
        height: 20px;
    }

    .qv-skeleton-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        margin-top: 8px;
        padding-top: 12px;
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #fff 18%);
    }

    .qv-skeleton-qty {
        width: 100%;
        align-self: stretch;
    }

    .qv-gallery .thumbnail-strip {
        margin-top: 8px;
    }

    .qv-gallery .gallery-cart-fab {
        bottom: max(10px, env(safe-area-inset-bottom));
        right: max(10px, env(safe-area-inset-right));
    }

    .qv-gallery .gallery-zoom-fab {
        bottom: max(10px, env(safe-area-inset-bottom));
        left: max(10px, env(safe-area-inset-left));
    }

    .qv-info {
        padding: 12px 16px max(20px, env(safe-area-inset-bottom));
        gap: 12px;
    }

    .qv-name {
        font-size: 18px;
        line-height: 1.35;
        padding-inline-end: 36px;
    }

    .qv-price {
        font-size: 20px;
    }

    .qv-old-price {
        font-size: 14px;
    }

    .qv-desc {
        font-size: 13px;
    }

    .qv-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        gap: 10px;
        margin-top: 8px;
        padding-top: 12px;
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #fff 18%);
    }

    .qv-qty {
        width: 100%;
        justify-content: space-between;
        align-self: stretch;
    }

    .qv-qty button {
        flex: 0 0 52px;
    }

    .qv-qty span {
        flex: 1;
    }

    .qv-add-btn,
    .qv-add-checkout-btn {
        width: 100%;
        min-height: 48px;
        font-size: 14px;
        padding: 12px 16px;
        white-space: normal;
    }

    .qv-full-link {
        align-self: flex-start;
        padding-bottom: 2px;
    }

    .qv-full-link--prominent {
        margin-top: -4px;
    }

    .qv-close {
        top: 10px;
        inset-inline-end: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    }

    .qv-loading {
        padding: 48px 16px max(24px, env(safe-area-inset-bottom));
    }

    .qv-error {
        padding: 48px 16px max(24px, env(safe-area-inset-bottom));
    }

    .qv-recent {
        padding: 12px 16px max(16px, env(safe-area-inset-bottom));
    }

    .qv-recent-scroll {
        scroll-snap-type: x mandatory;
        margin-inline: -16px;
        padding-inline: 16px;
    }

    .qv-recent-chip {
        flex: 0 0 132px;
        width: 132px;
    }
}

.stock-notify {
    width: 100%;
    margin-top: 4px;
}

.stock-notify-label {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-muted, #667085);
}

.stock-notify-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stock-notify-row input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border, #d0d5dd);
    border-radius: 10px;
    font-size: 15px;
}

.stock-notify-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--navy, #0F2A44);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    min-height: 48px;
}

.stock-notify-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.stock-notify-success {
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #ecfdf3;
    color: #027a48;
    font-size: 14px;
    line-height: 1.45;
}

.stock-notify-error {
    margin: 8px 0 0;
    color: #b42318;
    font-size: 13px;
}

.stock-notify--compact .stock-notify-label {
    font-size: 13px;
}
