.block-product-card .product-card-style--card {
    background-color: rgb(var(--color-background));
}

/* Each card is its own stacking context, so the badge layer (z-index --zindex-m: 400) and the
   sold-out badge (z-index 1000) only stack within the card and can't paint over the header
   mega-menu, drawers or other page overlays. The quick-add modal is unaffected: it is moved
   to <body> when opened (data-popup-container="body"). */
.block-product-card {
    isolation: isolate;
}

.block-product-card__layer-image-wrapper {
    position: relative;
    display: flex;
    width: 100%;
    padding: var(--padding);
    overflow: hidden;
}

/* AR: swap to the 2nd image when hovering anywhere on the product card (title, price,
   quick-add area too), not just the image. .block-product-card is the whole card on
   every page; .av-product-item is the PLP grid cell around it. */
@media (hover: hover) and (min-width: 960px) {
    .block-product-card:hover .block-product-card__layer-image-wrapper.hover .block-product-card__image:nth-of-type(1),
    .av-product-item:hover .block-product-card__layer-image-wrapper.hover .block-product-card__image:nth-of-type(1) {
        opacity: 0;
    }

    .block-product-card:hover .block-product-card__layer-image-wrapper.hover .block-product-card__image:nth-of-type(2),
    .av-product-item:hover .block-product-card__layer-image-wrapper.hover .block-product-card__image:nth-of-type(2) {
        opacity: 1;
    }
}

.block-product-card__image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    aspect-ratio: var(--aspect-ratio);
    overflow: hidden;    
    border-radius: var(--border-radius);
}

.block-product-card__image-wrapper>svg {
    width: 100%;
    height: 100%;
}

.block-product-card__image-wrapper>.block-product-card__image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: var(--fit-type);
    transition: opacity 1s;
}

.block-product-card__image-wrapper>.block-product-card__image:nth-of-type(1) {
    opacity: 1;
}

.block-product-card__image-wrapper>.block-product-card__image:nth-of-type(2) {
    opacity: 0;
}

.block-product-card__layer-wrapper {
    position: absolute;
    inset: 0;
    height:fit-content;
    z-index:var(--zindex-m);
}

.block-product-card__quick-add {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    background-color: rgb(0 0 0 / 40%);
    border: 0;
    border-radius: 50%;
}

@media (hover: hover) {
    .block-product-card__quick-add:hover {
        background-color: rgb(0 0 0 / 60%);
    }
}

.block-product-card__quick-add svg {
    width: 100%;
    height: 100%;
}

@media (max-width: 959px) {
    .block-product-card__quick-add {
        width: 24px;
        height: 24px;
    }
}

.block-product-card__quick-add .icon-loading {
    display: none;
    margin: 8px;
    color: rgb(255 255 255 / 100%);
    animation: animation-button-loading linear 1.5s infinite;
}

.block-product-card__quick-add.loading {
    pointer-events: none;
    background-color:var(--color-grey);
}

.block-product-card__quick-add.loading .quick-add-icon {
    display: none;
}

.block-product-card__quick-add.loading .icon-loading {
    display: block;
}


.block-product-card__quick-add.loading .quick-add-text {
    visibility: hidden;
}

.block-product-card__modal-content {
    position: relative;
    width: 80vw;
    max-width: 1200px;
    max-height: 80vh;
    overflow-y: auto;
    /* The fetched product page's own markup/scripts land here verbatim and
       can carry their own positioned, z-indexed elements (gallery controls,
       sticky buy bar, etc.). isolation:isolate traps all of that inside its
       own stacking context so nothing it contains can render above the
       modal's close button, which sits outside this element as a sibling. */
    isolation: isolate;
}

.block-product-card__modal-content .breadcrumb {display:none;}

/* Quick view keeps it to the essentials: no short description, tasting notes or gallery thumbnails.
   Hidden rather than removed so the PDP scripts still find the elements they expect. */
