/*
 * Add-to-cart quick view (#addToCart modal).
 * Loaded synchronously so the popup never depends on the async aiz-core.css:
 * everything the popup needs to lay out (hidden radios, thumb column, gutters) lives here.
 */

#addToCart.rw-qv {
    --rw-qv-bg-from: #13141a;
    --rw-qv-bg-to: #08090b;
    --rw-qv-border: rgba(255, 255, 255, 0.08);
    --rw-qv-surface: rgba(255, 255, 255, 0.04);
    --rw-qv-text: #f3f4f6;
    --rw-qv-muted: rgba(255, 255, 255, 0.62);
    --rw-qv-accent: #ff4545;
    --rw-qv-accent-dark: #d42222;
    --rw-qv-accent-soft: rgba(255, 69, 69, 0.12);
    --rw-qv-radius: 16px;
    --rw-qv-radius-sm: 8px;
    --rw-qv-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --rw-qv-tap: 36px;
}

@media (pointer: coarse) {
    #addToCart.rw-qv {
        --rw-qv-tap: 44px;
    }
}

/* ── Shell ── */
#addToCart.rw-qv .modal-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#addToCart.rw-qv > .modal-dialog > .modal-content > .close,
#addToCart.rw-qv .c-preloader {
    display: none !important;
}

@media (min-width: 576px) and (max-width: 991.98px) {
    #addToCart.rw-qv .modal-dialog {
        max-width: 560px;
    }
}

#addToCart.rw-qv .rw-qv-body {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 85vh;
    max-height: 85dvh;
    overscroll-behavior: contain;
    border-radius: var(--rw-qv-radius);
}

#addToCart.rw-qv .premium-modal-wrapper {
    position: relative;
    padding: 16px;
    background: linear-gradient(145deg, var(--rw-qv-bg-from) 0%, var(--rw-qv-bg-to) 100%);
    border: 1px solid var(--rw-qv-border);
    border-radius: var(--rw-qv-radius);
    /* clip (not hidden) so the sticky buy row still works; stops sideways scroll from row gutters */
    overflow-x: clip;
    color: var(--rw-qv-text);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#addToCart.rw-qv .premium-modal-content {
    position: relative;
    z-index: 1;
}

/* Bootstrap grid gutters (aiz-core's .gutters-10 may not be loaded yet) */
#addToCart.rw-qv .rw-qv-gallery {
    margin-left: -5px;
    margin-right: -5px;
}

#addToCart.rw-qv .rw-qv-gallery > .col,
#addToCart.rw-qv .rw-qv-gallery > [class*='col-'] {
    padding-left: 5px;
    padding-right: 5px;
}

#addToCart.rw-qv .rw-qv-thumbs {
    width: 60px;
    flex: 0 0 60px;
    max-width: 60px;
}

/* ── Close ── */
#addToCart.rw-qv .custom-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: var(--rw-qv-tap);
    height: var(--rw-qv-tap);
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s var(--rw-qv-ease), border-color 0.2s var(--rw-qv-ease), transform 0.2s var(--rw-qv-ease);
}

#addToCart.rw-qv .custom-close i {
    font-size: 1.2rem;
    line-height: 1;
}

#addToCart.rw-qv .custom-close:hover {
    background: rgba(255, 69, 69, 0.9);
    border-color: var(--rw-qv-accent);
}

#addToCart.rw-qv .custom-close:focus-visible,
#addToCart.rw-qv .add-to-cart-btn:focus-visible,
#addToCart.rw-qv .product-quantity button:focus-visible,
#addToCart.rw-qv .rw-qv-retry:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

#addToCart.rw-qv .aiz-megabox > input:focus-visible + .aiz-megabox-elem {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* ── Gallery ── */
#addToCart.rw-qv .img-zoom {
    height: 280px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.3);
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#addToCart.rw-qv .img-zoom img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Thumbnail strip: native vertical scroll, swipe / wheel moves freely, snaps to thumbs */
#addToCart.rw-qv .carousel-thumb {
    height: 280px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-snap-type: y proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Fade the bottom edge so it is clear there are more thumbs */
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
    padding-bottom: 18px;
}

