/**
 * FineCenter - Custom Related / Complementary Products V2.10.6
 * Stage 5.5.2.3 — Grouped CTA Hard Isolation
 */

.fc-related-tab-hidden {
    display: none !important;
}


/* Hide only the original parent stock widgets/hosts. */
.fc-related-loop-card--matritza
.fc-related-matritza-native-stock-hidden,

.fc-qrp-card--matritza
.fc-related-matritza-native-stock-hidden,

.fc-related-loop-card--matritza
.fc-related-loop-stock-host {
    display: none !important;
}


/* Simple non-clickable Matrix-parent availability status. */
.fc-related-matritza-parent-status {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;

    width: fit-content !important;
    max-width: 100% !important;
    min-height: 30px !important;

    margin: 0 auto !important;
    padding: 5px 12px !important;

    border: 1px solid currentColor !important;
    border-radius: 999px !important;

    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-align: center !important;

    cursor: default !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
}


.fc-related-matritza-parent-status.in-stock,
.fc-related-matritza-parent-status.is-in-stock {
    color: #16843a !important;
    background: #effaf2 !important;
    border-color: #bfe8c9 !important;
}


.fc-related-matritza-parent-status.out-of-stock,
.fc-related-matritza-parent-status.is-out-of-stock {
    color: #b42318 !important;
    background: #fff1f0 !important;
    border-color: #ffd0cc !important;
}


.fc-related-matritza-status-dot {
    display: inline-block !important;
    flex: 0 0 auto !important;
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: currentColor !important;
}


/* Selected-child stock replaces the parent target and remains interactive. */
.fc-related-loop-card--matritza
.fc-matritza-selected-child-stock,

.fc-qrp-card--matritza
.fc-matritza-selected-child-stock {
    pointer-events: auto !important;
}


/* Never show cached/stale parent regional stock in Quick Related. */
.fc-qrp-card--matritza
.fc-qrp-stock[data-fc-branch-stock],

.fc-qrp-card--matritza
details.fc-qrp-stock,

.fc-qrp-card--matritza
.fc-branch-stock-compact:not(.fc-matritza-selected-child-stock) {
    display: none !important;
}


.fc-qrp-matritza-shell,
.fc-qrp-matritza-shell
.fc-matritza-options-wrap,
.fc-qrp-matritza-shell
.fc-matritza-cart-wrap,
.fc-qrp-matritza-shell
.fc-matritza-fields,
.fc-qrp-matritza-shell
.fc-matritza-price-info {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}


.fc-qrp-matritza-shell {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-top: 10px !important;
}


.fc-qrp-card--matritza
.fc-qrp-actions {
    display: none !important;
}


/* =========================================================
   V2.10.6 — Grouped complementary products
   The shortcode CTA is a direct link, outside Product Actions wrappers.
========================================================= */

.fc-quick-related-products .fc-qrp-card.fc-qrp-card--grouped {
    align-items: flex-start !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding-bottom: 12px !important;
    overflow: hidden !important;
}

.fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-actions--grouped {
    position: static !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
    max-height: none !important;
    margin: 8px 0 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-grouped-view-btn,
.fc-quick-related-products .fc-qrp-card--grouped [data-fc-related-grouped-view="1"] {
    position: static !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 5px !important;
    line-height: 1.15 !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    transform: none !important;
}

.fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-actions :is(
    .fc-qrp-qty-row,
    .fc-action-quantity,
    .fc-pa-normalized-quantity-row,
    .fc-pa-created-quantity,
    .fc-grid-oos-quantity,
    .fc-product-qty-row,
    .quantity,
    .fc-product-qty-stepper,
    .fc-grid-quote-btn,
    .fc-qrp-quote-btn,
    .uq-add,
    .uq_add_button,
    .uq-add-button
) {
    display: none !important;
}

/* Regular product page: grouped related card keeps only its view CTA. */
body.single-product .fc-related-loop-card--grouped .fc-loop-actions :is(
    .fc-action-quantity,
    .fc-pa-normalized-quantity-row,
    .fc-pa-created-quantity,
    .fc-grid-oos-quantity,
    .fc-product-qty-row,
    .quantity,
    .fc-product-qty-stepper,
    .fc-grid-quote-btn,
    .fc-qrp-quote-btn,
    .uq-add,
    .uq_add_button,
    .uq-add-button
) {
    display: none !important;
}

body.single-product .fc-related-loop-card--grouped .fc-loop-actions :is(
    .fc-grouped-loop-cta,
    .fc-grouped-loop-button
) {
    display: flex !important;
}

body.single-product .fc-related-loop-card--grouped .fc-loop-actions :is(
    .fc-grid-action-buttons,
    .fc-action-buttons
) {
    grid-template-columns: minmax(0, 1fr) !important;
}

body.single-product .fc-related-loop-card--grouped .fc-loop-actions :is(
    .fc-grouped-loop-cta,
    .fc-grouped-loop-button
) {
    grid-column: 1 / -1 !important;
}

/* Quick View mobile rules come after the generic 30.07 layout and win it. */
@media (max-width: 767px) {
    #fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card.fc-qrp-card--grouped,
    .my-quick-view-box .fc-quick-related-products .fc-qrp-card.fc-qrp-card--grouped {
        grid-template-rows: auto auto auto auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding-bottom: 12px !important;
        overflow: hidden !important;
    }

    #fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-actions--grouped,
    .my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-actions--grouped {
        grid-area: actions !important;
        position: static !important;
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: 48px !important;
        margin: 2px 0 0 !important;
        overflow: hidden !important;
    }

    #fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-grouped-view-btn,
    #fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped [data-fc-related-grouped-view="1"],
    .my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-grouped-view-btn,
    .my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped [data-fc-related-grouped-view="1"] {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 !important;
        font-size: 12px !important;
    }
}


/* =========================================================
   V2.10.6 — Grouped complementary products inside Quick View (desktop)
   Image on top, single label button, narrower card like regular product card
========================================================= */

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card.fc-qrp-card--grouped,
.my-quick-view-box .fc-quick-related-products .fc-qrp-card.fc-qrp-card--grouped {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 260px !important;
    margin: 0 auto !important;
    padding: 10px !important;
    box-sizing: border-box !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-image,
.my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-image {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 0 10px !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-image img,
.my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-content,
.my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-title,
#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-meta-row,
#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-price,
.my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-title,
.my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-meta-row,
.my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-price {
    width: 100% !important;
    text-align: center !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-meta-row,
.my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-meta-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 4px !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-grouped-view-btn,
#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped [data-fc-related-grouped-view="1"],
.my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-grouped-view-btn,
.my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped [data-fc-related-grouped-view="1"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-grouped-view-btn > :not(.fc-qrp-grouped-view-label),
#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped [data-fc-related-grouped-view="1"] > :not(.fc-qrp-grouped-view-label),
.my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-grouped-view-btn > :not(.fc-qrp-grouped-view-label),
.my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped [data-fc-related-grouped-view="1"] > :not(.fc-qrp-grouped-view-label) {
    display: none !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-grouped-view-label,
#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card--grouped .elementor-button-text,
.my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped .fc-qrp-grouped-view-label,
.my-quick-view-box .fc-quick-related-products .fc-qrp-card--grouped .elementor-button-text {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    white-space: nowrap !important;
}


/* =========================================================
   V2.10.6 — Quick View complementary products (desktop, all product types)
   Match regular card flow: image above title, narrower cards, centered content
========================================================= */

@media (min-width: 768px) {
    #fc-ajax-qv-root .fc-quick-related-products,
    .my-quick-view-box .fc-quick-related-products {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(220px, 260px)) !important;
        justify-content: center !important;
        gap: 14px !important;
    }

    #fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card,
    .my-quick-view-box .fc-quick-related-products .fc-qrp-card {
        direction: rtl !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 260px !important;
        min-width: 0 !important;
        margin: 0 auto !important;
        padding: 10px !important;
        border-radius: 9px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    #fc-ajax-qv-root .fc-quick-related-products .fc-qrp-image,
    .my-quick-view-box .fc-quick-related-products .fc-qrp-image {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        margin: 0 0 10px !important;
        align-self: stretch !important;
    }

    #fc-ajax-qv-root .fc-quick-related-products .fc-qrp-image img,
    .my-quick-view-box .fc-quick-related-products .fc-qrp-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    #fc-ajax-qv-root .fc-quick-related-products .fc-qrp-content,
    .my-quick-view-box .fc-quick-related-products .fc-qrp-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    #fc-ajax-qv-root .fc-quick-related-products :is(.fc-qrp-title, .fc-qrp-meta-row, .fc-qrp-price, .fc-qrp-actions, .fc-qrp-matritza-shell),
    .my-quick-view-box .fc-quick-related-products :is(.fc-qrp-title, .fc-qrp-meta-row, .fc-qrp-price, .fc-qrp-actions, .fc-qrp-matritza-shell) {
        width: 100% !important;
        text-align: center !important;
    }

    #fc-ajax-qv-root .fc-quick-related-products .fc-qrp-title,
    .my-quick-view-box .fc-quick-related-products .fc-qrp-title {
        display: block !important;
        margin: 0 0 6px !important;
    }

    #fc-ajax-qv-root .fc-quick-related-products .fc-qrp-meta-row,
    .my-quick-view-box .fc-quick-related-products .fc-qrp-meta-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        margin: 0 0 6px !important;
    }

    #fc-ajax-qv-root .fc-quick-related-products .fc-qrp-price,
    .my-quick-view-box .fc-quick-related-products .fc-qrp-price {
        margin: 4px auto 8px !important;
    }

    #fc-ajax-qv-root .fc-quick-related-products .fc-qrp-actions,
    .my-quick-view-box .fc-quick-related-products .fc-qrp-actions,
    #fc-ajax-qv-root .fc-quick-related-products .fc-qrp-actions--grouped,
    .my-quick-view-box .fc-quick-related-products .fc-qrp-actions--grouped {
        display: block !important;
        width: 100% !important;
        margin-top: auto !important;
    }

    #fc-ajax-qv-root .fc-quick-related-products .fc-grid-action-buttons,
    .my-quick-view-box .fc-quick-related-products .fc-grid-action-buttons {
        width: 100% !important;
    }
}


/* =========================================================
   V2.10.6 — Quick View complementary cards, all product types, all devices
   Image above title, split title lines, equalized stock row, bottom-aligned actions
========================================================= */

#fc-ajax-qv-root .fc-quick-related-products,
.my-quick-view-box .fc-quick-related-products {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 260px)) !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 12px !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card,
.my-quick-view-box .fc-quick-related-products .fc-qrp-card {
    direction: rtl !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 260px !important;
    min-width: 0 !important;
    min-height: 100% !important;
    margin: 0 auto !important;
    padding: 10px !important;
    border-radius: 9px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-image,
.my-quick-view-box .fc-quick-related-products .fc-qrp-image {
    order: 1 !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 0 10px !important;
    align-self: stretch !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-image img,
.my-quick-view-box .fc-quick-related-products .fc-qrp-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-content,
.my-quick-view-box .fc-quick-related-products .fc-qrp-content {
    order: 2 !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 6px !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-title,
.my-quick-view-box .fc-quick-related-products .fc-qrp-title {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-height: 48px !important;
    margin: 0 !important;
    text-align: center !important;
    line-height: 1.3 !important;
    overflow: hidden !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-title-line,
.my-quick-view-box .fc-quick-related-products .fc-qrp-title-line {
    display: block !important;
    width: 100% !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-meta-row,
.my-quick-view-box .fc-quick-related-products .fc-qrp-meta-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-height: 58px !important;
    gap: 6px !important;
    margin: 0 !important;
    text-align: center !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-meta-row .fc-qrp-sku,
.my-quick-view-box .fc-quick-related-products .fc-qrp-meta-row .fc-qrp-sku {
    min-height: 18px !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-stock,
#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-stock.fc-branch-stock-compact,
#fc-ajax-qv-root .fc-quick-related-products .fc-related-matritza-parent-status,
.my-quick-view-box .fc-quick-related-products .fc-qrp-stock,
.my-quick-view-box .fc-quick-related-products .fc-qrp-stock.fc-branch-stock-compact,
.my-quick-view-box .fc-quick-related-products .fc-related-matritza-parent-status {
    min-height: 30px !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-price,
.my-quick-view-box .fc-quick-related-products .fc-qrp-price {
    width: 100% !important;
    min-height: 70px !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-actions,
#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-actions--grouped,
.my-quick-view-box .fc-quick-related-products .fc-qrp-actions,
.my-quick-view-box .fc-quick-related-products .fc-qrp-actions--grouped {
    width: 100% !important;
    margin-top: auto !important;
    padding-top: 8px !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-action-layout,
.my-quick-view-box .fc-quick-related-products .fc-qrp-action-layout {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-qrp-qty-row,
.my-quick-view-box .fc-quick-related-products .fc-qrp-qty-row {
    width: 100% !important;
    min-height: 40px !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-grid-action-buttons,
#fc-ajax-qv-root .fc-quick-related-products .fc-action-buttons,
.my-quick-view-box .fc-quick-related-products .fc-grid-action-buttons,
.my-quick-view-box .fc-quick-related-products .fc-action-buttons {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
}

#fc-ajax-qv-root .fc-quick-related-products .fc-grid-action-buttons > *,
#fc-ajax-qv-root .fc-quick-related-products .fc-action-buttons > *,
.my-quick-view-box .fc-quick-related-products .fc-grid-action-buttons > *,
.my-quick-view-box .fc-quick-related-products .fc-action-buttons > * {
    min-width: 0 !important;
}

#fc-ajax-qv-root .fc-quick-related-products :is(.fc-qrp-btn, .fc-grid-quote-btn, .fc-qrp-cart-btn, .fc-qrp-grouped-view-btn, [data-fc-related-grouped-view="1"]),
.my-quick-view-box .fc-quick-related-products :is(.fc-qrp-btn, .fc-grid-quote-btn, .fc-qrp-cart-btn, .fc-qrp-grouped-view-btn, [data-fc-related-grouped-view="1"]) {
    width: 100% !important;
    min-height: 48px !important;
    max-height: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

@media (max-width: 767px) {
    #fc-ajax-qv-root .fc-quick-related-products,
    .my-quick-view-box .fc-quick-related-products {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    #fc-ajax-qv-root .fc-quick-related-products .fc-qrp-card,
    .my-quick-view-box .fc-quick-related-products .fc-qrp-card {
        max-width: 100% !important;
    }
}
