/*
Theme Name: Betheme Child
Theme URI: https://themes.muffingroup.com/betheme
Author: Muffin group
Author URI: https://muffingroup.com
Description: Child Theme for Betheme
Template: betheme
Version: 2.0.1
*/

/* ==================== CLS PREVENTION - Reserve space for images ==================== */

/* Product loop thumbnails: reserve 1:1 space so lazy images don't shift layout */
.product-loop-thumb .image_wrapper,
.mfn-woo-products .image_frame .image_wrapper {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8f9fa;
}

.product-loop-thumb .image_wrapper img,
.mfn-woo-products .image_frame .image_wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Single product gallery: reserve space for main image */
.woocommerce div.product div.images .woocommerce-product-gallery__image img,
.woocommerce div.product div.images .mfn-product-gallery img.wp-post-image {
    aspect-ratio: 1;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #f8f9fa;
}

/* Category cards (mg-home-picks): images already have aspect-ratio: 1, ensure background fills */
.mg-cat-card-img {
    background: #f8f9fa;
}

/* Footer provider badge: fixed height to prevent late-render shift */
.mg-footer-provider {
    min-height: 56px;
}

/* Elementor sections: contain style only — avoid 'layout' which breaks flex column sizing */
.elementor-section {
    contain: style;
}

/* Home: prevent oversized inline SVG in hero CTA */
body.home .the_content_wrapper p a > svg {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    display: inline-block;
    vertical-align: middle;
}

/* Checkout: emphasize selected payment method */
.woocommerce-checkout #payment ul.payment_methods li {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.woocommerce-checkout #payment ul.payment_methods li:hover {
  border-color: var(--mfn-woo-border-themecolor);
}

.woocommerce-checkout #payment ul.payment_methods li.active-payment {
  border-color: var(--mfn-woo-border-themecolor);
  box-shadow: 0 0 0 1px var(--mfn-woo-border-themecolor), 0 8px 18px rgba(0, 0, 0, 0.06);
  background-color: #fff;
}