#addToCart.rw-qv .carousel-thumb::-webkit-scrollbar {
    display: none;
}

#addToCart.rw-qv .carousel-thumb .carousel-box {
    flex: 0 0 auto;
    height: 52px;
    border-radius: var(--rw-qv-radius-sm);
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    scroll-snap-align: start;
    transition: border-color 0.2s var(--rw-qv-ease);
}

#addToCart.rw-qv .carousel-thumb .carousel-box:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: -2px;
}

#addToCart.rw-qv .carousel-thumb .carousel-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0.6;
    transition: opacity 0.2s;
}

#addToCart.rw-qv .carousel-thumb .carousel-box.is-active {
    border-color: var(--rw-qv-accent);
}

#addToCart.rw-qv .carousel-thumb .carousel-box.is-active img,
#addToCart.rw-qv .carousel-thumb .carousel-box:hover img {
    opacity: 1;
}

/* Before slick runs, show only the first main image so nothing stacks or jumps */
#addToCart.rw-qv .aiz-carousel:not(.slick-initialized) > .carousel-box:not(:first-child) {
    display: none !important;
}

/* ── Info ── */
#addToCart.rw-qv .rw-qv-title {
    color: #ffffff;
    font-size: 1.2rem;
    line-height: 1.3;
    font-weight: 700;
    margin: 0 0 0.25rem;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#addToCart.rw-qv .rw-qv-price-row {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0.5rem 0;
}

/* Price box: one row when it fits; on narrow widths the GST note moves to a second line
   inside the box. Column layout (not wrapping) keeps the box hugging its content, so the
   left and right padding stay equal. */
#addToCart.rw-qv .price-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 69, 69, 0.1) 0%, rgba(255, 69, 69, 0.02) 100%);
    border: 1px solid rgba(255, 69, 69, 0.2);
    color: var(--rw-qv-accent);
}

#addToCart.rw-qv .rw-qv-price-main {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
}

/* Mobile: price box spans the full width; GST note goes to the right edge,
   or to a second line inside the box when there is no room. */
@media (max-width: 575.98px) {
    #addToCart.rw-qv .price-badge {
        display: flex;
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        row-gap: 4px;
    }
}

#addToCart.rw-qv .price-badge strong {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

/* Rupee icon + amount (display_rupee_price markup) stay together on one line */
#addToCart.rw-qv .rw-rupee-price {
    white-space: nowrap; /* stays inline so the <del> strike line still covers the MRP */
}

#addToCart.rw-qv .rw-rupee-icon {
    font-size: 0.9em;
    margin-right: 1px;
}

#addToCart.rw-qv .price-badge del {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    white-space: nowrap;
}

#addToCart.rw-qv .badge-discount {
    align-self: center;
    background: var(--rw-qv-accent);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

#addToCart.rw-qv .rw-qv-tax-note {
    color: var(--rw-qv-muted);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

#addToCart.rw-qv .club-point-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(243, 175, 61, 0.1);
    border: 1px solid rgba(243, 175, 61, 0.2);
    color: #f3af3d;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

#addToCart.rw-qv .option-label {
    display: block;
    margin-bottom: 4px;
    color: var(--rw-qv-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ── Variant chips ── */
#addToCart.rw-qv .aiz-radio-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#addToCart.rw-qv .aiz-megabox {
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
}

#addToCart.rw-qv .aiz-megabox > input {
    position: absolute;
    z-index: -1;
    opacity: 0;
}

#addToCart.rw-qv #option-choice-form .aiz-megabox-elem {
    min-width: var(--rw-qv-tap);
    min-height: var(--rw-qv-tap);
    padding: 4px 12px !important;
    border-radius: 6px !important;
    background: var(--rw-qv-surface) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #c4c4c4 !important;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-align: center;
    transition: border-color 0.2s var(--rw-qv-ease), background 0.2s var(--rw-qv-ease), color 0.2s var(--rw-qv-ease);
}

#addToCart.rw-qv #option-choice-form label.aiz-megabox:hover .aiz-megabox-elem {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

