/* ==========================================================================
   Product quick-view modal — mobile first
   Everything is scoped under .qv-premium so it can never collide with the
   legacy rules in assets/modal.css (which used bare, unscoped class names
   like .gallery-main, .size-pill, .color-item for the same feature).
   Brand tokens come from style.css (--qu-*).
   ========================================================================== */

:root {
    --qv2-primary: var(--qu-primary, #1E3A8A);
    --qv2-primary-deep: #16295E;
    --qv2-accent: var(--qu-accent, #3B82F6);
    --qv2-tint: var(--qu-badge-bg, #EFF6FF);
    --qv2-ink: var(--qu-text-dark, #111827);
    --qv2-muted: var(--qu-text-muted, #6B7280);
    --qv2-border: var(--qu-border-color, #E5E7EB);
    --qv2-success: #059669;
    --qv2-warning: #B45309;
    --qv2-danger: #DC2626;
}

.qv-premium {
    display: flex;
    flex-direction: column;
    font-family: inherit;
}

/* ==========================================================================
   Gallery
   ========================================================================== */
/* Sticky-while-scrolling only makes sense in the side-by-side desktop
   layout (see the >=768px block below), where the gallery and info
   sections are separate columns. Below that, .qv-premium stacks everything
   into one column — a sticky gallery there pins itself over the top of the
   viewport as the page scrolls and blocks/covers the info section (title,
   price, size selector) underneath it, making them unreachable. Static
   (normal flow) here so every option is actually reachable on mobile. */
.qv-gallery-col {
    background: #fff;
}

.qv-gallery {
    position: relative;
    padding: 1rem 1rem .75rem;
    background: linear-gradient(155deg, #F3F6FB 0%, #E9EEF6 100%);
}

.qv-wish-btn {
    position: absolute;
    top: 1.35rem;
    right: 1.35rem;
    z-index: 3;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--qv2-muted);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .14);
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease, transform .16s ease;
}
.qv-wish-btn:hover { color: var(--qv2-danger); transform: scale(1.07); }
.qv-wish-btn.active,
.qv-wish-btn.is-active { color: var(--qv2-danger); }
.qv-wish-btn.active svg,
.qv-wish-btn.is-active svg { fill: var(--qv2-danger); }

.qv-gallery-main {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    max-height: 46vh;
    background: #fff;
    border: 1px solid var(--qv2-border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}
.qv-gallery-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    padding: 1.1rem;
    display: block;
    transition: opacity .15s ease, transform .3s ease;
}
/* A missing product photo falls back to the generic placeholder — shown
   muted so it reads as "no photo yet", not as a broken page. */
.qv-gallery-img.is-fallback {
    opacity: .4;
    filter: grayscale(.4);
    transition: none;
}
.qv-gallery-thumb img.is-fallback {
    opacity: .5;
    filter: grayscale(.5);
}

.qv-gallery-main.is-empty {
    flex-direction: column;
    gap: .5rem;
    color: #9CA3AF;
}
.qv-gallery-main.is-empty i { font-size: 2rem; }
.qv-gallery-main.is-empty span { font-size: .8rem; font-weight: 600; }

.qv-gallery-counter {
    position: absolute;
    bottom: .7rem;
    right: .7rem;
    background: rgba(15, 23, 42, .78);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: .2rem .55rem;
    border-radius: 999px;
    backdrop-filter: blur(3px);
    font-variant-numeric: tabular-nums;
}

.qv-gallery-thumbs {
    display: flex;
    gap: .45rem;
    margin-top: .65rem;
    overflow-x: auto;
    padding-bottom: .2rem;
    -webkit-overflow-scrolling: touch;
}
.qv-gallery-thumbs::-webkit-scrollbar { height: 4px; }
.qv-gallery-thumbs::-webkit-scrollbar-thumb { background: #D3DBE6; border-radius: 10px; }

.qv-gallery-thumb {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    padding: 0;
    background: #fff;
    border: 1.5px solid var(--qv2-border);
    border-radius: 9px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .16s ease, transform .16s ease;
}
.qv-gallery-thumb img { width: 100%; height: 100%; object-fit: contain; padding: .3rem; }
.qv-gallery-thumb:hover { border-color: var(--qv2-accent); transform: translateY(-1px); }
.qv-gallery-thumb.is-active {
    border-color: var(--qv2-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, .12);
}

/* ==========================================================================
   Info column
   ========================================================================== */
.qv-info-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.qv-info-scroll { padding: 1.1rem 1.1rem .5rem; }

.qv-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .6rem;
}
.qv-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .25rem .55rem;
    border-radius: 999px;
}
.qv-chip.is-cat { background: var(--qv2-tint); color: var(--qv2-primary); }
.qv-chip.is-verified { background: #ECFDF5; color: var(--qv2-success); }
.qv-chip.is-verified i { font-size: .8rem; }

.qv-title {
    margin: 0 0 .3rem;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--qv2-ink);
    letter-spacing: -.01em;
}

.qv-meta {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--qv2-muted);
    margin-bottom: .85rem;
}
.qv-meta i { color: var(--qv2-primary); font-size: .9rem; }

.qv-price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .45rem;
    padding: .75rem .85rem;
    margin-bottom: .9rem;
    background: #F8FAFC;
    border: 1px solid var(--qv2-border);
    border-radius: 12px;
    font-variant-numeric: tabular-nums;
}
.qv-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--qv2-ink);
}
.qv-price-mrp {
    font-size: .85rem;
    color: #9CA3AF;
    text-decoration: line-through;
}
.qv-price-off {
    font-size: .68rem;
    font-weight: 800;
    color: var(--qv2-success);
    background: #ECFDF5;
    border-radius: 999px;
    padding: .15rem .45rem;
}
.qv-price-tax {
    flex-basis: 100%;
    font-size: .68rem;
    color: #9CA3AF;
}