.woocommerce-checkout #payment ul.payment_methods li.wc_payment_method .mfn-payment-check {
  width: 24px;
  height: 24px;
  font-size: 14px;
  right: -12px;
  top: -12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* Promo bar: override dark text (#333) forced by BeTheme slider on dark-purple banner */
.mcb-section-3fb98ad99 .promo_bar_slider .pbs_one {
    color: #FFFFFF !important;
}

/* Product gallery fallback when slider styles are missing */
.woocommerce div.product div.images .woocommerce-product-gallery {
    opacity: 1 !important;
}

.woocommerce div.product div.images .flex-control-nav,
.woocommerce div.product div.images .flex-control-thumbs {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.woocommerce div.product div.images .flex-control-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.woocommerce div.product div.images .flex-control-thumbs li {
    list-style: none;
    margin: 0;
}

.woocommerce div.product div.images .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image {
    display: none;
}

.woocommerce div.product div.images .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:first-child,
.woocommerce div.product div.images .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image.flex-active-slide {
    display: block;
}

/* Fix: Galería de producto - thumbnails dinámicos */
/* Cuando hay pocos thumbnails, no dejar espacio vacío */
.woocommerce div.product div.images.mfn-thumbnails-bottom .flex-control-thumbs:not(.mfn-scroller-active) {
    justify-content: flex-start;
}

.woocommerce div.product div.images.mfn-thumbnails-bottom .flex-control-thumbs:not(.mfn-scroller-active) li {
    width: auto !important;
    flex: 0 0 auto;
    max-width: 120px;
}

.woocommerce div.product div.images.mfn-thumbnails-bottom .flex-control-thumbs:not(.mfn-scroller-active) li img {
    width: 100%;
    height: auto;
}

/* Eliminar fondo gris del wrapper de thumbnails */
.woocommerce .mfn-product-gallery .mfn-flex-control-thumbs-wrapper {
    background: transparent !important;
    background-color: transparent !important;
}

/* Ajustar el wrapper para que no tenga tamaño fijo */
.woocommerce .mfn-product-gallery.mfn-thumbnails-bottom .mfn-flex-control-thumbs-wrapper:not(.mfn-scroller-active) {
    width: auto;
    min-width: auto;
}

/* Reordenar secciones en pagina de producto: Preguntas > Opiniones > Relacionados */
.single-product #Content {
    display: flex;
    flex-direction: column;
}
.single-product .mg-questions-section {
    order: 100;
    contain: style;
}
.single-product .mg-reviews-section {
    order: 101;
    contain: style;
}
.single-product .related.products,
.single-product section.related {
    order: 102;
    contain: style;
}

/* ==================== MOBILE/TABLET FIX - SUBHEADER/TIENDA SPACING ==================== */
@media (max-width: 959px) {
    /* Eliminar espacio blanco entre header y subheader */
    #Header {
        margin-bottom: 0 !important;
    }

    .subheader-empty,
    .header_placeholder,
    #Header_wrapper + div:empty {
        display: none !important;
        height: 0 !important;
    }

    /* Subheader TIENDA - eliminar padding excesivo */
    #Subheader {
        padding: 20px 15px !important;
        margin-top: 0 !important;
    }

    #Subheader .container .column.one {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    /* Título TIENDA más pequeño en móvil */
    #Subheader h1,
    #Subheader .title {
        font-size: 28px !important;
        margin-bottom: 8px !important;
        float: none !important;
        text-align: center !important;
        width: 100% !important;
        line-height: 1.15 !important;
    }

    /* Breadcrumb compacto y centrado en móvil */
    #Subheader .breadcrumbs,
    #Subheader ul.breadcrumbs {
        font-size: 11px !important;
        line-height: 1.4 !important;
        float: none !important;
        clear: both !important;
        position: static !important;
        text-align: center !important;
        display: block !important;
        width: 100% !important;
        margin: 6px 0 0 !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    #Subheader .breadcrumbs *,
    #Subheader ul.breadcrumbs li {
        white-space: normal !important;
        float: none !important;
        display: inline !important;
    }
}