.block-product-card__modal-content .product-detail-sections .product-detail__shortdescription,
.block-product-card__modal-content .product-detail-sections .product-detail__tasting-row,
.block-product-card__modal-content .product-detail-sections .media-gallery__thumbnails {
    display: none;
}

/* On the PDP the gallery column is sticky with top: 120px to clear the site header
   (custom-product/detail.css, "Desktop sticky gallery"). Inside the quick view the modal is the
   scroll container, so that offset pushed the image 120px down. Stick to the modal's top instead. */
@media (min-width: 960px) {
    .block-product-card__modal-content .product-detail-sections theme-product-detail .product-detail__col:has(.product-detail__media-gallery) {
        top: 0;
    }
}

@media (max-width: 959px) {
    .block-product-card__modal-content {
        width: 100%;
    }
}

.block-product-card__modal-content .quick-add-hidden {
    display: none;
}

.block-product-card__modal-content theme-product-detail {
    --page-padding: 40px;
    --detail-padding-inline-start: 0px !important;
    --detail-padding-inline-end: 0px !important;
    --detail-padding-block-start: 0px !important;
    --detail-padding-block-end: 0px !important;

    padding: var(--page-padding);
}

.block-product-card__modal-close {
    position: absolute;
    inset-block-start: 10px;
    inset-inline-end: 15px;
    z-index: 20;
    pointer-events: auto;
    color: var(--color-body);
    background: white;
}

/* Quick view: no USPs (they stay on the product page). */
.block-product-card__modal-content .product-detail__usps,
.block-product-card__modal-content .product-detail-block:has(> .product-detail__usps) {
    display: none;
}

/* Quick view: no Buy Now, just quantity + Add to Cart (Buy Now is whatever follows Add to Cart
   in .form__buttons, generated by Shopline's payment_button). */
.block-product-card__modal-content .product-detail__buy-buttons .form__buttons > .button[name="add"] ~ * {
    display: none !important;
}

/* Quick view: "View full details" link under the buy buttons (added by quick-add-modal.js). */
.block-product-card__full-details {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: var(--size-12, 12px);
    margin-top: var(--size-24, 24px);
    color: var(--color-body);
    font-size: var(--font-size-xs);
    font-weight: 600;
    letter-spacing: var(--letter-spacing-small);
    text-transform: uppercase;
    text-decoration: none;
}
.block-product-card__full-details span {
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 1px;
}
.block-product-card__full-details svg {
    width: 16px;
    height: auto;
    flex: none;
    transition: transform 0.2s ease;
}
@media (hover: hover) {
    .block-product-card__full-details:hover svg {
        transform: translateX(4px);
    }
}

/* Quick view drag handle: mobile bottom sheet only. */
.block-product-card__modal-handle {
    display: none;
}

/* Keeps the sheet out of view while the modal runs its close animation after a pull-down close. */
@keyframes quick-add-sheet-hidden {
    from, to {
        opacity: 0;
        transform: translateY(100%);
    }
}