.qv-description-wrap {
    padding-bottom: .9rem;
    margin-bottom: .9rem;
    border-bottom: 1px dashed var(--qv2-border);
}
.qv-description {
    font-size: .82rem;
    line-height: 1.65;
    color: var(--qv2-muted);
    margin: 0;
}
.qv-description.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.qv-readmore {
    background: none;
    border: none;
    padding: 0;
    margin-top: .35rem;
    font-size: .76rem;
    font-weight: 700;
    color: var(--qv2-primary);
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    cursor: pointer;
}

.qv-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
    margin-bottom: 1.1rem;
}
.qv-specs > div {
    padding: .55rem .7rem;
    background: #fff;
    border: 1px solid var(--qv2-border);
    border-radius: 10px;
}
.qv-specs span {
    display: block;
    font-size: .64rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #9CA3AF;
    font-weight: 700;
    margin-bottom: .1rem;
}
.qv-specs strong { font-size: .82rem; color: var(--qv2-ink); font-weight: 700; }

/* ---------- Options ---------- */
.qv-option-block { margin-bottom: 1.1rem; }

/* Colour swatches embedded in the gallery column sit on its gradient
   background, so give them their own separated, card-like strip. */
.qv-option-block--gallery {
    margin: .75rem 0 0;
    padding-top: .75rem;
    border-top: 1px dashed rgba(15, 23, 42, .1);
}
.qv-option-label {
    display: block;
    margin-bottom: .5rem;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--qv2-muted);
}

.qv-color-group {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-bottom: .5rem;
}
.qv-color-swatch {
    position: relative;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}
.qv-color-dot {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .1);
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--qv2-border);
    transition: box-shadow .16s ease;
}
.qv-color-check {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .85rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.qv-color-swatch:hover .qv-color-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--qv2-accent); }
.qv-color-swatch.is-selected .qv-color-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--qv2-primary); }
.qv-color-swatch.is-selected .qv-color-check { display: flex; }
.qv-color-swatch.out-of-stock { cursor: not-allowed; opacity: .35; }
.qv-color-swatch.out-of-stock:hover .qv-color-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--qv2-border); }

.qv-option-selected {
    display: block;
    font-size: .76rem;
    font-weight: 600;
    color: var(--qv2-ink);
}

