/* =========================================================
   MFMP Complete the Gift
   Scoped exclusively to .mfmp-ctg to avoid SCP/theme conflicts.
   ========================================================= */

.single-product .mfmp-ctg {
    clear: both;
    width: 100%;
    box-sizing: border-box;
    margin: 30px 0 26px;
    padding: 22px;
    border: 1px solid #EDE1DA;
    border-radius: 16px;
    background: #FFF8F2;
    color: #2D2B29;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.single-product .mfmp-ctg *,
.single-product .mfmp-ctg *::before,
.single-product .mfmp-ctg *::after {
    box-sizing: border-box;
}

.single-product .mfmp-ctg__heading {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0 0 16px;
}

.single-product .mfmp-ctg__heading-icon {
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #FFF1E9;
    color: #D7603C;
}

.single-product .mfmp-ctg__heading-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.single-product .mfmp-ctg__title {
    margin: 0;
    padding: 0;
    color: #2D2B29;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.single-product .mfmp-ctg__subtitle {
    margin: 4px 0 0;
    color: #746A65;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.single-product .mfmp-ctg__track {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    min-width: 0;
}

.single-product .mfmp-ctg__track--1 {
    grid-template-columns: minmax(0, 1fr);
    max-width: 380px;
}

.single-product .mfmp-ctg__track--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.single-product .mfmp-ctg-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #E9DDD6;
    border-radius: 13px;
    background: #FFFFFF;
}

.single-product .mfmp-ctg-card__image {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #FAF8F6;
    text-decoration: none;
}

.single-product .mfmp-ctg-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    transition: transform .22s ease;
}

.single-product .mfmp-ctg-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 132px;
    padding: 12px 13px 13px;
}

.single-product .mfmp-ctg-card__title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    margin: 0 0 7px;
    padding: 0;
    color: #2D2B29;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.38;
}

.single-product .mfmp-ctg-card__title a {
    color: inherit;
    text-decoration: none;
}

.single-product .mfmp-ctg-card__title a:hover {
    color: #B94F31;
}

.single-product .mfmp-ctg-card__price {
    margin: 0 0 9px;
    color: #625A56;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
}

.single-product .mfmp-ctg-card__price .amount,
.single-product .mfmp-ctg-card__price bdi,
.single-product .mfmp-ctg-card__price .woocommerce-Price-currencySymbol {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.single-product .mfmp-ctg-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    color: #B94F31;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.3;
    text-decoration: none;
}

.single-product .mfmp-ctg-card__cta span {
    transition: transform .18s ease;
}

@media (hover: hover) {
    .single-product .mfmp-ctg-card__cta:hover span {
        transform: translateX(3px);
    }
}

/* Desktop: compact horizontal cards so 3 recommendations stay visually light. */
@media (min-width: 981px) {
    .single-product .mfmp-ctg {
        margin: 26px 0 22px;
        padding: 16px 18px 18px;
        border-radius: 14px;
    }

    .single-product .mfmp-ctg__heading {
        gap: 9px;
        margin-bottom: 12px;
    }

    .single-product .mfmp-ctg__heading-icon {
        flex-basis: 30px;
        width: 30px;
        height: 30px;
    }

    .single-product .mfmp-ctg__heading-icon svg {
        width: 16px;
        height: 16px;
    }

    .single-product .mfmp-ctg__title {
        font-size: 19px;
        line-height: 1.22;
    }

    .single-product .mfmp-ctg__subtitle {
        margin-top: 2px;
        color: #857A74;
        font-size: 12.5px;
        line-height: 1.4;
    }

    .single-product .mfmp-ctg__track {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .single-product .mfmp-ctg__track--1 {
        grid-template-columns: minmax(0, 360px);
        max-width: 360px;
    }

    .single-product .mfmp-ctg__track--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 720px;
    }

    .single-product .mfmp-ctg-card {
        display: grid;
        grid-template-columns: 116px minmax(0, 1fr);
        min-height: 122px;
        border-radius: 11px;
    }

    .single-product .mfmp-ctg-card__image {
        width: 116px;
        height: 100%;
        min-height: 122px;
        aspect-ratio: auto;
        border-radius: 10px 0 0 10px;
    }

    .single-product .mfmp-ctg-card__image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .single-product .mfmp-ctg-card__body {
        min-width: 0;
        min-height: 122px;
        padding: 11px 12px;
    }

    .single-product .mfmp-ctg-card__title {
        min-height: 34px;
        margin-bottom: 3px;
        font-size: 12.75px;
        line-height: 1.34;
    }

    .single-product .mfmp-ctg-card__price {
        margin-bottom: 4px;
        color: #6D625C;
        font-size: 11.75px;
        line-height: 1.3;
    }

    .single-product .mfmp-ctg-card__cta {
        gap: 4px;
        font-size: 11.75px;
        font-weight: 600;
        line-height: 1.25;
    }
}

