/* =========================================================
   Product Card
   ========================================================= */

.product-card-style--normal {
    display: flex;
    flex-direction: column;
}

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

/* Card root + per-card variables (set inline per card in card.html) */
.block-product-card__card {
    position: relative;
    width: 100%;

    /* Text colors */
    --pc-title-color: inherit;
    --pc-price-color: inherit;
    --pc-compare-color: inherit;

    /* Quick add (under-card button) */
    --pc-qa-bg: rgb(var(--color-button-background));
    --pc-qa-color: rgb(var(--color-button-text));
    --pc-qa-border: transparent;
}

/* -------------------------------------------------------
   Image link (clickable PDP area)
------------------------------------------------------- */
.block-product-card__image-link {
    display: block;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

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

@media (min-width: 960px) {
    .block-product-card__layer-image-wrapper.hover:hover .block-product-card__image:nth-of-type(1) {
        opacity: 0;
    }

    .block-product-card__layer-image-wrapper.hover: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;
    background-color: rgb(243 243 243 / 100%);
    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: 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;
}

/* -------------------------------------------------------
   Layer wrapper (discount tag / quick add overlay)
   - MUST NOT block image link
------------------------------------------------------- */
.block-product-card__layer-wrapper {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.block-product-card__layer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    height: 100%;
}

/* Keep tags visible, but do NOT allow overlay quick add anymore (we’re using under-card button) */
.block-product-card__layer-wrapper .block-product-card__quick-add {
    display: none !important;
}

/* -------------------------------------------------------
   Quick Add modal (still used for multi-variant under-card)
------------------------------------------------------- */
.block-product-card__modal-content {
    width: 80vw;
    max-width: 1200px;
    max-height: 80vh;
    overflow-y: auto;
}

@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);
}

@media (max-width: 959px) {
    .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));
    }
}

.block-product-card__modal-close {
    position: absolute;
    inset-block-start: 10px;
    inset-inline-end: 15px;
    color: #fff;
    background: rgb(0 0 0 / 40%);
}

/* -------------------------------------------------------
   Title / Price
------------------------------------------------------- */
.block-product-card__title-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.block-product-card__title {
    display: -webkit-box;
    flex-shrink: 0;
    padding-inline-end: 4px;
    overflow: hidden;

    font-family: var(--font-heading-family, "Brother Bold", sans-serif) !important;
    font-weight: 800;

    font-size: 1.5rem;
    color: var(--pc-title-color, rgb(var(--color-light-text)));
    text-overflow: ellipsis;
    -webkit-line-clamp: var(--max-row);
    -webkit-box-orient: vertical;
    text-align: center;
}

.block-product-card__title.product-card-style--card {
    padding-inline: 8px;
}

.block-product-card__price {
    font-family: var(--font-body-family, "FraktionMono Bold", sans-serif) !important;
    color: var(--pc-price-color, inherit);
}

.block-product-card__price.product-card-style--card {
    padding-inline: 8px;
}

/* Compare-at inside price */
.block-product-card__price s,
.block-product-card__price del,
.block-product-card__price .compare,
.block-product-card__price .compare-at,
.block-product-card__price [class*="compare"] {
    color: var(--pc-compare-color, inherit);
}

/* Don’t let links override */
.block-product-card__card a {
    color: inherit;
}

/* -------------------------------------------------------
   Tags
------------------------------------------------------- */
.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);
}

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

.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);
}

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

/* =========================================================
   Under-card Quick Add button (new)
   Matches the updated card.html wrapper/classes:
   - .block-product-card__quick-add-under-wrapper
   - .block-product-card__quick-add-under
   ========================================================= */

.block-product-card__quick-add-under-wrapper {
    width: 100%;
    margin-top: 12px;
}

/* Ensure wrappers stretch full width */
.block-product-card__quick-add-under-wrapper theme-product-form,
.block-product-card__quick-add-under-wrapper theme-quick-add-modal,
.block-product-card__quick-add-under-wrapper details {
    display: block;
    width: 100%;
}

/* Summary should behave like a button */
.block-product-card__quick-add-under-wrapper summary {
    list-style: none;
}

.block-product-card__quick-add-under-wrapper summary::-webkit-details-marker {
    display: none;
}

/* Button style */
.block-product-card__quick-add-under.button,
.block-product-card__quick-add-under {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;

    background: var(--pc-qa-bg) !important;
    color: var(--pc-qa-color) !important;
    border: 1px solid var(--pc-qa-border) !important;

    border-radius: 12px;
    padding: 12px 16px;

    text-decoration: none;
    cursor: pointer;
    line-height: 1.1;
    font-family: inherit;
    font-weight: 600;
}

.block-product-card__quick-add-under[disabled],
.block-product-card__quick-add-under.button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================================================
   Product card — enforce per-card vars + under-card quick add
   (Paste at END of card.css)
   ========================================================= */

/* Title respects per-card variable */
.block-product-card__title,
.block-product-card__title :is(p, span, strong, em, a, li, small, div) {
    color: var(--pc-title-color, inherit) !important;
}

/* Price respects per-card variable */
.block-product-card__price,
.block-product-card__price :is(p, span, strong, em, a, li, small, div) {
    color: var(--pc-price-color, inherit) !important;
}

/* Compare-at respects per-card variable */
.block-product-card__price s,
.block-product-card__price del,
.block-product-card__price .compare,
.block-product-card__price .compare-at,
.block-product-card__price [class*="compare"] {
    color: var(--pc-compare-color, inherit) !important;
}

/* Hide old overlay quick add icon in image layer */
.block-product-card__layer-wrapper .block-product-card__quick-add {
    display: none !important;
}

/* Under-card quick add wrapper should always drop to a full row */
.block-product-card__quick-add-under-wrapper {
    width: 100%;
    flex-basis: 100%;
    margin-top: 12px;
    order: 999;
}

.block-product-card__quick-add-under-wrapper theme-product-form,
.block-product-card__quick-add-under-wrapper theme-quick-add-modal,
.block-product-card__quick-add-under-wrapper details {
    display: block;
    width: 100%;
}

/* Summary behaves like a button */
.block-product-card__quick-add-under-wrapper summary {
    list-style: none;
}

.block-product-card__quick-add-under-wrapper summary::-webkit-details-marker {
    display: none;
}

/* Real site-style quick add button */
.block-product-card__quick-add-under.button,
.block-product-card__quick-add-under {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;

    background: var(--pc-qa-bg, #111) !important;
    color: var(--pc-qa-color, #fff) !important;
    font-family: 'Brother', sans-serif;
    border-radius: 12px;
    padding: 12px 16px;

    text-decoration: none;
    cursor: pointer;
    line-height: 1.1;
    font-weight: 600;
}

.block-product-card__quick-add-under[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Hide the overlay quick add when under-card quick add is enabled */

.block-product-card__layer-wrapper .block-product-card__quick-add-under {
    display: none !important;
}

/* Force per-card colors to win over theme typography classes */
.block-product-card__card .block-product-card__title {
    color: var(--pc-title-color, inherit) !important;
}

.block-product-card__card .block-product-card__price {
    color: var(--pc-price-color, inherit) !important;
}

.block-product-card__card .block-product-card__price :is(s, del, [class*="compare"], [class*="Compare"]) {
    color: var(--pc-compare-color, inherit) !important;
}