.qv-size-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.qv-size-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 38px;
    padding: 0 .7rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--qv2-ink);
    background: #fff;
    border: 1.5px solid var(--qv2-border);
    border-radius: 9px;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.qv-size-pill:hover { border-color: var(--qv2-accent); }
.qv-size-pill.is-selected {
    background: var(--qv2-primary);
    border-color: var(--qv2-primary);
    color: #fff;
}
.qv-size-pill.out-of-stock {
    color: #C7CDD6;
    text-decoration: line-through;
    cursor: not-allowed;
    background: #F9FAFB;
}

/* ---------- Stock status ---------- */
.qv-stock-status {
    display: none;
    align-items: center;
    gap: .5rem;
    padding: .5rem .7rem;
    margin-bottom: 1rem;
    border-radius: 9px;
    font-size: .78rem;
    font-weight: 700;
}
.qv-stock-status.is-visible { display: flex; }
.qv-stock-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.qv-stock-status.is-ok { background: #ECFDF5; color: var(--qv2-success); }
.qv-stock-status.is-ok .qv-stock-dot { background: var(--qv2-success); }
.qv-stock-status.is-low { background: #FFFBEB; color: var(--qv2-warning); }
.qv-stock-status.is-low .qv-stock-dot { background: var(--qv2-warning); }
.qv-stock-status.is-out { background: #FEF2F2; color: var(--qv2-danger); }
.qv-stock-status.is-out .qv-stock-dot { background: var(--qv2-danger); }

/* ---------- Trust row ---------- */
.qv-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.qv-trust-row li {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .74rem;
    font-weight: 600;
    color: var(--qv2-muted);
}
.qv-trust-row i { color: var(--qv2-success); font-size: .9rem; }

/* ==========================================================================
   Sticky action bar
   ========================================================================== */
.qv-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 4;
    display: flex;
    align-items: stretch;
    gap: .6rem;
    padding: .8rem 1.1rem;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--qv2-border);
}

.qv-qty-stepper {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--qv2-border);
    border-radius: 10px;
    overflow: hidden;
    flex: none;
}
.qv-qty-btn {
    width: 36px;
    height: 100%;
    min-height: 44px;
    border: none;
    background: #F8FAFC;
    color: var(--qv2-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: .82rem;
}
.qv-qty-btn:hover { background: var(--qv2-tint); }
.qv-qty-value {
    width: 34px;
    text-align: center;
    font-weight: 800;
    font-size: .85rem;
    color: var(--qv2-ink);
    font-variant-numeric: tabular-nums;
}

.qv-add-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 44px;
    padding: 0 1rem;
    background: linear-gradient(135deg, var(--qv2-primary), var(--qv2-primary-deep));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(30, 58, 138, .24);
    transition: box-shadow .16s ease, transform .12s ease, opacity .16s ease;
}
.qv-add-btn:hover:not(:disabled):not(.disabled) {
    box-shadow: 0 6px 18px rgba(30, 58, 138, .34);
    transform: translateY(-1px);
}
.qv-add-btn:active:not(:disabled):not(.disabled) { transform: scale(.98); }
.qv-add-btn:disabled,
.qv-add-btn.disabled {
    background: #CBD5E1;
    box-shadow: none;
    cursor: not-allowed;
    opacity: .85;
}
.qv-add-btn i { font-size: 1rem; flex: none; }
.qv-add-btn-total {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    padding-left: .5rem;
    border-left: 1px solid rgba(255, 255, 255, .35);
}
.qv-add-btn .spinner-border { width: .9rem; height: .9rem; border-width: .15em; }

/* ==========================================================================
   Modal header — scoped to this modal only via .qv-modal-premium
   (that class is applied to the outer modal wrapper by editmodal.blade.php)
   ========================================================================== */