@media (max-width: 959px) {
    .block-product-card__modal {
        --quick-add-handle-height: 28px;
        --quick-add-sheet-top-gap: 24px; /* keep in sync with SHEET_TOP_GAP in quick-add-modal.js */
        --quick-add-thumb-size: 96px;
    }

    .block-product-card__modal-handle {
        display: flex;
        align-items: center;
        justify-content: center;
        height: var(--quick-add-handle-height);
        cursor: grab;
        touch-action: none;
        user-select: none;
    }
    .block-product-card__modal-handle span {
        display: block;
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background-color: var(--color-body);
        opacity: 0.2;
    }
    .block-product-card__modal.is-dragging .block-product-card__modal-handle {
        cursor: grabbing;
    }

    /* Dragged up: the sheet fills the screen bar a small gap at the top. */
    .block-product-card__modal.is-expanded .block-product-card__modal-content {
        height: calc(100vh - var(--quick-add-sheet-top-gap) - var(--quick-add-handle-height));
        height: calc(100dvh - var(--quick-add-sheet-top-gap) - var(--quick-add-handle-height));
        max-height: none;
    }

    /* Fade the backdrop out with the sheet on a pull-down close. */
    [data-mount-modal].is-sheet-closing::before {
        opacity: 0;
        transition: opacity 0.25s ease;
    }

    /* Compact header like the mockup: small image on the left, title and price beside it,
       everything else full width below. The info column is flattened into the grid
       (display: contents) so its title and price can sit next to the image. */
    /* Three columns: image | spacer | rest. Title and price span the spacer and the rest. The
       quantity selector spans image + spacer (the spacer grows to fit it) and Add to Cart takes
       the rest, so the two share one row like on the PDP. */
    .block-product-card__modal-content .product-detail-sections theme-product-detail {
        display: grid;
        grid-template-columns: var(--quick-add-thumb-size) auto minmax(0, 1fr);
        column-gap: var(--size-16, 16px);
        row-gap: 0;
        align-items: start;
    }
    .block-product-card__modal-content .product-detail-sections theme-product-detail > .product-detail__media-group {
        grid-column: 1;
        grid-row: 1 / span 2;
        width: 100%;
        max-width: none;
        min-width: 0;
        margin: 0;
    }
    .block-product-card__modal-content .product-detail-sections theme-product-detail > .product-detail__info {
        display: contents;
    }
    .block-product-card__modal-content .product-detail-sections theme-product-detail > .product-detail__info > * {
        grid-column: 1 / -1;
        margin-top: var(--info-row-gap, 20px);
    }
    .block-product-card__modal-content .product-detail-sections theme-product-detail > .product-detail__info > .product-detail__title {
        grid-column: 2 / -1;
        grid-row: 1;
        align-self: end;
        margin-top: 0;
    }
    .block-product-card__modal-content .product-detail-sections theme-product-detail > .product-detail__info > .product-detail__price {
        grid-column: 2 / -1;
        grid-row: 2;
        align-self: start;
        margin-top: var(--size-8, 8px);
    }

    /* Quantity + Add to Cart on one row, same height, aligned at the top */
    .block-product-card__modal-content .product-detail-sections theme-product-detail > .product-detail__info > .product-detail__quantity-selector {
        grid-column: 1 / 3;
        align-self: start;
    }
    .block-product-card__modal-content .product-detail-sections theme-product-detail .product-detail__buy-buttons .button[name="add"] {
        grid-column: 3;
        width: 100%;
        min-width: 0;
        margin-top: var(--info-row-gap, 20px);
        align-self: start;
    }
    /* No quantity selector on the product: Add to Cart takes the full width */
    .block-product-card__modal-content .product-detail-sections theme-product-detail:not(:has(.product-detail__quantity-selector)) .product-detail__buy-buttons .button[name="add"] {
        grid-column: 1 / -1;
    }
    .block-product-card__modal-content .product-detail-sections .product-detail__title h1 {
        font-size: var(--font-size-h5);
        line-height: 1.25;
    }

    /* Image: a single still thumbnail, no slider chrome or badges. */
    .block-product-card__modal-content .product-detail-sections theme-product-detail .product-detail__media-gallery {
        margin: 0;
    }
    .block-product-card__modal-content .product-detail-sections .media-gallery__list {
        padding: 0;
        scroll-padding-left: 0;
    }
    .block-product-card__modal-content .product-detail-sections .media-gallery__item,
    .block-product-card__modal-content .product-detail-sections .media-gallery__list::before {
        width: 100%;
    }
    .block-product-card__modal-content .product-detail-sections .media-gallery__arrows,
    .block-product-card__modal-content .product-detail-sections .media-gallery__pagination,
    .block-product-card__modal-content .product-detail-sections .media-gallery__status,
    .block-product-card__modal-content .product-detail-sections .block-product-card__layer {
        display: none;
    }

    /* More room between the buttons and "View full details" (beats the generic info-row margin above) */
    .block-product-card__modal-content .product-detail-sections theme-product-detail > .product-detail__info > .block-product-card__full-details {
        justify-self: start;
        margin-top: var(--size-24, 24px);
    }
}