#addToCart.rw-qv #option-choice-form .aiz-megabox > input:checked + .aiz-megabox-elem {
    outline: none !important;
    background: var(--rw-qv-accent-soft) !important;
    border-color: var(--rw-qv-accent) !important;
    color: #ffffff !important;
    box-shadow: inset 0 0 0 1px var(--rw-qv-accent);
}

#addToCart.rw-qv #option-choice-form .color-swatch-elem {
    min-width: 0;
    width: var(--rw-qv-tap);
    height: var(--rw-qv-tap);
    padding: 0 !important;
    border-radius: 50% !important;
}

#addToCart.rw-qv .color-swatch-elem .rw-qv-swatch {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* ── Quantity + Add to cart row ── */
#addToCart.rw-qv .rw-qv-buy {
    --rw-qv-buy-h: max(48px, calc(var(--rw-qv-tap) + 8px));
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
    gap: 10px;
    margin-top: 4px;
}

#addToCart.rw-qv .rw-qv-cta {
    grid-column: 2;
    min-width: 0;
}

/* Digital products have no quantity: button spans the row */
#addToCart.rw-qv .rw-qv-buy > .rw-qv-cta:first-child,
#addToCart.rw-qv .rw-qv-buy > input[type='hidden'] + .rw-qv-cta {
    grid-column: 1 / -1;
}

#addToCart.rw-qv .rw-qv-qty .product-quantity {
    min-height: var(--rw-qv-buy-h);
}

#addToCart.rw-qv .rw-qv-cta .add-to-cart-btn {
    min-height: var(--rw-qv-buy-h);
}

#addToCart.rw-qv .product-quantity {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border-radius: var(--rw-qv-radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#addToCart.rw-qv .product-quantity button {
    width: var(--rw-qv-tap);
    height: var(--rw-qv-tap);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px !important;
    border: 1px solid transparent !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
}

#addToCart.rw-qv .product-quantity button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15) !important;
}

#addToCart.rw-qv .product-quantity button:disabled {
    opacity: 0.4;
}

#addToCart.rw-qv .product-quantity input {
    width: 44px;
    border: 0;
    background: transparent !important;
    color: #ffffff !important;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

#addToCart.rw-qv .product-quantity input::-webkit-outer-spin-button,
#addToCart.rw-qv .product-quantity input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#addToCart.rw-qv .rw-qv-stock {
    margin: 6px 0 0;
    color: var(--rw-qv-muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

/* ── Add to cart ── */
#addToCart.rw-qv .add-to-cart-btn {
    position: relative;
    width: 100%;
    min-height: 48px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 10px !important;
    background: linear-gradient(135deg, var(--rw-qv-accent) 0%, var(--rw-qv-accent-dark) 100%);
    color: #ffffff !important;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 15px rgba(255, 69, 69, 0.3);
    transition: transform 0.2s var(--rw-qv-ease), box-shadow 0.2s var(--rw-qv-ease);
}

#addToCart.rw-qv .add-to-cart-btn > span {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#addToCart.rw-qv .add-to-cart-btn:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(255, 69, 69, 0.4);
}

#addToCart.rw-qv .add-to-cart-btn:active:not(:disabled) {
    transform: scale(0.98);
}

#addToCart.rw-qv .add-to-cart-btn.out-of-stock {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    box-shadow: none;
    cursor: not-allowed;
}

#addToCart.rw-qv .add-to-cart-btn.rw-qv-external {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    box-shadow: none;
}

/* Loading keeps the label: icon swaps for a spinner, button width never changes */
#addToCart.rw-qv .add-to-cart-btn.is-loading {
    cursor: progress;
}

#addToCart.rw-qv .add-to-cart-btn.is-loading > i {
    display: none;
}

#addToCart.rw-qv .add-to-cart-btn.is-loading::before {
    content: '';
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: rw-qv-spin 0.7s linear infinite;
}

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

/* ── Loading skeleton + error ── */
#addToCart.rw-qv .rw-qv-skeleton-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 992px) {
    #addToCart.rw-qv .rw-qv-skeleton-grid {
        grid-template-columns: 5fr 7fr;
        align-items: center;
    }
}

#addToCart.rw-qv .rw-qv-skel {
    display: block;
    border-radius: var(--rw-qv-radius-sm);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: rw-qv-shimmer 1.2s ease-in-out infinite;
}