/* Desktop pointer hover: subtle product-image zoom + card lift.
   Limited to real hover/fine-pointer devices so touch layouts are unaffected. */
@media (min-width: 981px) and (hover: hover) and (pointer: fine) {
    .single-product .mfmp-ctg-card {
        transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
    }

    .single-product .mfmp-ctg-card__image img {
        transform: scale(1);
        transition: transform .28s ease;
        will-change: transform;
    }

    .single-product .mfmp-ctg-card:hover {
        transform: translateY(-1px);
        border-color: #E2C9BC;
        box-shadow: 0 6px 18px rgba(60, 40, 30, .06);
    }

    .single-product .mfmp-ctg-card:hover .mfmp-ctg-card__image img {
        transform: scale(1.1);
    }
}

/* Tablet: keep the layout stable and readable. */
@media (min-width: 768px) and (max-width: 980px) {
    .single-product .mfmp-ctg {
        margin-top: 26px;
        padding: 19px;
    }

    .single-product .mfmp-ctg__track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .single-product .mfmp-ctg__track--1 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Mobile: horizontal swipe, no JS slider required. */
@media (max-width: 767px) {
    .single-product .mfmp-ctg {
        width: 100%;
        max-width: 100%;
        margin: 22px 0 20px;
        padding: 17px 15px 16px;
        overflow: hidden;
        border-radius: 14px;
    }

    .single-product .mfmp-ctg__heading {
        gap: 9px;
        margin-bottom: 13px;
    }

    .single-product .mfmp-ctg__heading-icon {
        flex-basis: 31px;
        width: 31px;
        height: 31px;
    }

    .single-product .mfmp-ctg__heading-icon svg {
        width: 16px;
        height: 16px;
    }

    .single-product .mfmp-ctg__title {
        font-size: 19px;
        line-height: 1.25;
    }

    .single-product .mfmp-ctg__subtitle {
        margin-top: 3px;
        font-size: 13px;
        line-height: 1.4;
    }

    .single-product .mfmp-ctg__track,
    .single-product .mfmp-ctg__track--1,
    .single-product .mfmp-ctg__track--2 {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(220px, 76vw);
        grid-template-columns: none;
        gap: 10px;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-inline: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 1px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 1px 5px;
    }

    .single-product .mfmp-ctg__track::-webkit-scrollbar {
        display: none;
    }

    .single-product .mfmp-ctg-card {
        width: 100%;
        scroll-snap-align: start;
    }

    .single-product .mfmp-ctg-card__body {
        min-height: 122px;
        padding: 11px 12px 12px;
    }

    .single-product .mfmp-ctg-card__title {
        font-size: 13.5px;
    }

    .single-product .mfmp-ctg-card__price,
    .single-product .mfmp-ctg-card__cta {
        font-size: 12.5px;
    }
}

/* Very small phones: avoid card overflow. */
@media (max-width: 360px) {
    .single-product .mfmp-ctg {
        padding-left: 13px;
        padding-right: 13px;
    }

    .single-product .mfmp-ctg__track,
    .single-product .mfmp-ctg__track--1,
    .single-product .mfmp-ctg__track--2 {
        grid-auto-columns: minmax(210px, 82vw);
    }
}

@media (prefers-reduced-motion: reduce) {
    .single-product .mfmp-ctg-card,
    .single-product .mfmp-ctg-card__image img,
    .single-product .mfmp-ctg-card__cta span {
        transition: none;
    }

    .single-product .mfmp-ctg-card:hover {
        transform: none;
    }

    .single-product .mfmp-ctg-card:hover .mfmp-ctg-card__image img {
        transform: none;
    }
}