.block-product-card__price.product-card-style--card {
    padding-left:var(--size-24);line-height: 1.2em;
}

.block-product-card__discount-tag {
    padding: 4px 12px;
    color: rgb(255 255 255 / 100%);
    background-color: rgb(227 38 25 / 100%);
    border-radius: var(--product-discount-radius);
}

.block-product-card__sold-out {
    padding: 4px 12px;
    color: rgb(0 0 0 / 100%);
    background-color: rgb(255 255 255 / 100%);
    border-radius: var(--product-discount-radius);
}

.av-collection .block-product-card__title .title-text ,
.block-product-card__title .title-text {
    text-transform: uppercase;
    font-family: var(--font-family-sans);
    font-size: var(--font-size-xs);
    line-height:var(--line-height-default);
    font-weight: var(--font-weight-medium);
    color: var(--color-body);
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-inline-end: 0;
    text-overflow: ellipsis;
    min-height:40px;
}





.av-collection .block-product-card__price,
.block-product-card__price,
.av-collection .block-product-card__price,
.block-product-card__price {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-s) !important;
    font-weight: var(--font-weight-medium) !important;
    color: var(--color-price) !important;    
}

.av-view-btn {
    width: 36px;
    height: 26px;
    padding: 1px 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.av-view-btn svg rect {
    fill: none;
    stroke: #9a9a9a;
    stroke-width: 1;
}

.av-view-btn--active {
    background: #f7f7f7;
}

.av-view-btn--active svg rect {
    stroke: #000;
}

.product-card-link-container {display: flex;flex-direction: column;justify-content: space-between;height: 100%;gap: var(--size-24);}

.product-content-container {padding-left: var(--size-24);padding-right: var(--size-24);}

.av-product-item .block-product-card>a,
.block-product-list .block-product-card>a {
    position: relative;color:inherit;font-weight:var(--font-weight-light);
}

.av-product-item .block-product-card__layer-image-wrapper,
.block-product-card__layer-image-wrapper {
    position: static;
    overflow: visible;
}

.quick-add-icon {width:24px;height:24px;}

.product-price, .cost__content {color: var(--color-darkbody);font-weight: var(--font-weight-medium);font-size: var(--font-size-xs);display:block;}
.product-subtitle {font-size: var(--font-size-caption);line-height: var(--line-height-default);}
.block-product-card__price {padding-left:var(--size-24);}
.product-price__from {display:block;}

.custom-price-container {margin-top:auto;}
.quick-add-container {margin-left: auto;}

/* PLP: stack the compare-at (discount) price under the price instead of beside it */
.av-product-item .product-price-amount-container {display: block;}
.av-product-item .product-price-amount-container .product-price__item--compare {display: block;}

/* PLP: hovering the quick-add expands the "Add to cart" label. On narrow cards the
   wrapping .avflex row ran out of room and dropped the button onto a new line.
   Keep the row on one line and let the button grow leftwards over the price
   (absolute, anchored right) inside a fixed icon-sized slot, so nothing shifts. */
@media (min-width: 759px) {
    .custom-price-container {flex-wrap: nowrap;}
    .custom-price-container .block-product-card__price {min-width: 0;}
    .quick-add-container {
        position: relative;flex: 0 0 auto;
        width: calc(24px + 2 * var(--size-20));height: calc(24px + 2 * var(--size-20));
    }
    product-item .quick-add-container .block-product-card__quick-add {
        position: absolute;top: 50%;right: 0;transform: translateY(-50%);z-index: 1;
    }
}

product-item theme-product-form .block-product-card__quick-add, product-item theme-quick-add-modal .block-product-card__quick-add {pointer-events: auto;width: auto;
    height: auto;background: transparent;border: none;
    border-radius: 0;color: var(--color-body);
    display: flex;align-items: center;justify-content: center;
    cursor: pointer;
    transition:background-color var(--dur-slow) var(--ease),color var(--dur-slow) var(--ease);
    padding:var(--size-20);
}
product-item .block-product-card__quick-add svg {width: 24px;height: 24px;color: inherit;}
product-item .block-product-card__quick-add::before {display:none;}
/* Hover only on devices that can hover: on touch, a tap would otherwise leave the
   button stuck black with the label expanded */
@media (hover: hover) {
    product-item .block-product-card__quick-add:hover {background: var(--color-body);color: white;}
    product-item .block-product-card__quick-add:hover .quick-add-text {max-width: 16em;margin-right: var(--size-8);opacity: 1;transform: none;}
}

.quick-add-text {display: inline-block;
    max-width: 0;overflow: hidden;opacity: 0;transition: max-width var(--speed-fast) ease-out, margin var(--speed-fast) ease-out, opacity var(--speed-fast) ease-out, transform var(--speed-fast) ease-out;
    font-size: var(--font-size-xxs);font-weight: var(--font-weight-light);}

.sold-out {opacity:0.8;}
.sold-out-badge {position: absolute;
    z-index: 1000;background-color: var(--color-grey);display: inline-block;
    font-size: var(--font-size-xxs);color: var(--color-darkbody);padding: var(--size-4);
    top: 0;opacity: 0.5;transform: translatex(-50%);left: 50%;}


@media (max-width: 967px) {
    .block-product-card__sold-out {
        padding: 2px 8px;
    }
    .block-product-card__discount-tag {
        padding: 2px 8px;
    }

    .block-product-card__modal-content theme-product-detail {
        --page-padding: 20px;
    }
    
    .block-product-card__modal-content theme-product-detail theme-product-media-gallery[data-mobile-layout="fullscreen"] {
        margin-block-start: calc(-1 * var(--page-padding));
    }

    .av-product-item .block-product-card > a, .block-product-list .block-product-card > a {padding: 0;color: inherit;font-weight: lighter;}
    .av-collection .block-product-card__title .title-text,
    .block-product-card__title .title-text {font-size: var(--font-size-xs);min-height:30px;margin-bottom:var(--size-8);}
    .av-collection__list {--column-gap: var(--size-16);gap:var(--column-gap);row-gap:var(--size-16);}
}

@media (max-width:758px) {
    .title-price-container {width: 100%;margin-top: var(--size-8);}
    .block-product-card__title {text-align:left;} /* AR: card text always left-aligned */
        product-item theme-product-form .block-product-card__quick-add,
        product-item theme-quick-add-modal .block-product-card__quick-add {
            position: relative;
            width: auto;
            height: 54px;
            border: 1px solid var(--color-body);
            padding: var(--size-8) var(--size-12);
            min-width:54px;
            background-color: var(--color-darkbody);
                color: white;
        }

        /* Keep the button's width locked to the (still laid-out) text while
           loading, instead of shrinking to fit the icon-only content. */
        product-item theme-product-form .block-product-card__quick-add.loading .quick-add-text,
        product-item theme-quick-add-modal .block-product-card__quick-add.loading .quick-add-text {
            visibility: hidden;display:none;
        }
        /*product-item theme-product-form .block-product-card__quick-add.loading .loading--rotator,
        product-item theme-quick-add-modal .block-product-card__quick-add.loading .loading--rotator {
        }*/

        .block-product-card__price.product-card-style--normal {
            text-align: left;
        }

        .title-price-container .title-container {min-height: 70px;}
        
                .av-collection .block-product-card__price,
                .block-product-card__price,
                .av-collection .block-product-card__price,
                .block-product-card__price {padding-bottom:var(--size-8);}
}