/* Product-detail discovery. Scoped to avoid changing homepage/catalogue grids. */
.mg-recommendations {
    grid-column: 1 / -1;
    min-width: 0;
    padding-top: 32px;
    border-top: 1px solid var(--mg-mist);
}
.mg-recommendations-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}
.mg-recommendations-heading h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: var(--mg-navy);
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    line-height: 1.2;
    letter-spacing: -.025em;
}
.mg-recommendations-heading h2 .mg-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 1px solid #d7e7f8;
    border-radius: 12px;
    background: #edf5ff;
    color: #0e4e8f;
}
.mg-recommendations-description {
    max-width: 68ch;
    margin: 10px 0 0;
    color: #566174;
    font-size: .875rem;
}
.mg-recommendations-all {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid #cbd9e8;
    border-radius: 9px;
    color: #0e4e8f;
    background: #fff;
    font-size: .85rem;
    font-weight: 750;
}
.mg-recommendations-all:hover {
    border-color: #0e4e8f;
    background: #edf5ff;
}
.woocommerce .mg-recommendations ul.products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.woocommerce .mg-recommendations ul.products li.product .woocommerce-loop-product__title {
    display: block;
    min-height: 2.7em;
    margin: 12px 0 10px;
    overflow-wrap: anywhere;
    font-size: .95rem !important;
    -webkit-line-clamp: unset;
}
.woocommerce .mg-recommendations ul.products li.product .price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 1.1rem;
}
.mg-recommendations .price del { color: #687386; font-size: .8rem; }
.mg-recommendations .price ins { text-decoration: none; }
.woocommerce .mg-recommendations ul.products li.product .button,
.mg-recommendations .mg-quick-view {
    min-height: 44px;
    padding: 8px 10px;
    text-align: center;
    font-size: .86rem;
}
.mg-recommendations .mg-quick-view { margin-top: 8px; }
.mg-recommendations :is(a, button):focus-visible {
    outline: 3px solid #1963b3;
    outline-offset: 3px;
}
/* A single-image product must not disappear on hover; overlay images still work. */
.woocommerce .mg-recommendations ul.products li.product:hover a > img:first-child {
    opacity: 1;
}
.woocommerce .mg-recommendations ul.products li.product .mg-product-second-image {
    aspect-ratio: 4 / 3;
}
.mg-recommendations--best-sellers {
    position: relative;
    margin-top: 42px;
    padding: 34px 0 0;
    border-top: 1px solid #dfe4ea;
    background: #fff;
}
.mg-recommendations--best-sellers::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 0;
    width: 72px;
    height: 3px;
    background: #e63d43;
}
.mg-recommendations--best-sellers .mg-recommendations-heading {
    margin-bottom: 18px;
}
.mg-recommendations--best-sellers .mg-recommendations-heading h2 {
    color: #171a20;
    font-size: clamp(1.65rem, 2.7vw, 2.15rem);
}
.mg-recommendations--best-sellers .mg-recommendations-heading h2 .mg-icon {
    border-color: #f3d6d8;
    background: #fff1f2;
    color: #d92830;
}
.woocommerce .mg-recommendations--best-sellers ul.products {
    gap: 0;
    border-top: 1px solid #e3e6ea;
    border-bottom: 1px solid #e3e6ea;
}
.woocommerce .mg-recommendations--best-sellers ul.products li.product {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 8px;
    min-width: 0;
    padding: 22px 18px 20px !important;
    border: 0;
    border-right: 1px solid #e3e6ea;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    transform: none;
}
.woocommerce .mg-recommendations--best-sellers ul.products li.product:last-child {
    border-right: 0;
}
.woocommerce .mg-recommendations--best-sellers ul.products li.product:hover,
.woocommerce .mg-recommendations--best-sellers ul.products li.product:focus-within {
    box-shadow: inset 0 -3px #e63d43;
    transform: none;
}
.woocommerce .mg-recommendations--best-sellers .woocommerce-loop-product__link {
    display: flex;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    text-align: center;
}
.woocommerce .mg-recommendations--best-sellers ul.products li.product a img {
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0 0 12px;
    border-radius: 0;
    background: #fff;
    object-fit: contain;
}
.woocommerce .mg-recommendations--best-sellers ul.products li.product .mg-product-second-image {
    top: 22px;
    left: 18px;
    width: calc(100% - 36px);
    aspect-ratio: 1 / 1;
}
.woocommerce .mg-recommendations--best-sellers .star-rating {
    margin: 0 auto 10px;
    color: #ffb400;
    font-size: .85rem;
}
.woocommerce .mg-recommendations--best-sellers ul.products li.product .woocommerce-loop-product__title {
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0 0 8px;
    overflow: hidden;
    color: #242932;
    font-size: .9rem !important;
    font-weight: 650;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.woocommerce .mg-recommendations--best-sellers ul.products li.product .price {
    justify-content: center;
    min-height: 1.6em;
    margin: 0 0 10px;
    color: #e13b42 !important;
    font-size: 1rem;
}
.mg-recommendations--best-sellers .price del {
    color: #8f969f;
}
.mg-recommendations--best-sellers .mg-best-seller-badge,
.woocommerce .mg-recommendations--best-sellers ul.products li.product .onsale {
    position: absolute;
    z-index: 3;
    top: 12px;
    display: inline-flex;
    align-items: center;
    width: auto;
    min-width: 0;
    min-height: 24px;
    margin: 0;
    padding: 4px 8px;
    border-radius: 3px;
    color: #fff;
    font-size: .62rem;
    font-weight: 850;
    line-height: 1;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.mg-recommendations--best-sellers .mg-best-seller-badge {
    left: 12px;
    background: #f6b400;
    color: #1b2330;
}
.woocommerce .mg-recommendations--best-sellers ul.products li.product .onsale {
    right: 12px;
    left: auto;
    background: #13733a;
}
.woocommerce .mg-recommendations--best-sellers ul.products li.product .button {
    grid-column: 1;
    min-width: 0;
    margin: 0;
    border: 1px solid #d8dde3;
    border-radius: 4px;
    background: #fff;
    color: #20242b;
    font-size: .72rem;
    font-weight: 850;
    text-transform: uppercase;
}
.woocommerce .mg-recommendations--best-sellers ul.products li.product .button:hover {
    border-color: #e63d43;
    background: #e63d43;
    color: #fff;
}
.mg-recommendations--best-sellers .mg-quick-view {
    grid-column: 2;
    width: 46px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border-color: #d8dde3;
    border-radius: 4px;
    color: #20242b;
}
.mg-recommendations--best-sellers .mg-quick-view:hover {
    border-color: #e63d43;
    color: #e63d43;
}
.mg-recommendations--best-sellers .mg-quick-view span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}
@media (max-width: 980px) {
    .woocommerce .mg-recommendations ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mg-recommendations-heading { align-items: flex-start; }
    .mg-recommendations-all { max-width: 190px; }
}
@media (max-width: 640px) {
    .mg-recommendations { padding-top: 24px; }
    .mg-recommendations-heading { flex-direction: column; gap: 14px; margin-bottom: 18px; }
    .mg-recommendations-heading .mg-eyebrow { font-size: .65rem; letter-spacing: .09em; }
    .mg-recommendations-description { font-size: .8rem; }
    .mg-recommendations-all { max-width: none; }
    .woocommerce .mg-recommendations ul.products { gap: 10px; }
    .woocommerce .mg-recommendations ul.products li.product .woocommerce-loop-product__title { font-size: .8rem !important; }
    .woocommerce .mg-recommendations ul.products li.product .price { gap: 4px; font-size: .95rem; }
    .woocommerce .mg-recommendations ul.products li.product .mg-product-second-image { left: 8px; top: 8px; width: calc(100% - 16px); }
    .mg-recommendations--best-sellers { margin-top: 30px; padding: 26px 0 0; }
    .woocommerce .mg-recommendations--best-sellers ul.products li.product { padding: 14px 10px 12px !important; }
    .woocommerce .mg-recommendations--best-sellers ul.products li.product .mg-product-second-image { top: 14px; left: 10px; width: calc(100% - 20px); }
    .woocommerce .mg-recommendations--best-sellers ul.products li.product .button { grid-column: 1 / -1; font-size: .67rem; }
    .mg-recommendations--best-sellers .mg-quick-view { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .mg-recommendations *, .mg-recommendations *::before, .mg-recommendations *::after { transition: none !important; }
}