.qv-modal-premium .modal-icon-box {
    background: linear-gradient(135deg, var(--qv2-primary), var(--qv2-primary-deep));
    color: #fff;
}
.qv-modal-premium .modal-icon-box svg { color: #fff; }

/* Entrance: a soft scale + rise instead of Bootstrap's default flat
   translateY — reads as considered rather than just "a box appeared". */
.qv-modal-premium .modal-dialog {
    transition: transform .32s cubic-bezier(.22, 1, .36, 1), opacity .28s ease !important;
    transform: scale(.94) translateY(14px) !important;
    opacity: 0 !important;
}
.qv-modal-premium.show .modal-dialog {
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
}
@media (prefers-reduced-motion: reduce) {
    .qv-modal-premium .modal-dialog { transition: opacity .2s ease !important; transform: none !important; }
}

/* ==========================================================================
   Skeleton loading state — shaped like the real quick-view so the reveal
   feels continuous rather than a layout jump. Shimmer via a moving gradient
   masked by each block's own rounded shape.
   ========================================================================== */
.qv-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.qv-skeleton-block {
    position: relative;
    overflow: hidden;
    background: #EDF1F7;
    border-radius: 8px;
}
.qv-skeleton-block::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
    animation: qv-shimmer 1.4s ease-in-out infinite;
}
@keyframes qv-shimmer {
    100% { transform: translateX(100%); }
}

.qv-skeleton-gallery { padding: 1rem 1rem .75rem; background: linear-gradient(155deg, #F3F6FB 0%, #E9EEF6 100%); }
.qv-skeleton-image { aspect-ratio: 1 / 1; width: 100%; max-height: 46vh; border-radius: 14px; }
.qv-skeleton-row { display: flex; gap: .55rem; margin-top: .75rem; }
.qv-skeleton-dot { width: 38px; height: 38px; border-radius: 50%; }

.qv-skeleton-info { padding: 1.1rem 1.1rem 1.4rem; display: flex; flex-direction: column; gap: .6rem; }
.qv-skeleton-line { height: .8rem; }
.qv-skeleton-pricebox { height: 2.6rem; border-radius: 12px; margin: .2rem 0 .3rem; }
.qv-skeleton-pill { flex: 1; max-width: 60px; height: 38px; border-radius: 9px; }

@media (min-width: 768px) {
    .qv-skeleton { flex-direction: row; align-items: flex-start; }
    .qv-skeleton-gallery { flex: 0 0 44%; max-width: 44%; }
    .qv-skeleton-info { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .qv-skeleton-block::after { animation: none; }
}

/* ---------- Add-to-basket success morph ---------- */
.qv-add-btn.is-success {
    background: linear-gradient(135deg, var(--qv2-success), #047857);
    box-shadow: 0 4px 12px rgba(5, 150, 105, .3);
}
.qv-add-btn.is-success .qv-add-btn-total { border-left-color: rgba(255, 255, 255, .4); }

/* ---------- Low-stock urgency pulse ---------- */
.qv-stock-status.is-low .qv-stock-dot {
    animation: qv-pulse-dot 1.6s ease-in-out infinite;
}
@keyframes qv-pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(180, 83, 9, .45); }
    50% { box-shadow: 0 0 0 4px rgba(180, 83, 9, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .qv-stock-status.is-low .qv-stock-dot { animation: none; }
}

/* ==========================================================================
   >= 576px
   ========================================================================== */
@media (min-width: 576px) {
    .qv-gallery { padding: 1.25rem 1.25rem 1rem; }
    .qv-info-scroll { padding: 1.35rem 1.35rem .5rem; }
    .qv-action-bar { padding: .9rem 1.35rem; }
    .qv-title { font-size: 1.3rem; }
}

/* ==========================================================================
   >= 768px — side-by-side gallery + info
   ========================================================================== */
@media (min-width: 768px) {
    .qv-premium { flex-direction: row; align-items: flex-start; }

    .qv-gallery-col {
        flex: 0 0 44%;
        max-width: 44%;
        /* Only here, side-by-side with its own separate info column, does
           sticking the gallery while the info column scrolls make sense. */
        position: sticky;
        top: 0;
        z-index: 2;
        align-self: flex-start;
    }
    .qv-gallery-main { max-height: 52vh; }

    .qv-info-col { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .qv-gallery-img,
    .qv-wish-btn,
    .qv-add-btn,
    .qv-gallery-thumb { transition: none !important; }
    .qv-add-btn:hover:not(:disabled):not(.disabled) { transform: none; }
}