/* ==================== MOBILE FIX - PRODUCT PAGE LAYOUT ==================== */
@media (max-width: 768px) {
    /* Forzar layout en una sola columna */
    .single-product .product_wrapper .product_image_wrapper,
    .single-product .product_wrapper .entry-summary {
        width: 100% !important;
        float: none !important;
    }

    .single-product .product_wrapper .mcb-column-inner {
        margin: 0 !important;
    }

    .single-product .product_image_wrapper {
        margin-bottom: 20px !important;
    }

    /* Centrar título producto */
    .woocommerce .product_title,
    .single-product .product_title,
    .single-product h1.product_title {
        text-align: center !important;
    }

    /* Centrar precio y badge IVA */
    .single-product .price,
    .single-product .price-wrapper,
    .single-product p.price,
    .single-product .summary .price {
        text-align: center !important;
        justify-content: center !important;
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
    }

    /* Selector de cantidad centrado y más grande */
    .single-product .quantity-wrapper,
    .single-product form.cart,
    .single-product .cart {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }

    .single-product .quantity {
        width: 140px !important;
        margin: 0 auto 12px !important;
    }

    .single-product .quantity input.qty {
        width: 100% !important;
        text-align: center !important;
        font-size: 16px !important;
        padding: 12px !important;
    }

    /* Botón agregar al carrito full-width */
    .single-product .single_add_to_cart_button,
    .single-product button.single_add_to_cart_button {
        width: 100% !important;
        max-width: 300px !important;
    }

    /* Wishlist centrado */
    .single-product .yith-wcwl-add-to-wishlist,
    .single-product .wishlist-button-wrap {
        text-align: center !important;
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
        margin-top: 12px !important;
    }

    /* Meta información centrada */
    .single-product .product_meta,
    .single-product .product_meta > span {
        display: block !important;
        text-align: center !important;
        width: 100% !important;
    }

    /* SKU, categorías, etiquetas */
    .single-product .sku_wrapper,
    .single-product .posted_in,
    .single-product .tagged_as {
        display: block !important;
        text-align: center !important;
        margin: 4px 0 !important;
    }

    /* Atributos del producto apilados */
    .single-product table.shop_attributes,
    .single-product table.shop_attributes tbody,
    .single-product table.shop_attributes tr,
    .single-product table.shop_attributes th,
    .single-product table.shop_attributes td {
        display: block !important;
        width: 100% !important;
    }

    .single-product table.shop_attributes tr {
        margin-bottom: 10px !important;
    }

    .single-product table.shop_attributes th {
        padding-bottom: 4px !important;
    }

    /* ==================== PREGUNTAS Y RESPUESTAS ==================== */
    .mg-questions-section {
        padding: 20px 16px !important;
    }

    .mg-questions-section textarea,
    .mg-questions-section .mg-question-textarea,
    .mg-product-questions textarea {
        width: 100% !important;
        box-sizing: border-box !important;
        min-height: 80px !important;
    }

    .mg-questions-section button,
    .mg-questions-section .mg-submit-question,
    .mg-product-questions button {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* ==================== OPINIONES DEL PRODUCTO ==================== */
    .mg-reviews-section {
        padding: 20px 16px !important;
    }

    .mg-reviews-section .mg-reviews-inner {
        padding: 0 !important;
    }

    .mg-reviews-header {
        align-items: center !important;
        text-align: center !important;
    }

    .mg-reviews-rating-box {
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }

    .mg-reviews-score-meta {
        align-items: center !important;
    }

    /* Toolbar - layout vertical en móvil */
    .mg-reviews-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
    }

    /* Filtros en columna */
    .mg-reviews-filters {
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .mg-reviews-filters label {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
        width: 100% !important;
        white-space: normal !important;
    }

    .mg-reviews-filters select {
        width: 100% !important;
        min-width: auto !important;
    }

    /* Acciones - botón y nota */
    .mg-reviews-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .mg-reviews-button {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }

    .mg-reviews-cta-note {
        text-align: center !important;
        display: block !important;
    }

    /* Rating box compacto */
    .mg-reviews-rating-box {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .mg-reviews-score {
        font-size: 36px !important;
    }

    .mg-reviews-bars {
        width: 100% !important;
        max-width: 260px !important;
        margin: 12px auto 0 !important;
    }

    .mg-reviews-bar {
        flex: 1 !important;
        width: auto !important;
    }

    /* Botón ver más opiniones */
    .mg-reviews-more {
        width: 100% !important;
    }
}

/* ==================== LIVE SEARCH (BETHEME) ==================== */
.mfn-live-search-box {
    background: #ffffff;
    border: 1px solid rgba(63, 4, 96, 0.12);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(11, 26, 72, 0.12);
    overflow: hidden;
    z-index: 100000;
}

.search_wrapper {
    position: relative;
    z-index: 99999;
}

.search_wrapper .mfn-live-search-box {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 8px;
}

.search_wrapper .mfn-live-search-box::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -8px;
    height: 8px;
    background: #ffffff;
}

.mfn-live-search-list {
    margin: 0;
    padding: 6px 0;
    list-style: none;
    max-height: 420px;
    overflow: auto;
}

.mfn-live-search-list > li {
    padding: 8px 12px;
}

.mfn-live-search-list > li + li {
    border-top: 1px solid #f0f0f2;
}

.mfn-live-search-list > li > ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mfn-live-search-list .mfn-live-search-heading {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #3f0460;
    margin: 6px 0 8px;
}

.mfn-live-search-list ul li[data-category] {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 14px;
    align-items: center;
    padding: 12px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.mfn-live-search-list ul li[data-category]:hover {
    background: #f7f7f7;
    transform: translateY(-1px);
}

.mfn-live-search-list ul li[data-category="category"] {
    grid-template-columns: 1fr;
    background: #fff6cc;
}

.mfn-live-search-list ul li[data-category] img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: #f7f7f7;
    border: 1px solid #ececf1;
    border-radius: 10px;
    padding: 6px;
}

.mfn-live-search-texts {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.mfn-live-search-texts a {
    font-weight: 600;
    color: #3f0460;
    text-decoration: none;
    line-height: 1.2;
}

.mfn-live-search-texts a:hover {
    color: #950c77;
}

.mfn-live-search-meta {
    font-size: 12px;
    color: #6b7280;
}

.mfn-live-search-texts p {
    margin: 0;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mfn-live-search-texts .mfn-ls-price {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0b1a48;
    font-weight: 700;
    background: #fccb02;
    padding: 2px 6px;
    border-radius: 6px;
    width: fit-content;
}

.mfn-live-search-noresults {
    display: none;
    padding: 12px 16px;
    color: #0b1a48;
    font-weight: 600;
    background: #fff6cc;
    border-top: 1px solid #f0f0f2;
}

.mfn-live-search-box .button.button_theme {
    margin: 12px 16px 16px;
    background: #3f0460;
    border-radius: 999px;
    padding: 10px 18px;
}

.mfn-live-search-box .button.button_theme:hover {
    background: #950c77;
}

@media (max-width: 768px) {
    .mfn-live-search-list ul li[data-category] {
        grid-template-columns: 48px 1fr;
        padding: 10px 8px;
    }

    .mfn-live-search-list ul li[data-category] img {
        width: 48px;
        height: 48px;
    }
}

.mg-footer-provider {
    clear: both;
    margin: 0 0 12px;
}

.mg-footer-provider__badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    color: #1f1f1f;
    text-decoration: none;
    flex-wrap: wrap;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mg-footer-provider__badge:hover {
    border-color: rgba(0, 0, 0, 0.16);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.mg-footer-provider__logo {
    height: 32px;
    width: auto;
    max-width: 180px;
    display: block;
    flex-shrink: 0;
}

.mg-footer-provider__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mg-footer-provider__title {
    font-weight: 700;
}

.mg-footer-provider__subtitle {
    font-size: 12px;
    color: #555555;
}

.mg-footer-provider__cta {
    margin-left: auto;
    font-weight: 600;
    color: var(--mfn-woo-themecolor, #d69942);
}

.mfn-footer .mcb-item-avd0gsg2l,
.mfn-footer .mcb-item-hbz3u69ru {
    text-align: center;
}

@media (max-width: 767px) {
    .mg-footer-provider__badge {
        justify-content: center;
        text-align: center;
    }

    .mg-footer-provider__text {
        align-items: center;
    }

    .mg-footer-provider__cta {
        margin-left: 0;
    }
}

/* ==================== VARIABLE PRODUCT - Add to Cart buttons ==================== */

/* Variable product: match simple product stacked layout */
.single-product .variations_form .single_variation_wrap {
    width: 100%;
}

.single-product .woocommerce-variation-add-to-cart {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
}

.single-product .woocommerce-variation-add-to-cart .quantity {
    margin-bottom: 10px;
}

.single-product .woocommerce-variation-add-to-cart .single_add_to_cart_button {
    width: 100%;
    text-align: center;
}

.single-product .woocommerce-variation-add-to-cart .wpcbn-btn-single {
    width: 100%;
    text-align: center;
}

.single-product .woocommerce-variation-add-to-cart .mfn-wish-button {
    align-self: flex-start;
    margin-top: 8px;
}

/* ==================== COLOR SWATCHES (Variable Products) ==================== */

/* Larger swatches on single product page */
.woocommerce .mfn-variations-wrapper .mfn-vr ul.mfn-vr-options.mfn-vr-color li a {
    width: 44px;
    height: 44px;
    padding: 3px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce .mfn-variations-wrapper .mfn-vr ul.mfn-vr-options.mfn-vr-color li a:hover {
    border-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.woocommerce .mfn-variations-wrapper .mfn-vr ul.mfn-vr-options.mfn-vr-color li.active a {
    border-color: var(--mfn-woo-themecolor, #3f0460);
    box-shadow: 0 0 0 2px var(--mfn-woo-themecolor, #3f0460);
}

/* Disabled (out of stock) variation: strikethrough */
.woocommerce .mfn-variations-wrapper .mfn-vr ul.mfn-vr-options.mfn-vr-color li.disabled a {
    opacity: 0.4;
    position: relative;
}

.woocommerce .mfn-variations-wrapper .mfn-vr ul.mfn-vr-options.mfn-vr-color li.disabled a::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: rgba(0, 0, 0, 0.5);
    transform: rotate(-45deg);
    pointer-events: none;
}

/* Loop swatches: slightly larger */
.woocommerce .mfn-variations-wrapper-loop .mfn-vr ul.mfn-vr-options.mfn-vr-color li a {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(0, 0, 0, 0.15);
}

/* Label styling */
.woocommerce .mfn-variations-wrapper .mfn-vr label {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #333;
}

/* Restablecer link */
.woocommerce .variations_form .reset_variations,
.woocommerce .mfn-variations-wrapper .mfn-reset-variations {
    font-size: 13px;
    color: #888;
    margin-top: 6px;
    display: inline-block;
}

@media (max-width: 768px) {
    .woocommerce .mfn-variations-wrapper .mfn-vr {
        justify-content: center !important;
    }

    .woocommerce .mfn-variations-wrapper .mfn-vr label {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 8px;
    }

    .woocommerce .mfn-variations-wrapper .mfn-vr ul.mfn-vr-options {
        justify-content: center !important;
    }
}

/* ==================== SHOP ARCHIVE LAYOUT TUNING ==================== */
body.post-type-archive-product #Subheader .container,
body.tax-product_cat #Subheader .container,
body.tax-product_tag #Subheader .container {
    max-width: 1280px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

body.post-type-archive-product #Subheader .title,
body.tax-product_cat #Subheader .title,
body.tax-product_tag #Subheader .title {
    font-size: clamp(24px, 3vw, 36px) !important;
    line-height: 1.15 !important;
}

body.post-type-archive-product .elementor-6916 .elementor-element.elementor-element-eda7067,
body.tax-product_cat .elementor-6916 .elementor-element.elementor-element-eda7067,
body.tax-product_tag .elementor-6916 .elementor-element.elementor-element-eda7067 {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    --padding-top: clamp(48px, 6vw, 64px);
    --padding-bottom: clamp(48px, 6vw, 64px);
    --padding-left: 16px;
    --padding-right: 16px;
    --column-gap: 24px;
}

body.post-type-archive-product .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4,
body.tax-product_cat .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4,
body.tax-product_tag .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4 {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0 !important;
}

body.post-type-archive-product .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4 li.product,
body.tax-product_cat .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4 li.product,
body.tax-product_tag .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4 li.product {
    width: calc((100% - 60px) / 4) !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
}

@media (max-width: 1199px) {
    body.post-type-archive-product .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4,
    body.tax-product_cat .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4,
    body.tax-product_tag .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4 {
        gap: 16px;
    }

    body.post-type-archive-product .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4 li.product,
    body.tax-product_cat .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4 li.product,
    body.tax-product_tag .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4 li.product {
        width: calc((100% - 32px) / 3) !important;
    }
}

@media (max-width: 767px) {
    body.post-type-archive-product .elementor-6916 .elementor-element.elementor-element-eda7067,
    body.tax-product_cat .elementor-6916 .elementor-element.elementor-element-eda7067,
    body.tax-product_tag .elementor-6916 .elementor-element.elementor-element-eda7067 {
        --padding-left: 12px;
        --padding-right: 12px;
        --column-gap: 16px;
    }

    body.post-type-archive-product .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4,
    body.tax-product_cat .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4,
    body.tax-product_tag .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4 {
        gap: 12px;
    }

    body.post-type-archive-product .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4 li.product,
    body.tax-product_cat .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4 li.product,
    body.tax-product_tag .elementor-6916 .elementor-element.elementor-element-b7b6bf1.elementor-wc-products .products_wrapper ul.products.grid.col-4 li.product {
        width: calc((100% - 12px) / 2) !important;
    }
}

/* ==================== HOME LAYOUT TUNING ==================== */
body.home .mg-home-picks .woocommerce {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

body.home .mg-home-picks ul.products.elementor-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
    align-items: start !important;
}

body.home .mg-home-picks ul.products.elementor-grid li.product {
    width: auto !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
}

@media (min-width: 768px) and (max-width: 1199px) {
    body.home .mg-home-picks ul.products.elementor-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 16px !important;
    }
}

@media (max-width: 767px) {
    body.home .mg-home-picks ul.products.elementor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
}

/* ==================== SINGLE PRODUCT LAYOUT TUNING ==================== */
body.single-product #Content .mfn-single-product-tmpl-builder > .section > .section_wrapper {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}

body.single-product #Content .column_product_title .title.page-title {
    font-size: clamp(24px, 3vw, 36px) !important;
    line-height: 1.15 !important;
}

body.single-product .mg-recently-viewed {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px 60px;
}

body.single-product .mg-recently-viewed .mfn-heading,
body.single-product .mg-recently-viewed ul.products.columns-4 {
    max-width: 1224px;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.single-product #Content .column_product_related ul.products.columns-4,
body.single-product .mg-recently-viewed ul.products.columns-4 {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0 !important;
}

body.single-product #Content .column_product_related ul.products.columns-4::before,
body.single-product #Content .column_product_related ul.products.columns-4::after,
body.single-product .mg-recently-viewed ul.products.columns-4::before,
body.single-product .mg-recently-viewed ul.products.columns-4::after {
    display: none !important;
    content: none !important;
}

body.single-product #Content .column_product_related ul.products.columns-4 li.product,
body.single-product #Content .column_product_related ul.products.columns-4 li.mfn-product-li-item,
body.single-product .mg-recently-viewed ul.products.columns-4 li.product,
body.single-product .mg-recently-viewed ul.products.columns-4 li.mfn-product-li-item {
    box-sizing: border-box !important;
    width: calc((100% - 60px) / 4) !important;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
}

@media (max-width: 1024px) {
    body.single-product #Content .column_product_related ul.products.columns-4,
    body.single-product .mg-recently-viewed ul.products.columns-4 {
        gap: 16px;
    }

    body.single-product #Content .column_product_related ul.products.columns-4 li.product,
    body.single-product #Content .column_product_related ul.products.columns-4 li.mfn-product-li-item,
    body.single-product .mg-recently-viewed ul.products.columns-4 li.product,
    body.single-product .mg-recently-viewed ul.products.columns-4 li.mfn-product-li-item {
        width: calc((100% - 32px) / 3) !important;
    }
}

@media (max-width: 767px) {
    body.single-product #Content .mfn-single-product-tmpl-builder > .section > .section_wrapper {
        padding-left: 12px;
        padding-right: 12px;
    }

    body.single-product .mg-recently-viewed {
        padding: 0 12px 48px;
    }

    body.single-product #Content .column_product_related ul.products.columns-4,
    body.single-product .mg-recently-viewed ul.products.columns-4 {
        gap: 12px;
    }

    body.single-product #Content .column_product_related ul.products.columns-4 li.product,
    body.single-product #Content .column_product_related ul.products.columns-4 li.mfn-product-li-item,
    body.single-product .mg-recently-viewed ul.products.columns-4 li.product,
    body.single-product .mg-recently-viewed ul.products.columns-4 li.mfn-product-li-item {
        width: calc((100% - 12px) / 2) !important;
    }
}