#addToCart.rw-qv .rw-qv-skel--media {
    height: 280px;
    border-radius: 12px;
}

#addToCart.rw-qv .rw-qv-skel--line {
    height: 14px;
    margin-bottom: 12px;
}

#addToCart.rw-qv .rw-qv-skel--title {
    height: 22px;
    width: 80%;
}

#addToCart.rw-qv .rw-qv-skel--price {
    height: 40px;
    width: 55%;
}

#addToCart.rw-qv .rw-qv-skel--chips {
    height: 36px;
    width: 70%;
}

#addToCart.rw-qv .rw-qv-skel--btn {
    height: 48px;
    margin-top: 20px;
    border-radius: 10px;
}

@keyframes rw-qv-shimmer {
    from {
        background-position: 100% 0;
    }
    to {
        background-position: -100% 0;
    }
}

#addToCart.rw-qv .rw-qv-error {
    padding: 48px 16px 32px;
    text-align: center;
}

#addToCart.rw-qv .rw-qv-error p {
    margin: 0 0 16px;
    color: var(--rw-qv-text);
    font-size: 1rem;
}

#addToCart.rw-qv .rw-qv-retry {
    min-height: 44px;
    padding: 0 24px;
    border: 1px solid var(--rw-qv-accent);
    border-radius: 10px;
    background: var(--rw-qv-accent-soft);
    color: #ffffff;
    font-weight: 700;
}

/* ── Breakpoints ── */
@media (max-width: 991.98px) {
    /* Stacked layout: columns use the popup padding, so the row never pokes out sideways */
    #addToCart.rw-qv .premium-modal-content {
        margin-left: 0;
        margin-right: 0;
    }
    #addToCart.rw-qv .premium-modal-content > [class*='col-'] {
        padding-left: 0;
        padding-right: 0;
    }
    /* Stacked layout: close button floats over the image corner instead of taking a row */
    #addToCart.rw-qv .custom-close {
        top: 18px;
        right: 18px;
    }
    /* Image scales with screen height so the Add to cart row fits without scrolling */
    #addToCart.rw-qv .img-zoom,
    #addToCart.rw-qv .carousel-thumb,
    #addToCart.rw-qv .rw-qv-skel--media {
        height: clamp(150px, 32vh, 280px);
        height: clamp(150px, 32dvh, 280px);
    }
    /* Very short screens: keep the quantity + Add to cart row pinned to the popup bottom */
    #addToCart.rw-qv .rw-qv-buy {
        position: sticky;
        bottom: 0;
        z-index: 2;
        padding: 8px 0;
        background: var(--rw-qv-bg-to);
        box-shadow: 0 -10px 12px -6px var(--rw-qv-bg-to);
    }
}

@media (min-width: 992px) {
    #addToCart.rw-qv .premium-modal-wrapper {
        padding: 20px;
    }
    /* Keep the title clear of the close button */
    #addToCart.rw-qv .rw-qv-title {
        padding-right: calc(var(--rw-qv-tap) + 8px);
    }
}

@media (max-width: 575.98px) {
    #addToCart.rw-qv .rw-qv-body {
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }
    #addToCart.rw-qv .premium-modal-wrapper {
        padding: 12px;
    }
    #addToCart.rw-qv .price-badge {
        padding: 6px 10px;
    }
    #addToCart.rw-qv .price-badge strong {
        font-size: 1.25rem;
    }
    #addToCart.rw-qv .rw-qv-title {
        font-size: 1.05rem;
    }
}

@media (max-width: 360px) {
    #addToCart.rw-qv .product-quantity button {
        width: 40px;
    }
    #addToCart.rw-qv .product-quantity input {
        width: 34px;
    }
    #addToCart.rw-qv .rw-qv-cta .add-to-cart-btn {
        padding: 10px 12px;
        font-size: 0.95rem;
        gap: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #addToCart.rw-qv .rw-qv-skel,
    #addToCart.rw-qv .add-to-cart-btn.is-loading::before {
        animation-duration: 0s;
        animation-iteration-count: 1;
    }
    #addToCart.rw-qv .modal-dialog.modal-dialog-zoom {
        transition: none;
    }
}
