/* ==========================================================================
   MG Product Page — Consolidated CSS
   Merged from: mg-product.css + mg-single-product-layout.css + mg-pdp-components.css
   ========================================================================== */

/* ==========================================================================
   Single Product Page Enhancements
   ========================================================================== */

/* Price Stack & Badges — MeLi-inspired clean hierarchy */
.mg-price-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 10px 0 8px;
}
.mg-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.mg-price-row--top {
    gap: 8px;
    align-items: center;
}
.mg-price-badge {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.mg-price-badge--savings {
    color: #0b7a3b;
    padding: 0;
    border: none;
    background: none;
    font-size: 14px;
}
.mg-price-regular {
    color: #666;
    font-weight: 400;
    font-size: 14px;
}
.mg-price-current {
    font-size: 2em;
    font-weight: 400;
    color: #333;
}
.mg-price-current .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}
.mg-price-badge--iva {
    color: #5f6368;
    font-size: 12px;
    font-weight: 400;
    background: none;
    padding: 0;
}

/* Single product summary layout */
.single-product div.product .summary {
    padding-left: 20px;
}

@media (max-width: 768px) {
    .single-product div.product .summary {
        padding-left: 0;
        margin-top: 20px;
    }
}

/* Share buttons refinement */
.mg-share {
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid rgba(0,0,0,0.08);
    padding-top: 16px;
    margin-top: 20px;
}
.mg-share__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    font-weight: 600;
}
.mg-share__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f3f8;
    color: #490D78;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    padding: 0;
}
.mg-share__btn svg {
    width: 16px;
    height: 16px;
}
.mg-share__btn:hover {
    background: #490D78;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(82, 4, 125, 0.25);
}
.mg-share__btn--copy.copied {
    background: #00a650;
    color: #fff;
}


/* NOTE:
   PDP add-to-cart + tabs/description styling is centralized in:
   assets/css/mg-single-product-layout.css
*/

/* Tighten product summary spacing: variations → price → buttons */
.single-product .entry-summary .variations {
    margin-bottom: 8px !important;
}
.single-product .entry-summary .woocommerce-variation-price {
    margin-bottom: 8px !important;
}
.single-product .entry-summary .single_variation_wrap {
    margin-top: 0 !important;
}
.single-product .entry-summary table.variations td,
.single-product .entry-summary table.variations th {
    padding: 8px 4px 8px 0 !important;
}
.single-product .entry-summary table.variations label {
    font-size: 14px !important;
    font-weight: 500 !important;
}

/* Gallery: click anywhere on main image to open lightbox */
.woocommerce-product-gallery .ct-media-container,
.woocommerce-product-gallery__image img,
.ct-product-gallery-container img {
    cursor: zoom-in;
}

/* 4.1 Product Gallery Polish */
.woocommerce-product-gallery .flex-control-thumbs {
    margin-top: 15px !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.woocommerce-product-gallery .flex-control-thumbs li {
    float: none !important;
    width: 100% !important;
}

.woocommerce-product-gallery .flex-control-thumbs img {
    border-radius: 8px !important;
    border: 2px solid transparent !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.woocommerce-product-gallery .flex-control-thumbs img.flex-active,
.woocommerce-product-gallery .flex-control-thumbs img:hover {
    border-color: var(--theme-palette-color-1) !important;
    box-shadow: 0 6px 15px rgba(82, 4, 125, 0.15);
}

/* 5. Trust Bar Polish (consolidated into main .mg-trust-bar block above) */


/* ==========================================================================
   Single Product Page: Fix gold/wrong font colors
   Ensure product text uses proper dark/purple colors, not gold
   ========================================================================== */

/* Product title: dark, not gold */
.single-product .entry-summary .entry-title {
    color: var(--theme-palette-color-4, #1a1a2e) !important;
}

/* Product price: dark like MeLi, not purple */
.single-product .entry-summary .price,
.single-product .entry-summary .price .woocommerce-Price-amount {
    color: #333 !important;
}

/* Price del (was) in grey */
.single-product .entry-summary .price del,
.single-product .entry-summary .price del .woocommerce-Price-amount {
    color: #666 !important;
    font-weight: 400 !important;
}

/* Price ins (current) in dark, no underline */
.single-product .entry-summary .price ins {
    text-decoration: none;
    color: #333 !important;
}

/* SKU, category, tag, brand: compact horizontal strip */
.single-product .entry-summary .product_meta {
    display: flex !important;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 12px !important;
    color: #5f6368 !important;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
    margin-top: 16px;
}
.single-product .entry-summary .product_meta > span {
    display: inline-flex !important;
    gap: 4px;
    text-transform: none !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    font-size: 13px !important;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Hide the tags row entirely — too many tags clutters the layout */
.single-product .entry-summary .product_meta .tagged_as {
    display: none !important;
}
.single-product .entry-summary .product_meta a {
    color: var(--theme-palette-color-1, #490D78) !important;
    text-decoration: none !important;
    font-size: 13px !important;
}
.single-product .entry-summary .product_meta a:hover {
    text-decoration: underline !important;
}

/* Short description: normal dark text */
.single-product .entry-summary .woocommerce-product-details__short-description,
.single-product .entry-summary .woocommerce-product-details__short-description p {
    color: #444 !important;
    font-size: 15px;
    line-height: 1.7;
}

/* Related/upsell product titles: dark */
.related.products h2,
.up-sells h2,
.related .ct-module-title,
.up-sells .ct-module-title {
    color: var(--theme-palette-color-4, #1a1a2e) !important;
}

/* Star ratings: gold is OK for stars */
.single-product .star-rating span::before {
    color: #f0ad4e !important;
}

/* Quantity input: dark text */
.single-product .quantity input.qty {
    color: #333 !important;
}

/* Breadcrumbs on product page: grey with purple links */
.single-product .woocommerce-breadcrumb {
    color: #888 !important;
}
.single-product .woocommerce-breadcrumb a {
    color: var(--theme-palette-color-1, #490D78) !important;
}

/* Out-of-stock badge */
.single-product .out-of-stock {
    color: #dc3545 !important;
    font-weight: 600;
}

/* Payment methods icons: neutral */
.single-product .ct-payment-methods {
    --theme-icon-color: #666 !important;
}

/* ==========================================================================
   Product Page Bottom Section — Reviews, Related, Recently Viewed
   ========================================================================== */

/* ── Reviews section cleanup ── */
.woocommerce #reviews #comments {
    max-width: 800px;
}

.woocommerce #reviews .woocommerce-Reviews-title {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #1a1a2e !important;
    margin-bottom: 20px !important;
}

.woocommerce #review_form #respond .comment-form-rating {
    margin-bottom: 16px;
}

.woocommerce #reviews .commentlist .comment_container {
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.woocommerce #reviews .comment-text .description p {
    color: #444 !important;
    font-size: 14px;
    line-height: 1.6;
}

/* ── Related / Upsell / Recently Viewed section ── */
.related.products,
.up-sells.upsells,
section[class*="recently"] {
    margin-top: 40px !important;
    padding-top: 32px !important;
    border-top: 1px solid #eee;
}

.related.products > h2,
.up-sells.upsells > h2,
section[class*="recently"] > h2 {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #1a1a2e !important;
    margin-bottom: 24px !important;
}

/* Hide "Comprar Ahora" (Buy Now) in loop/related product cards — too cluttered */
.related .product .wpcbn-btn,
.up-sells .product .wpcbn-btn,
[data-products] .product .wpcbn-btn,
.archive .product .wpcbn-btn {
    display: none !important;
}

/* Related product cards: fixed aspect-ratio container prevents CLS on lazy load */
.related .product-inner .ct-media-container,
.up-sells .product-inner .ct-media-container {
    aspect-ratio: 1;
    background: #f5f5f5;
    overflow: hidden;
}

.related .product-inner .ct-media-container img,
.up-sells .product-inner .ct-media-container img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    padding: 8px;
    background: #fff;
}

/* Related product card buttons: single clean button */
.related .product .button,
.up-sells .product .button {
    background: #490D78 !important;
    color: #fff !important;
    border-radius: 6px !important;
    padding: 10px 16px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-top: 8px !important;
}

.related .product .button:hover,
.up-sells .product .button:hover {
    background: #3d0360 !important;
}

/* Recently viewed must match related products exactly */
.single-product .mg-recently-viewed.related.products {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.single-product .mg-recently-viewed.related.products ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.single-product .mg-recently-viewed.related.products ul.products li.product {
    padding: 15px !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    text-align: center !important;
}

.single-product .mg-recently-viewed.related.products ul.products li.product:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 8px 24px rgba(82, 4, 125, 0.12) !important;
    border-color: rgba(82, 4, 125, 0.15) !important;
}

.single-product .mg-recently-viewed.related.products .product-inner .ct-media-container,
.single-product .mg-recently-viewed.related.products .ct-media-container {
    aspect-ratio: 1;
    background: #f5f5f5;
    border-radius: 8px !important;
    margin-bottom: 15px !important;
    overflow: hidden !important;
}

.single-product .mg-recently-viewed.related.products .product-inner .ct-media-container img,
.single-product .mg-recently-viewed.related.products .ct-media-container img,
.single-product .mg-recently-viewed.related.products ul.products li.product img {
    aspect-ratio: 1;
    object-fit: contain;
    padding: 8px;
    background: #fff;
}

.single-product .mg-recently-viewed.related.products .woocommerce-loop-product__title {
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin-bottom: 8px !important;
    color: var(--theme-palette-color-4, #1a1a2e) !important;
    min-height: 4.2em;
}

.single-product .mg-recently-viewed.related.products .price {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--theme-palette-color-1, #490D78) !important;
    margin-top: auto !important;
    margin-bottom: 12px !important;
}

.single-product .mg-recently-viewed.related.products .ct-woo-card-extra .ct-woo-categories {
    font-size: 12px !important;
    color: #888 !important;
    margin-bottom: 4px !important;
}

.single-product .mg-recently-viewed.related.products .button,
.single-product .mg-recently-viewed.related.products .button.product_type_simple,
.single-product .mg-recently-viewed.related.products .button.product_type_variable {
    background: #490D78 !important;
    color: #fff !important;
    border-radius: 6px !important;
    padding: 10px 16px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-top: 8px !important;
}

.single-product .mg-recently-viewed.related.products .button:hover {
    background: #3d0360 !important;
}

.single-product .mg-recently-viewed.related.products .wpcbn-btn,
.single-product .mg-recently-viewed.related.products .ct-woo-card-actions {
    display: none !important;
}

@media (max-width: 767px) {
    .single-product .mg-recently-viewed.related.products ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
}

/* Category text in cards: subtle */
.related .product .ct-woo-card-extra .ct-woo-categories,
.up-sells .product .ct-woo-card-extra .ct-woo-categories {
    font-size: 12px !important;
    color: #888 !important;
    margin-bottom: 4px !important;
}

/* Related products grid: consistent gap */
.related.products ul.products,
.up-sells.upsells ul.products {
    gap: 20px !important;
}

/* ── Hide duplicate "X disponibles" (urgency badge is enough) ── */
.single-product .woocommerce-variation-availability .stock.in-stock {
    display: none !important;
}


/* ==========================================================================
   Fix: Thumbnail borders clipped on first/last (2026-04-05)
   ========================================================================== */
.single-product .woocommerce-product-gallery .flexy-pills ol,
.woocommerce-product-gallery .flex-control-thumbs {
    padding: 6px !important;
    margin: 6px -6px 0 !important;
}

/* ==========================================================================

/* ==========================================================================
   Fix: Product gallery layout shift on load (2026-04-05)
   ========================================================================== */
.single-product .woocommerce-product-gallery {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.single-product .woocommerce-product-gallery.woocommerce-product-gallery--with-images,
.single-product .woocommerce-product-gallery.flexy-initiated,
.single-product .woocommerce-product-gallery[data-columns] {
    opacity: 1;
}
/* Fallback: show after 1s even if JS doesn't fire */
@keyframes mg-gallery-reveal {
    to { opacity: 1; }
}
.single-product .woocommerce-product-gallery {
    animation: mg-gallery-reveal 0s 1s forwards;
}

/* ==========================================================================
   Fix: Q&A section mobile layout (2026-04-05)
   ========================================================================== */
@media (max-width: 768px) {
    .mg-question-form .mg-question-row-main {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .mg-question-form .mg-question-row-main textarea {
        width: 100% !important;
        min-width: 0 !important;
        font-size: 14px !important;
        padding: 12px !important;
        border-radius: 8px !important;
    }

    .mg-question-form .mg-question-row-main button[type="submit"] {
        width: 100% !important;
        padding: 12px 20px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
    }

    .mg-question-form .mg-question-row-identity {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .mg-question-form .mg-question-row-identity input {
        width: 100% !important;
        min-width: 0 !important;
        font-size: 14px !important;
        padding: 12px !important;
        border-radius: 8px !important;
    }
}

/* ==========================================================================
   Fix: Reviews section mobile layout (2026-04-05)
   ========================================================================== */
@media (max-width: 768px) {
    .mg-reviews-header {
        flex-direction: column !important;
        gap: 16px !important;
    }

    .mg-reviews-rating-box {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

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

    .mg-reviews-bars {
        width: 100% !important;
    }

    .mg-reviews-toolbar {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }

    .mg-reviews-toolbar select {
        width: 100% !important;
    }

    .mg-reviews-cta-btn {
        width: 100% !important;
        text-align: center !important;
    }

    .mg-reviews-photos-box {
        width: 100% !important;
    }
}

/* ==========================================================================
   Fix: WhatsApp floating widget avoids mobile PDP CTAs (2026-04-05)
   ========================================================================== */
@media (max-width: 768px) {
    .single-product .wa__btn_popup {
        left: auto !important;
        right: 18px !important;
        bottom: calc(var(--mg-pdp-sticky-height, 110px) + 14px + env(safe-area-inset-bottom)) !important;
    }

    .single-product .wa__popup_chat_box {
        left: auto !important;
        right: 16px !important;
        width: auto !important;
        max-width: calc(100vw - 32px) !important;
        margin: 0 !important;
    }
}


/* ==========================================================================
   Single Product Layout — Add-to-cart, tabs, gallery
   ========================================================================== */

/* ==========================================================================
   Single Product Add-to-Cart
   Canonical source for quantity + buttons (desktop/mobile)
   ========================================================================== */
.single-product .entry-summary form.cart {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.single-product .entry-summary form.cart .quantity {
    margin: 0 !important;
    float: none !important;
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 4px;
    overflow: hidden;
    background: #fff;
    width: auto;
    min-width: 100px;
    height: 40px;
}

.single-product .entry-summary form.cart .quantity .minus,
.single-product .entry-summary form.cart .quantity .plus,
.single-product .entry-summary form.cart .quantity .ct-decrease,
.single-product .entry-summary form.cart .quantity .ct-increase {
    position: relative !important;
    background: transparent !important;
    border: none !important;
    color: var(--theme-palette-color-4) !important;
    font-size: 16px !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
}

.single-product .entry-summary form.cart .quantity .minus:hover,
.single-product .entry-summary form.cart .quantity .plus:hover,
.single-product .entry-summary form.cart .quantity .ct-decrease:hover,
.single-product .entry-summary form.cart .quantity .ct-increase:hover {
    background: #f0f0f5 !important;
    color: var(--theme-palette-color-1) !important;
}

.single-product .entry-summary form.cart .quantity .ct-decrease::before {
    content: "−";
}

.single-product .entry-summary form.cart .quantity .ct-increase::before {
    content: "+";
}

.single-product .entry-summary form.cart .quantity .ct-decrease::before,
.single-product .entry-summary form.cart .quantity .ct-increase::before {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    font-size: 20px;
    line-height: 1;
    font-weight: 500;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.single-product .entry-summary form.cart .quantity input.qty {
    width: 36px !important;
    border: none !important;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    line-height: 1;
    height: 100%;
    padding: 0 !important;
    background: transparent !important;
    color: var(--theme-palette-color-4);
    margin: 0 !important;
    appearance: textfield;
}

.single-product .entry-summary form.cart .quantity input.qty::-webkit-outer-spin-button,
.single-product .entry-summary form.cart .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Hide quantity control when WooCommerce locks quantity to a single unit. */
.single-product .entry-summary form.cart .quantity.hidden,
.single-product .entry-summary .ct-cart-actions .quantity.hidden,
.single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .quantity.hidden,
.single-product .entry-summary form.cart:has(.quantity input.qty[type="hidden"][min="1"][max="1"]) .quantity,
.single-product .entry-summary .ct-cart-actions:has(input.qty[type="hidden"][min="1"][max="1"]) .quantity,
.single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart:has(input.qty[type="hidden"][min="1"][max="1"]) .quantity {
    display: none !important;
}

.single-product .entry-summary form.cart .button {
    border-radius: 10px !important;
    padding: 10px 20px !important;
    height: 42px !important;
    min-height: 42px !important;
    --theme-button-min-height: 42px !important;
    flex: 1 1 220px;
    max-width: none !important;
    min-width: 0;
    font-size: 14px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.single-product .entry-summary.entry-summary-items > .ct-product-add-to-cart > .cart {
    --theme-button-min-height: 42px !important;
}

.single-product .entry-summary .ct-cart-actions,
.single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    align-items: stretch !important;
    width: 100%;
}

.single-product .entry-summary .ct-cart-actions .quantity,
.single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .quantity {
    flex: 0 0 90px;
    min-height: 46px !important;
    height: 46px !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 0 6px !important;
    border-radius: 10px !important;
}

.single-product .entry-summary .ct-cart-actions .single_add_to_cart_button,
.single-product .entry-summary .ct-cart-actions .wpcbn-btn-single,
.single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .single_add_to_cart_button,
.single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .wpcbn-btn-single {
    flex: 1 1 0;
    min-width: 0 !important;
    min-height: 46px !important;
    height: 46px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-align: center !important;
    line-height: 1.1 !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

@media (min-width: 769px) {
    .single-product .entry-summary form.cart .quantity,
    .single-product .entry-summary .ct-cart-actions .quantity,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .quantity {
        justify-content: center !important;
        gap: 6px !important;
    }

    .single-product .entry-summary form.cart .quantity .minus,
    .single-product .entry-summary form.cart .quantity .ct-decrease,
    .single-product .entry-summary .ct-cart-actions .quantity .minus,
    .single-product .entry-summary .ct-cart-actions .quantity .ct-decrease,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .quantity .minus,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .quantity .ct-decrease {
        order: 1 !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        inset: auto !important;
        transform: none !important;
        margin: 0 !important;
        align-self: center !important;
    }

    .single-product .entry-summary form.cart .quantity input.qty,
    .single-product .entry-summary .ct-cart-actions .quantity input.qty,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .quantity input.qty {
        order: 2 !important;
        width: 32px !important;
        min-width: 32px !important;
        align-self: center !important;
        text-align: center !important;
    }

    .single-product .entry-summary form.cart .quantity .plus,
    .single-product .entry-summary form.cart .quantity .ct-increase,
    .single-product .entry-summary .ct-cart-actions .quantity .plus,
    .single-product .entry-summary .ct-cart-actions .quantity .ct-increase,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .quantity .plus,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .quantity .ct-increase {
        order: 3 !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        inset: auto !important;
        transform: none !important;
        margin: 0 !important;
        align-self: center !important;
    }
}

/* Añadir al carrito — outline violet */
.single-product .entry-summary .ct-cart-actions .single_add_to_cart_button:not(.wpcbn-btn-single),
.single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .single_add_to_cart_button:not(.wpcbn-btn-single) {
    background: #fff !important;
    color: #490D78 !important;
    border: 2px solid #490D78 !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

.single-product .entry-summary .ct-cart-actions .single_add_to_cart_button:not(.wpcbn-btn-single):hover,
.single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .single_add_to_cart_button:not(.wpcbn-btn-single):hover {
    background: #f3ecfc !important;
}

/* Comprar ahora — solid violet */
.single-product .entry-summary .ct-cart-actions .single_add_to_cart_button.wpcbn-btn-single,
.single-product .entry-summary .ct-cart-actions .wpcbn-btn-single,
.single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .single_add_to_cart_button.wpcbn-btn-single,
.single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .wpcbn-btn-single {
    background: #490D78 !important;
    color: #fff !important;
    border: 2px solid #490D78 !important;
    box-shadow: 0 4px 12px rgba(73, 13, 120, 0.2);
    transition: all 0.2s ease !important;
}

.single-product .entry-summary .ct-cart-actions .single_add_to_cart_button.wpcbn-btn-single:hover,
.single-product .entry-summary .ct-cart-actions .wpcbn-btn-single:hover,
.single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .single_add_to_cart_button.wpcbn-btn-single:hover,
.single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .wpcbn-btn-single:hover {
    background: #3a0a61 !important;
    border-color: #3a0a61 !important;
}

/* ==========================================================================
   Single Product Tabs & Description Typography
   Canonical source (removed from style.css)
   ========================================================================== */
.single-product .woocommerce-tabs {
    background: #fff;
    border: 1px solid #eae5ef;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    padding: 0;
    margin-top: 30px;
}

.woocommerce div.product .woocommerce-tabs {
    overflow: hidden;
    max-width: 100%;
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
    padding: 0 !important;
    margin: 0 0 30px !important;
    border: none !important;
    background: transparent !important;
    display: flex;
    gap: 10px;
    align-items: stretch !important;
    flex-wrap: wrap !important;
    row-gap: 8px !important;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs::-webkit-scrollbar {
    display: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs::before,
.woocommerce div.product .woocommerce-tabs ul.tabs::after,
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after,
.woocommerce div.product .woocommerce-tabs ul.tabs li a::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li a::after {
    content: none !important;
    display: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    background: #f5f5f7 !important;
    border: none !important;
    border-radius: 999px !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    padding: 10px 20px !important;
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.15 !important;
    text-decoration: none !important;
    border: 0 !important;
    font-weight: 600 !important;
    color: #666 !important;
    font-size: 14px !important;
    -webkit-text-fill-color: currentColor !important;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
    background: #490D78 !important;
    box-shadow: 0 4px 12px rgba(82, 4, 125, 0.2);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: #fff !important;
    -webkit-text-fill-color: currentColor !important;
}

.woocommerce div.product .woocommerce-tabs .panel,
.woocommerce div.product .woocommerce-tabs .panel p,
.woocommerce div.product .woocommerce-tabs .panel li,
.woocommerce div.product .woocommerce-tabs .panel td,
.woocommerce div.product .woocommerce-tabs .panel th {
    color: #333 !important;
}

.woocommerce div.product .woocommerce-tabs .panel {
    padding: 24px 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.woocommerce div.product .woocommerce-tabs .panel .mg-questions-section,
.woocommerce div.product .woocommerce-tabs .panel .mg-reviews-section {
    padding: 0 !important;
    background: transparent !important;
}

.woocommerce div.product .woocommerce-tabs .panel .mg-questions-inner,
.woocommerce div.product .woocommerce-tabs .panel .mg-reviews-inner {
    max-width: none !important;
    padding: 0 !important;
}

.woocommerce div.product .woocommerce-tabs .panel.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    width: min(100%, var(--wp--style--global--content-size, 1296px)) !important;
    max-width: min(100%, var(--wp--style--global--content-size, 1296px)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.woocommerce div.product .woocommerce-tabs .panel.is-layout-constrained > .alignwide {
    max-width: min(100%, var(--wp--style--global--wide-size, 1400px)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.woocommerce div.product .woocommerce-tabs .panel h2,
.woocommerce div.product .woocommerce-tabs .panel h3,
.woocommerce div.product .woocommerce-tabs .panel h4 {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1a1a2e !important;
    margin: 20px 0 12px !important;
    padding: 0;
    border: none;
}

.woocommerce div.product .woocommerce-tabs .panel h2:first-child,
.woocommerce div.product .woocommerce-tabs .panel h3:first-child,
.woocommerce div.product .woocommerce-tabs .panel h4:first-child {
    margin-top: 0 !important;
}

.woocommerce div.product .woocommerce-tabs .panel p {
    margin: 0 0 12px !important;
    line-height: 1.7 !important;
    font-size: 14px !important;
    color: #444 !important;
}

.woocommerce div.product .woocommerce-tabs .panel p strong,
.woocommerce div.product .woocommerce-tabs .panel li strong {
    color: #1a1a2e;
    font-weight: 600;
}

.woocommerce div.product .woocommerce-tabs .panel ul {
    margin: 0 0 16px !important;
    padding-left: 20px !important;
    list-style: disc !important;
}

.woocommerce div.product .woocommerce-tabs .panel ol {
    margin: 0 0 16px !important;
    padding-left: 20px !important;
    list-style: decimal !important;
}

.woocommerce div.product .woocommerce-tabs .panel li {
    margin-bottom: 6px !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    padding: 0;
    color: #444;
    border-bottom: none;
}

.woocommerce div.product .woocommerce-tabs .panel ul li:has(> :first-child:is(img, svg)) {
    list-style: none !important;
}

.woocommerce div.product .woocommerce-tabs .panel table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.woocommerce div.product .woocommerce-tabs .panel table th,
.woocommerce div.product .woocommerce-tabs .panel table td {
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
}

.woocommerce div.product .woocommerce-tabs .panel table th {
    color: var(--theme-palette-color-4, #1a1a2e) !important;
    font-weight: 600;
    background: #faf8fc;
}

.woocommerce div.product .woocommerce-tabs .panel hr {
    border: none !important;
    height: 1px !important;
    background: #eee !important;
    margin: 20px 0 !important;
}

.single-product .woocommerce div.product .woocommerce-tabs .mg-product-datasheet-tab {
    display: flex;
    justify-content: center;
}

.single-product .woocommerce div.product .woocommerce-tabs .mg-product-datasheet-tab .mg-product-datasheet-btn {
    margin: 0 auto !important;
    width: min(100%, 480px);
}

@media (min-width: 1100px) {
    .single-product .product-entry-wrapper.mg-tabs-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(420px, 1.1fr);
        column-gap: clamp(20px, 2vw, 30px);
        row-gap: 18px;
        align-items: start;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-product-gallery,
    .single-product .product-entry-wrapper.mg-tabs-layout > [class*="product-gallery"] {
        grid-column: 1;
        grid-row: 1;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .summary.entry-summary {
        grid-column: 2;
        grid-row: 1 / span 2;
        width: 100% !important;
        margin-inline-start: 0 !important;
        padding-left: 0;
        position: sticky;
        top: 20px;
        align-self: start;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        margin-top: 0 !important;
        padding: 18px 20px 22px;
        background: #fff;
        border: 1px solid #ece5f6;
        border-radius: 16px;
        box-shadow: 0 10px 24px rgba(37, 14, 62, 0.05);
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper .is-layout-constrained,
    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper .is-width-constrained {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-product-gallery .ct-product-gallery-container {
        background: #fff;
        border: 1px solid #ece5f6;
        border-radius: 16px;
        box-shadow: 0 10px 24px rgba(37, 14, 62, 0.05);
        padding: 14px 14px 10px;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-product-gallery .flexy-item {
        min-height: 520px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-product-gallery .flexy-item .ct-media-container img {
        width: auto;
        max-height: 520px;
        object-fit: contain;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-product-gallery .flexy-pills ol {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
        margin-top: 12px;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-product-gallery .flexy-pills li {
        border: 1px solid #e6ddf2;
        border-radius: 10px;
        padding: 4px;
        margin: 0;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-product-gallery .flexy-pills li.active {
        border-color: #52047D;
        box-shadow: 0 6px 14px rgba(82, 4, 125, 0.14);
    }

    .single-product .summary.entry-summary.entry-summary-items {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .single-product .summary.entry-summary.entry-summary-items > .entry-title,
    .single-product .summary.entry-summary.entry-summary-items > .mg-business-tags,
    .single-product .summary.entry-summary.entry-summary-items > .price,
    .single-product .summary.entry-summary.entry-summary-items > .mg-installments-badge,
    .single-product .summary.entry-summary.entry-summary-items > .woocommerce-product-details__short-description,
    .single-product .summary.entry-summary.entry-summary-items > .mg-conv11-key-specs,
    .single-product .summary.entry-summary.entry-summary-items > .ct-product-add-to-cart,
    .single-product .summary.entry-summary.entry-summary-items > .product_meta,
    .single-product .summary.entry-summary.entry-summary-items > .mg-share {
        margin: 0 !important;
    }

    .single-product .summary.entry-summary.entry-summary-items > .entry-title {
        order: 1;
        font-size: clamp(22px, 1.8vw, 28px) !important;
        line-height: 1.2 !important;
        letter-spacing: -0.01em;
    }

    .single-product .summary.entry-summary.entry-summary-items > .mg-business-tags {
        order: 2;
    }

    .single-product .summary.entry-summary.entry-summary-items > .price {
        order: 3;
    }

    .single-product .summary.entry-summary.entry-summary-items > .mg-installments-badge {
        order: 4;
    }

    .single-product .summary.entry-summary.entry-summary-items > .mg-conv11-key-specs {
        order: 5;
    }

    .single-product .summary.entry-summary.entry-summary-items > .ct-product-divider[data-id="divider_1"] {
        order: 6;
        margin: 0 !important;
    }

    .single-product .summary.entry-summary.entry-summary-items > .ct-product-add-to-cart {
        order: 7;
    }

    .single-product .summary.entry-summary.entry-summary-items > .woocommerce-product-details__short-description {
        display: none;
    }

    .single-product .entry-summary .mg-product-datasheet-bar {
        display: none;
    }

    .single-product .summary.entry-summary.entry-summary-items > .mg-whatsapp-advisor-bar {
        order: 8;
    }

    .single-product .summary.entry-summary.entry-summary-items > .ct-product-divider[data-id="divider_2"] {
        order: 9;
        margin: 2px 0 0 !important;
    }

    .single-product .summary.entry-summary.entry-summary-items > .product_meta {
        order: 10;
    }

    .single-product .summary.entry-summary.entry-summary-items > .mg-share {
        order: 11;
    }

    .single-product .entry-summary .mg-conv11-key-specs,
    .single-product .entry-summary .mg-product-datasheet-bar,
    .single-product .entry-summary .mg-conv11-trust,
    .single-product .entry-summary .mg-whatsapp-advisor-bar,
    .single-product .entry-summary .mg-trust-signals {
        border: 1px solid #e8dff3 !important;
        border-radius: 14px !important;
        background: #fff !important;
        box-shadow: 0 8px 20px rgba(33, 12, 58, 0.06);
    }

    .single-product .entry-summary .mg-conv11-key-specs {
        padding: 10px !important;
    }

    .single-product .entry-summary .mg-conv11-key-specs__list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .single-product .entry-summary .mg-conv11-key-specs__item {
        min-height: 56px;
        padding: 9px 10px;
        border-radius: 11px;
        background: #f7f4fc;
        border: 1px solid #ece3f8;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 3px;
    }

    .single-product .entry-summary .mg-conv11-key-specs__item:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .single-product .entry-summary .mg-conv11-key-specs__label {
        font-size: 10px;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #6c5b80;
    }

    .single-product .entry-summary .mg-conv11-key-specs__value {
        font-size: 13px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .single-product .entry-summary .mg-product-datasheet-bar,
    .single-product .entry-summary .mg-whatsapp-advisor-bar {
        padding: 14px 16px !important;
    }

    .single-product .entry-summary .mg-trust-signals {
        margin-top: 12px;
        padding: 10px 14px;
    }

    .single-product .entry-summary .mg-trust-signals__item {
        padding: 7px 0;
    }

    .single-product .entry-summary .mg-conv11-trust {
        margin-top: 12px;
        padding: 12px 14px;
        font-size: 13px;
        line-height: 1.45;
    }

    .single-product .entry-summary .mg-conv11-trust__item + .mg-conv11-trust__item {
        margin-top: 7px;
    }

    .single-product .entry-summary .mg-whatsapp-advisor-btn,
    .single-product .entry-summary .mg-product-datasheet-btn {
        min-height: 42px;
        border-radius: 10px !important;
        padding: 0 16px !important;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper ul.tabs {
        margin: 0 0 18px !important;
        gap: 6px !important;
        flex-wrap: nowrap;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper ul.tabs li {
        background: #f6f2fb !important;
        border: 1px solid transparent !important;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper ul.tabs li a {
        padding: 8px 12px !important;
        font-size: 12px !important;
        letter-spacing: 0.02em;
        color: #615174 !important;
        -webkit-text-fill-color: currentColor !important;
        font-weight: 600 !important;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper ul.tabs li.active {
        background: var(--mg-purple, #490D78) !important;
        border-color: var(--mg-purple, #490D78) !important;
        box-shadow: 0 4px 12px rgba(73, 13, 120, 0.3);
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper ul.tabs li.active a {
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper .panel {
        padding-top: 12px !important;
    }

    /* Centre the PDF download button inside the "Ficha técnica" tab */
    .single-product .woocommerce-tabs #tab-additional_information {
        text-align: center;
    }
    .single-product .woocommerce-tabs #tab-additional_information > * {
        display: inline-block;
        text-align: left;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper .panel > *:first-child {
        margin-top: 0 !important;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper .panel h2,
    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper .panel h3,
    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper .panel h4 {
        margin-top: 22px !important;
        margin-bottom: 10px !important;
    }

    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper .panel p,
    .single-product .product-entry-wrapper.mg-tabs-layout > .woocommerce-tabs.wc-tabs-wrapper .panel li {
        font-size: 15px !important;
        line-height: 1.72 !important;
    }
}

/* Sticky sidebar removed — scroll should be uniform across the whole page. */

@media (max-width: 1099px) {
    .single-product .entry-summary .ct-cart-actions .quantity,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .quantity {
        flex: 0 0 86px;
        min-height: 44px !important;
        height: 44px !important;
    }

    .single-product .entry-summary .ct-cart-actions .single_add_to_cart_button,
    .single-product .entry-summary .ct-cart-actions .wpcbn-btn-single,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .single_add_to_cart_button,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .wpcbn-btn-single {
        min-height: 44px !important;
        height: 44px !important;
        padding: 0 12px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 768px) {
    /* Mobile: simple products keep form full-width; action wrapper handles the grid */
    .single-product .entry-summary form.cart {
        display: block !important;
        width: 100% !important;
    }

    .single-product .entry-summary .woocommerce-product-details__short-description {
        margin: 14px 0 18px !important;
        font-size: 15px !important;
        line-height: 1.58 !important;
        color: #474754 !important;
    }

    .single-product .entry-summary .woocommerce-product-details__short-description p {
        margin: 0 0 12px !important;
        font-size: inherit !important;
        line-height: inherit !important;
        color: inherit !important;
    }

    .single-product .entry-summary .woocommerce-product-details__short-description p:last-child {
        margin-bottom: 0 !important;
    }

    /* Mobile: quantity on top, buttons side by side below */
    .single-product .entry-summary .ct-cart-actions,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart {
        display: grid !important;
        grid-template-columns: minmax(0, 1.16fr) minmax(0, 0.84fr);
        grid-template-rows: auto auto;
        column-gap: 10px !important;
        row-gap: 10px !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        flex-wrap: wrap !important;
    }

    .single-product .entry-summary .ct-cart-actions:has(.quantity.hidden),
    .single-product .entry-summary .ct-cart-actions:has(input.qty[type="hidden"][min="1"][max="1"]),
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart:has(.quantity.hidden),
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart:has(input.qty[type="hidden"][min="1"][max="1"]) {
        grid-template-rows: auto !important;
        row-gap: 0 !important;
    }

    .single-product .entry-summary form.cart > .ct-cart-actions {
        margin-top: 0 !important;
    }

    .single-product .entry-summary form.cart > .quantity,
    .single-product .entry-summary .ct-cart-actions .quantity,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .quantity {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
        min-height: 44px !important;
        height: 44px !important;
        justify-self: start;
        flex: unset !important;
    }

    .single-product .entry-summary form.cart > .single_add_to_cart_button:not(.wpcbn-btn-single),
    .single-product .entry-summary .ct-cart-actions .single_add_to_cart_button:not(.wpcbn-btn-single),
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .single_add_to_cart_button:not(.wpcbn-btn-single) {
        grid-column: 1;
        grid-row: 2;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 46px !important;
        height: 46px !important;
        padding: 0 18px !important;
        font-size: 12.5px !important;
        letter-spacing: 0 !important;
        flex: unset !important;
        justify-self: stretch !important;
    }

    .single-product .entry-summary form.cart > .wpcbn-btn-single,
    .single-product .entry-summary form.cart > .single_add_to_cart_button.wpcbn-btn-single,
    .single-product .entry-summary .ct-cart-actions .wpcbn-btn-single,
    .single-product .entry-summary .ct-cart-actions .single_add_to_cart_button.wpcbn-btn-single,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .wpcbn-btn-single,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart .single_add_to_cart_button.wpcbn-btn-single {
        grid-column: 2;
        grid-row: 2;
        width: 100% !important;
        min-height: 46px !important;
        height: 46px !important;
        padding: 0 18px !important;
        font-size: 12.5px !important;
        letter-spacing: 0 !important;
        flex: unset !important;
        justify-self: stretch !important;
    }

    .single-product .entry-summary form.cart > .single_add_to_cart_button:not(.wpcbn-btn-single):first-child,
    .single-product .entry-summary form.cart > .wpcbn-btn-single:first-child,
    .single-product .entry-summary form.cart > .single_add_to_cart_button.wpcbn-btn-single:first-child {
        grid-row: 1 !important;
    }

    .single-product .entry-summary .ct-cart-actions:has(.quantity.hidden) .single_add_to_cart_button:not(.wpcbn-btn-single),
    .single-product .entry-summary .ct-cart-actions:has(.quantity.hidden) .single_add_to_cart_button.wpcbn-btn-single,
    .single-product .entry-summary .ct-cart-actions:has(.quantity.hidden) .wpcbn-btn-single,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart:has(.quantity.hidden) .single_add_to_cart_button:not(.wpcbn-btn-single),
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart:has(.quantity.hidden) .single_add_to_cart_button.wpcbn-btn-single,
    .single-product .entry-summary form.variations_form .woocommerce-variation-add-to-cart:has(.quantity.hidden) .wpcbn-btn-single {
        grid-row: 1 !important;
    }

    .single-product .entry-summary form.cart:has(> .quantity.hidden) > .single_add_to_cart_button:not(.wpcbn-btn-single),
    .single-product .entry-summary form.cart:has(> .quantity.hidden) > .wpcbn-btn-single,
    .single-product .entry-summary form.cart:has(> .quantity.hidden) > .single_add_to_cart_button.wpcbn-btn-single {
        grid-row: 1 !important;
    }

    .single-product div.product .woocommerce-tabs ul.tabs,
    .single-product .woocommerce-tabs ul.tabs {
        justify-content: flex-start !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 12px 4px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        align-items: center !important;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    .single-product .woocommerce-tabs ul.tabs li {
        display: inline-flex !important;
        width: max-content !important;
        max-width: max-content !important;
        min-height: 40px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        flex: 0 0 auto !important;
        scroll-snap-align: start;
    }

    .single-product .woocommerce-tabs ul.tabs li a {
        padding: 10px 16px !important;
        font-size: 13px !important;
        width: auto !important;
        min-height: 40px !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }

    .single-product .woocommerce-tabs .panel p,
    .single-product .woocommerce-tabs .panel li {
        text-align: left !important;
        white-space: normal !important;
        word-spacing: normal !important;
        overflow-wrap: anywhere !important;
        line-height: 1.55 !important;
    }

    .single-product .woocommerce-tabs .panel {
        padding: 18px 0 4px !important;
    }

    .single-product .woocommerce-tabs .panel .mg-questions-title,
    .single-product .woocommerce-tabs .panel .mg-reviews-title {
        font-size: 20px !important;
        margin-bottom: 14px !important;
    }

    .single-product .woocommerce-tabs .panel .mg-question-form {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .single-product .woocommerce-tabs .panel .mg-question-row-main,
    .single-product .woocommerce-tabs .panel .mg-question-row-identity,
    .single-product .woocommerce-tabs .panel .mg-reply-identity {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .single-product .woocommerce-tabs .panel .mg-question-row-main textarea,
    .single-product .woocommerce-tabs .panel .mg-question-row-main button,
    .single-product .woocommerce-tabs .panel .mg-question-row-identity input,
    .single-product .woocommerce-tabs .panel .mg-reply-identity input {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* PDP gallery hardening: keep visual thumbnails even if Flexy toggles circle mode at runtime. */
.single-product .woocommerce-product-gallery .flexy-pills[data-type="thumbs"],
.single-product .woocommerce-product-gallery .flexy-pills[data-type="circle"].mg-force-thumbs {
    max-width: none !important;
    margin-top: 12px !important;
    position: static !important;
    inset: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
}

.single-product .woocommerce-product-gallery .ct-product-gallery-container {
    overflow: visible !important;
}

/* Main gallery image: contain, never crop */
.single-product .woocommerce-product-gallery .ct-media-container img {
    object-fit: contain !important;
    width: 100% !important;
    height: auto !important;
}

.single-product .woocommerce-product-gallery .flexy-pills[data-type="thumbs"] ol,
.single-product .woocommerce-product-gallery .flexy-pills[data-type="circle"].mg-force-thumbs ol {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-top: 12px !important;
}

.single-product .woocommerce-product-gallery .flexy-pills[data-type="thumbs"] li,
.single-product .woocommerce-product-gallery .flexy-pills[data-type="circle"].mg-force-thumbs li {
    width: auto !important;
    height: auto !important;
    min-height: 70px;
    border: 1px solid #e6ddf2;
    border-radius: 10px;
    padding: 4px;
    margin: 0;
    display: block !important;
}

.single-product .woocommerce-product-gallery .flexy-pills[data-type="thumbs"] li::before,
.single-product .woocommerce-product-gallery .flexy-pills[data-type="circle"].mg-force-thumbs li::before {
    content: none !important;
    display: none !important;
}

.single-product .woocommerce-product-gallery .flexy-pills[data-type="thumbs"] .ct-media-container,
.single-product .woocommerce-product-gallery .flexy-pills[data-type="circle"].mg-force-thumbs .ct-media-container {
    display: block !important;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
}

.single-product .woocommerce-product-gallery .flexy-pills[data-type="thumbs"] .ct-media-container img,
.single-product .woocommerce-product-gallery .flexy-pills[data-type="circle"].mg-force-thumbs .ct-media-container img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Faster thumb-to-image swaps for mobile and desktop */
.single-product .woocommerce-product-gallery .flexy-items,
.single-product .woocommerce-product-gallery .flexy-item,
.single-product .woocommerce-product-gallery .flexy-view,
.single-product .woocommerce-product-gallery .ct-product-gallery-container img {
    transition-duration: 0.16s !important;
    animation-duration: 0.16s !important;
}

/* PhotoSwipe (lightbox) thumbnails strip */
.pswp--open .pswp__bg {
    opacity: 1 !important;
}

.pswp.mg-pswp-has-thumbs {
    --mg-pswp-thumbs-space: 160px;
    --mg-pswp-caption-space: 44px;
}

.pswp .mg-pswp-thumbs {
    position: absolute;
    left: 50%;
    bottom: calc(var(--mg-pswp-caption-space, 44px) + 12px);
    transform: translateX(-50%);
    z-index: 1100;
    display: flex;
    gap: 8px;
    max-width: min(92vw, 680px);
    overflow-x: auto;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(15, 16, 20, 0.45);
    backdrop-filter: blur(4px);
}

.pswp .mg-pswp-thumb {
    appearance: none;
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.82;
}

.pswp .mg-pswp-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.pswp .mg-pswp-thumb.is-active {
    opacity: 1;
    border-color: #ffffff;
}

@media (max-width: 689px) {
    .pswp.mg-pswp-has-thumbs {
        --mg-pswp-thumbs-space: 106px;
    }

    .pswp .mg-pswp-thumbs {
        bottom: calc(var(--mg-pswp-caption-space, 44px) + 8px);
        max-width: 95vw;
        padding: 7px 8px;
        gap: 7px;
    }

    .pswp .mg-pswp-thumb {
        width: 48px;
        height: 48px;
        border-radius: 9px;
    }
}


/* ==========================================================================
   PDP Components — Installments, datasheet, Q&A, reviews, WhatsApp
   ========================================================================== */

/* PDP component styles migrated from mu-plugins to avoid inline <style> output. */

/* mg-installments-badge.php */
.mg-installments-badge {
	display: inline-flex;
	align-items: flex-start;
	gap: 8px;
	background: transparent;
	color: #0b7a3b;
	padding: 0;
	border-radius: 0;
	max-width: none;
	margin: 4px 0 10px;
	position: static;
}
.mg-installments-icon {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	color: #0b7a3b;
	margin-top: 1px;
}
.mg-installments-text {
	display: flex;
	flex-direction: column;
	gap: 1px;
}
.mg-installments-main {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	color: #0b7a3b;
}
.mg-installments-main .woocommerce-Price-amount {
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
}
.mg-installments-sub {
	font-size: 12px;
	color: #5f6368;
	opacity: 1;
	line-height: 1.3;
}
@media (max-width: 768px) {
	.mg-installments-badge {
		gap: 8px;
		margin: 6px 0 12px;
	}
	.mg-installments-main {
		font-size: 14px;
	}
	.mg-installments-sub {
		font-size: 12px;
	}
}

/* mg-product-datasheet.php */
.mg-product-datasheet-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 12px;
	padding: 14px 16px;
	border: 1px solid #e6e6e6;
	border-radius: 10px;
	background: #fff;
}
.mg-product-datasheet-title {
	font-weight: 700;
	font-size: 16px;
	color: #3f0460;
}
.mg-product-datasheet-meta {
	margin-top: 4px;
	font-size: 12px;
	color: #6b6b6b;
}
.mg-product-datasheet-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 160px;
	background: #3f0460 !important;
	border-color: #3f0460 !important;
	color: #fff !important;
	border-radius: 8px;
	text-decoration: none !important;
	font-weight: 600;
	font-size: 14px;
	box-sizing: border-box;
	transition: background 0.2s ease, border-color 0.2s ease;
}
.mg-product-datasheet-btn:hover {
	background: #2c033f !important;
	border-color: #2c033f !important;
	color: #fff !important;
}
.mg-product-datasheet-icon {
	font-size: 16px;
}
@media (max-width: 767px) {
	.mg-product-datasheet-bar {
		flex-direction: column;
		align-items: flex-start;
	}
	.mg-product-datasheet-btn {
		width: 100%;
	}
}

/* mg-whatsapp-product-advisor.php */
.mg-whatsapp-advisor-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 12px;
	padding: 14px 16px;
	border: 1px solid #e6e6e6;
	border-radius: 10px;
	background: #fff;
}
.mg-whatsapp-advisor-content {
	min-width: 0;
	flex: 1;
}
.mg-whatsapp-advisor-title {
	font-weight: 700;
	font-size: 16px;
	white-space: nowrap;
}
.mg-whatsapp-advisor-hours {
	margin-top: 4px;
	font-size: 12px;
	color: #6b6b6b;
}
.mg-whatsapp-advisor-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 140px;
	background: #25D366 !important;
	border-color: #25D366 !important;
	color: #fff !important;
	border-radius: 8px;
	text-decoration: none !important;
	font-weight: 600;
	font-size: 14px;
	box-sizing: border-box;
	transition: background 0.2s ease, border-color 0.2s ease;
}
.mg-whatsapp-advisor-btn:hover {
	background: #128C7E !important;
	border-color: #128C7E !important;
	color: #fff !important;
}
@media (max-width: 767px) {
	.mg-whatsapp-advisor-bar {
		flex-direction: column;
		align-items: flex-start;
	}
	.mg-whatsapp-advisor-btn {
		width: 100%;
	}
}

/* includes/mg-product-trust-signals.php */
.mg-trust-signals {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid #eee;
}
.mg-trust-signals__item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 8px 0;
}
.mg-trust-signals__item svg {
	flex-shrink: 0;
	color: #00a650;
	margin-top: 1px;
}
.mg-trust-signals__item div {
	display: flex;
	flex-direction: column;
	gap: 1px;
}
.mg-trust-signals__item strong {
	font-size: 13px;
	font-weight: 600;
	color: #333;
}
.mg-trust-signals__item span {
	font-size: 12px;
	color: #888;
}
@media (max-width: 768px) {
	.mg-trust-signals {
		margin-top: 16px;
		padding-top: 12px;
	}
}

/* mg-low-stock-urgency.php */
.mg-low-stock-urgency {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #c0392b;
	font-size: 13px;
	font-weight: 600;
	margin: 4px 0 8px;
}
.mg-low-stock-dot {
	width: 8px;
	height: 8px;
	background: #c0392b;
	border-radius: 50%;
	display: inline-block;
	animation: mg-pulse 1.5s infinite;
}
@keyframes mg-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

/* mg-reorder-product-sections.php */
.woocommerce-tabs .wc-tabs li a {
	color: #666 !important;
	font-weight: 600;
}
.woocommerce-tabs .wc-tabs li a:hover {
	color: #52047D !important;
}
.woocommerce-tabs .wc-tabs li.active a {
	color: #52047D !important;
	border-bottom-color: #52047D !important;
}

/* mg-default-color-selection.php */
.single-product form.variations_form .reset_variations {
	display:none !important;
}
.single-product .woocommerce-variation-availability .mg-color-unavailable-note{
	display:none;
}
.single-product .woocommerce-variation-availability.mg-color-unavailable > :not(.mg-color-unavailable-note){
	display:none !important;
}
.single-product .woocommerce-variation-availability.mg-color-unavailable .mg-color-unavailable-note{
	display:block;
}

/* mg-conversion-phase2.php (product-specific rules only) */
.wpcbn-btn-single{
    margin-top:0 !important;
    max-width:none !important;
}
.single-product form.variations_form .woocommerce-variation-add-to-cart{
    display:flex !important;
    flex-wrap:wrap !important;
    row-gap:10px !important;
    column-gap:0 !important;
    align-items:center !important;
    width:100% !important;
    float:none !important;
    clear:both !important;
}
.single-product form.variations_form .woocommerce-variation-add-to-cart .single_add_to_cart_button,
.single-product form.variations_form .woocommerce-variation-add-to-cart .wpcbn-btn-single{
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
}
ul.products .product .wpcbn-btn-archive{
    margin-top:8px !important;
}

/* includes/mg-conversion-phase11-pdp.php */
@media (max-width: 767px) {
	body.single-product.mg-conv11-has-sticky {
		padding-bottom: calc(var(--mg-pdp-sticky-height, 94px) + 16px + env(safe-area-inset-bottom));
	}
	.mg-conv11-sticky {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 9999;
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
		background: #ffffff;
		border-top: 1px solid #e5e8ec;
		box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.08);
	}
	.mg-conv11-sticky__meta {
		flex: 1;
		min-width: 0;
	}
	.mg-conv11-sticky__label {
		font-size: 11px;
		line-height: 1.2;
		color: #566273;
	}
	.mg-conv11-sticky__price {
		font-size: 16px;
		line-height: 1.2;
		font-weight: 700;
		color: #111827;
	}
	.mg-conv11-sticky__price .amount {
		color: inherit;
	}
	.mg-conv11-sticky__actions {
		display: flex;
		gap: 8px;
	}
	.mg-conv11-sticky__btn.button {
		margin: 0 !important;
		padding: 12px 14px !important;
		border-radius: 10px !important;
		font-weight: 700 !important;
		font-size: 13px !important;
		line-height: 1 !important;
		white-space: nowrap;
	}
	.mg-conv11-sticky__btn--buy.button {
		background: #290140 !important;
		border-color: #290140 !important;
		color: #ffffff !important;
	}
}
@media (min-width: 768px) {
	.mg-conv11-sticky {
		display: none !important;
	}
}
.mg-conv11-trust {
	margin-top: 12px;
	padding: 12px 14px;
	border: 1px solid #e6e9ee;
	border-radius: 10px;
	background: #f8fbff;
	font-size: 13px;
	line-height: 1.45;
	color: #28323d;
}
	.mg-conv11-trust__item {
		display: flex;
		align-items: flex-start;
		gap: 8px;
	}
	.mg-conv11-trust__item svg {
		flex-shrink: 0;
		margin-top: 2px;
		color: #52047D;
	}
	.mg-conv11-trust__item + .mg-conv11-trust__item {
		margin-top: 6px;
	}
	.mg-conv11-key-specs {
		margin: 10px 0 14px;
		padding: 10px 12px;
		border: 1px solid #e6e9ee;
		border-radius: 10px;
		background: #f8fbff;
	}
	.mg-conv11-key-specs__list {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
		margin: 0;
		padding: 0;
		list-style: none;
	}
	.mg-conv11-key-specs__item {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		padding: 6px 10px;
		border-radius: 999px;
		border: 1px solid #dbe4ee;
		background: #fff;
		font-size: 12px;
		line-height: 1.3;
		color: #28323d;
	}
	.mg-conv11-key-specs__label {
		font-weight: 700;
		color: #1f2937;
	}
	.mg-conv11-key-specs__value {
		color: #4b5563;
	}
	.mg-conv11-oos {
		margin-top: 16px;
		padding: 14px;
	border: 1px solid #e7ebf0;
	border-radius: 12px;
	background: #ffffff;
}
.mg-conv11-oos__title {
	margin: 0;
	font-size: 20px;
	line-height: 1.3;
}
.mg-conv11-oos__copy {
	margin: 6px 0 12px;
	color: #4b5563;
	font-size: 14px;
}
.mg-conv11-oos__alert {
	margin: 0 0 10px;
	padding: 9px 10px;
	border-radius: 9px;
	font-size: 13px;
	line-height: 1.35;
	border: 1px solid #e6ebf1;
	background: #f8fbff;
	color: #28323d;
}
.mg-conv11-oos__alert--success {
	border-color: #b7e3c7;
	background: #effbf3;
	color: #1d8f4e;
}
.mg-conv11-oos__alert--error {
	border-color: #f0d2d2;
	background: #fff6f6;
	color: #8f3b3b;
}
.mg-conv11-oos__notify {
	margin: 0 0 12px;
	padding: 10px;
	border: 1px solid #e7ebf0;
	border-radius: 10px;
	background: #f8fbff;
}
.mg-conv11-oos__notify-label {
	display: block;
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
	color: #28323d;
}
.mg-conv11-oos__notify-row {
	display: flex;
	gap: 8px;
	align-items: center;
}
.mg-conv11-oos__notify-input {
	flex: 1;
	min-width: 0;
	height: 42px;
	padding: 0 12px;
	border: 1px solid #d6dde7;
	border-radius: 9px;
	font-size: 14px;
	background: #fff;
}
.mg-conv11-oos__notify-btn.button {
	height: 42px;
	padding: 0 14px !important;
	border-radius: 9px !important;
	font-weight: 700 !important;
	white-space: nowrap;
	background: #1d8f4e !important;
	border-color: #1d8f4e !important;
	color: #fff !important;
}
.mg-conv11-oos__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 0 0 12px;
}
.mg-conv11-oos__card {
	border: 1px solid #e8edf2;
	border-radius: 10px;
	padding: 8px;
	background: #fff;
}
.mg-conv11-oos__card a {
	display: block;
	text-decoration: none;
}
.mg-conv11-oos__card img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
}
.mg-conv11-oos__name {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.35;
	color: #111827;
}
.mg-conv11-oos__price {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	font-weight: 700;
	color: #111827;
}
.mg-conv11-oos__quote.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 14px !important;
	border-radius: 10px !important;
	font-weight: 700 !important;
	background: #1d8f4e !important;
	border-color: #1d8f4e !important;
	color: #fff !important;
}
	@media (max-width: 767px) {
		.mg-conv11-trust {
			font-size: 12px;
		}
		.mg-conv11-key-specs__item {
			width: 100%;
			justify-content: space-between;
			border-radius: 9px;
		}
		.mg-conv11-oos__notify-row {
			flex-direction: column;
			align-items: stretch;
	}
	.mg-conv11-oos__notify-btn.button {
		width: 100%;
	}
}

/* mg-product-reviews-display.php */
.mg-product-rating {
	margin: 8px 0 12px;
}
.mg-rating-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #666;
	font-size: 14px;
	text-decoration: none;
}
.mg-rating-value {
	font-weight: 600;
	color: #444;
}
.mg-rating-count {
	color: #777;
}
.mg-rating-link .star-rating {
	font-size: 16px;
}
.mg-rating-link:hover {
	color: #d69942;
	text-decoration: underline;
}

/* mg-product-questions.php */
.mg-questions-section{padding:24px 0;background:#fff;}
.mg-questions-inner{max-width:1120px;margin:0 auto;padding:0 16px;}
.mg-questions-title{font-size:22px;margin:0 0 16px;color:#1f1f1f;font-weight:600;}
.mg-question-form{margin-bottom:12px;display:grid;grid-template-columns:1fr 160px;gap:12px;align-items:start;}
.mg-question-row-main{display:contents;}
.mg-question-row-main textarea{border:1px solid #ddd;border-radius:8px;padding:18px 20px;font-size:16px;color:#333!important;min-height:58px;width:100%;resize:none;font-family:inherit;line-height:1.4;overflow-y:hidden;}
.mg-question-row-main textarea:focus{outline:none;border-color:#52047D;color:#333!important;}
.mg-question-row-main textarea::placeholder{color:#888;}
.mg-question-row-main button{border:0;border-radius:8px;padding:18px 24px;background:#52047D;color:#fff;font-weight:600;font-size:15px;cursor:pointer;transition:background 0.2s;white-space:nowrap;min-height:58px;width:100%;}
.mg-question-row-main button:hover{background:#3d0360;}
.mg-question-row-identity{grid-column:1;display:flex;gap:10px;margin-top:0;}
.mg-question-row-identity input{flex:1;border:1px solid #ddd;border-radius:6px;padding:10px 14px;font-size:13px;color:#333!important;}
.mg-question-row-identity input:focus{outline:none;border-color:#52047D;color:#333!important;}
.mg-question-row-identity input::placeholder{color:#999;}
.mg-question-message{font-size:13px;color:#333;margin-top:8px;}
.mg-question-message.is-error{color:#c53030;}
.mg-question-message.is-success{color:#2f855a;}
.mg-question-link{display:inline-block;color:#52047D;text-decoration:none;font-size:13px;margin-bottom:16px;}
.mg-question-link:hover{text-decoration:underline;}
.mg-question-list{border-top:1px solid #eee;padding-top:16px;}
.mg-question-item{padding:16px 0;border-bottom:1px solid #f0f0f0;}
.mg-question-item:last-child{border-bottom:0;}
/* Depth indentation */
.mg-question-item.mg-depth-1{margin-left:32px;border-left:2px solid #e0e0e0;padding-left:16px;}
.mg-question-item.mg-depth-2{margin-left:32px;border-left:2px solid #e0e0e0;padding-left:16px;}
/* Comment header */
.mg-comment-header{display:flex;align-items:center;gap:8px;margin-bottom:4px;flex-wrap:wrap;}
.mg-comment-author{font-size:13px;font-weight:600;color:#1f1f1f;}
.mg-comment-date{font-size:12px;color:#999;}
.mg-comment-text{font-size:14px;color:#1f1f1f;line-height:1.5;}
/* Admin badge */
.mg-admin-badge{background:#52047D;color:#fff;font-size:10px;padding:2px 8px;border-radius:4px;text-transform:uppercase;font-weight:600;letter-spacing:0.3px;}
/* Admin comment highlight */
.mg-is-admin>.mg-comment-row{background:#f8f5fc;border-left:3px solid #52047D;border-radius:8px;padding:12px 16px;}
/* Actions */
.mg-comment-actions{display:flex;gap:12px;margin-top:8px;align-items:center;}
.mg-reply-btn{background:none;border:none;color:#52047D;font-size:13px;font-weight:600;cursor:pointer;padding:0;text-decoration:none;}
.mg-reply-btn:hover{text-decoration:underline;}
.mg-collapse-btn{background:none;border:none;color:#666;font-size:12px;cursor:pointer;padding:0;display:flex;align-items:center;gap:4px;}
.mg-collapse-btn::before{content:"\25BC";font-size:8px;transition:transform 0.2s;}
.mg-collapse-btn.is-collapsed::before{transform:rotate(-90deg);}
.mg-replies.is-collapsed{display:none;}
/* Reply form inline */
.mg-reply-form-wrap{margin-top:12px;}
.mg-reply-form-wrap form{display:flex;flex-direction:column;gap:8px;}
.mg-reply-form-wrap textarea{border:1px solid #ddd;border-radius:6px;padding:10px 14px;font-size:13px;color:#333!important;resize:none;min-height:40px;max-height:120px;overflow-y:auto;font-family:inherit;line-height:1.4;width:100%;box-sizing:border-box;}
.mg-reply-form-wrap textarea:focus{outline:none;border-color:#52047D;color:#333!important;}
.mg-reply-form-wrap textarea::placeholder{color:#999;}
.mg-reply-identity{display:flex;gap:8px;}
.mg-reply-identity input{flex:1;border:1px solid #ddd;border-radius:6px;padding:8px 12px;font-size:13px;color:#333!important;}
.mg-reply-identity input:focus{outline:none;border-color:#52047D;color:#333!important;}
.mg-reply-identity input::placeholder{color:#999;}
.mg-reply-form-buttons{display:flex;gap:8px;align-items:center;}
.mg-reply-form-buttons button[type="submit"]{border:0;border-radius:6px;padding:8px 16px;background:#52047D;color:#fff;font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap;}
.mg-reply-form-buttons button[type="submit"]:hover{background:#3d0360;}
.mg-reply-cancel{background:none!important;border:1px solid #ddd!important;border-radius:6px!important;padding:8px 16px!important;color:#666!important;font-size:13px!important;cursor:pointer!important;}
.mg-reply-message{font-size:12px;color:#333;}
.mg-reply-message.is-error{color:#c53030;}
/* Legacy selectors for cached HTML */
.mg-question-row{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;}
.mg-question-text{font-size:14px;color:#1f1f1f;font-weight:500;flex:1;}
.mg-question-date{font-size:12px;color:#999;white-space:nowrap;}
.mg-answer-row{margin-top:12px;padding:12px 16px;background:#f8f8f8;border-radius:8px;border-left:3px solid #52047D;}
.mg-answer-label{font-size:11px;color:#52047D;margin-bottom:4px;font-weight:600;text-transform:uppercase;letter-spacing:0.5px;}
.mg-answer-text{font-size:14px;color:#333;line-height:1.5;}
.mg-answer-empty{margin-top:8px;font-size:13px;color:#999;font-style:italic;}
.mg-answer-form{margin-top:12px;display:flex;gap:8px;align-items:flex-start;}
.mg-answer-form textarea{flex:1;border:1px solid #ddd;border-radius:6px;padding:10px 14px;font-size:13px;color:#333!important;resize:none;min-height:40px;max-height:120px;overflow-y:auto;font-family:inherit;line-height:1.4;}
.mg-answer-form textarea:focus{outline:none;border-color:#52047D;color:#333!important;}
.mg-answer-form textarea::placeholder{color:#999;}
.mg-answer-form button{border:0;border-radius:6px;padding:10px 16px;background:#52047D;color:#fff;font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap;}
.mg-question-more-wrap{padding-top:16px;}
.mg-question-more{border:1px solid #ddd;background:#fff;color:#333;border-radius:6px;padding:10px 24px;font-size:14px;cursor:pointer;transition:all 0.2s;}
.mg-question-more:hover{border-color:#52047D;color:#52047D;}
.mg-question-empty{font-size:14px;color:#666;padding:8px 0;}
.mg-question-hp{position:absolute;left:-9999px;opacity:0;height:0;width:0;}
@media (max-width: 600px){
	.mg-question-form{display:flex;flex-direction:column;gap:10px;}
	.mg-question-row-main{display:flex;flex-direction:column;gap:10px;}
	.mg-question-row-main input,.mg-question-row-main button{width:100%;}
	.mg-question-row-identity{flex-direction:column;}
	.mg-question-item.mg-depth-1,.mg-question-item.mg-depth-2{margin-left:16px;padding-left:12px;}
	.mg-reply-identity{flex-direction:column;}
	.mg-comment-header{gap:4px;}
	.mg-comment-date{width:100%;margin-top:2px;}
}

/* mg-reviews-section.php */
.mg-reviews-section{padding:24px 0;background:#fff;}
.mg-reviews-inner{max-width:1120px;margin:0 auto;padding:0 16px;}
.mg-reviews-title{font-size:22px;margin:0 0 16px;color:#1f1f1f;font-weight:600;}
.mg-reviews-header{display:flex;gap:32px;padding-bottom:16px;border-bottom:1px solid #eee;margin-bottom:16px;}
.mg-reviews-rating-box{flex:0 0 auto;display:flex;gap:12px;align-items:flex-start;}
.mg-reviews-score{font-size:44px;font-weight:300;color:#1f1f1f;line-height:1;}
.mg-reviews-score-meta{display:flex;flex-direction:column;gap:2px;padding-top:4px;}
.mg-reviews-average-stars{position:relative;font-size:18px;color:#ddd;line-height:1;}
.mg-reviews-average-stars::before{content:"★★★★★";}
.mg-reviews-average-stars span{position:absolute;left:0;top:0;overflow:hidden;color:#FCCB02;white-space:nowrap;}
.mg-reviews-average-stars span::before{content:"★★★★★";}
.mg-reviews-count{font-size:12px;color:#666;}
.mg-reviews-bars{display:flex;flex-direction:column;gap:3px;margin-top:8px;}
.mg-reviews-bar-row{display:flex;align-items:center;gap:4px;font-size:11px;color:#666;}
.mg-reviews-bar-label{min-width:28px;}
.mg-reviews-bar{width:80px;height:8px;border-radius:4px;background:#eee;overflow:hidden;}
.mg-reviews-bar span{display:block;height:100%;background:#FCCB02;}
.mg-reviews-photos-box{flex:1;min-width:0;}
.mg-reviews-photos-title{font-size:14px;font-weight:600;color:#1f1f1f;margin-bottom:10px;}
.mg-reviews-photos{display:flex;gap:10px;flex-wrap:wrap;}
.mg-reviews-photo-thumb{position:relative;border:0;background:#f5f5f5;padding:0;border-radius:8px;overflow:hidden;width:130px;height:160px;cursor:pointer;transition:transform .2s;}
.mg-reviews-photo-thumb:hover{transform:scale(1.02);}
.mg-reviews-photo-thumb img{width:100%;height:100%;object-fit:cover;display:block;}
.mg-reviews-photo-thumb--small{width:70px;height:70px;border-radius:6px;}
.mg-reviews-photo-badge{position:absolute;left:8px;bottom:8px;background:rgba(0,0,0,0.7);color:#fff;font-size:11px;padding:3px 7px;border-radius:4px;display:inline-flex;align-items:center;gap:3px;}
.mg-reviews-photos-empty{font-size:13px;color:#999;}
.mg-reviews-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:16px;}
.mg-reviews-filters{display:flex;gap:24px;align-items:center;font-size:14px;color:#333;}
.mg-reviews-filters label{display:inline-flex;align-items:center;gap:8px;white-space:nowrap;margin:0;line-height:1;}
.mg-reviews-filters select{border:1px solid #ddd!important;border-radius:6px!important;padding:10px 14px!important;font-size:14px!important;background:#fff!important;color:#333!important;cursor:pointer;min-width:150px;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:right 12px center!important;padding-right:36px!important;height:42px!important;line-height:1!important;vertical-align:middle;}
.mg-reviews-actions{display:flex;align-items:center;gap:10px;}
.mg-reviews-button{display:inline-flex;align-items:center;justify-content:center;padding:10px 20px;border-radius:6px;background:#52047D;color:#fff;font-weight:600;font-size:14px;text-decoration:none;border:0;transition:background .2s;height:42px;}
.mg-reviews-button:hover{background:#3d0360;}
.mg-reviews-button--disabled{background:#eee;color:#999;pointer-events:none;}
.mg-reviews-cta-note{font-size:11px;color:#888;}
.mg-reviews-items{display:flex;flex-direction:column;}
.mg-review-item{padding:16px 0;border-bottom:1px solid #f0f0f0;}
.mg-review-item:last-child{border-bottom:0;}
.mg-review-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;}
.mg-reviews-stars{display:inline-flex;gap:2px;font-size:14px;color:#ddd;}
.mg-reviews-stars .is-active{color:#FCCB02;}
.mg-review-date{font-size:12px;color:#999;}
.mg-review-text{font-size:14px;color:#333;margin:0 0 10px;line-height:1.5;}
.mg-review-photos{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px;}
.mg-review-helpful{border:1px solid #ddd;background:#fff;color:#333;font-size:12px;cursor:pointer;padding:6px 12px;border-radius:20px;display:inline-flex;align-items:center;gap:4px;transition:all .2s;}
.mg-review-helpful:hover{border-color:#52047D;color:#52047D;}
.mg-review-helpful.is-voted{background:#f5f5f5;color:#999;border-color:#eee;}
.mg-reviews-empty{font-size:14px;color:#666;padding:20px 0;}
.mg-reviews-more-wrap{padding-top:16px;}
.mg-reviews-more{border:1px solid #ddd;background:#fff;color:#333;border-radius:6px;padding:10px 24px;font-size:14px;cursor:pointer;transition:all .2s;}
.mg-reviews-more:hover{border-color:#52047D;color:#52047D;}
.mg-review-lightbox{position:fixed;top:0;left:0;right:0;bottom:0;z-index:999999;display:flex!important;align-items:center;justify-content:center;padding:20px;}
.mg-review-lightbox[hidden]{display:none!important;}
.mg-review-lightbox-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:-1;}
.mg-review-lightbox-dialog{position:relative;background:#fff;border-radius:12px;width:min(92vw,900px);max-height:85vh;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 50px rgba(0,0,0,0.3);}
.mg-review-lightbox-header{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid #eee;}
.mg-review-lightbox-title{font-weight:600;font-size:16px;color:#1f1f1f;}
.mg-review-lightbox-close{border:0;background:transparent;font-size:20px;color:#666;cursor:pointer;}
.mg-review-lightbox-close:hover{color:#333;}
.mg-review-lightbox-body{display:flex;min-height:0;flex:1;}
.mg-review-lightbox-media{position:relative;flex:1 1 65%;background:#f8f8f8;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:24px;}
.mg-review-lightbox-media img{max-width:100%;max-height:55vh;object-fit:contain;border-radius:8px;}
.mg-review-lightbox-nav{position:absolute;top:50%;transform:translateY(-50%);border:0;background:#fff;color:#333;width:40px;height:40px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,0.15);transition:transform .2s;}
.mg-review-lightbox-nav:hover{transform:translateY(-50%) scale(1.1);}
.mg-review-lightbox-nav[disabled]{opacity:0.3;cursor:default;}
.mg-review-lightbox-nav[data-mg-photo-prev]{left:16px;}
.mg-review-lightbox-nav[data-mg-photo-next]{right:16px;}
.mg-review-lightbox-thumbs{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;}
.mg-review-lightbox-thumb{border:0;background:transparent;padding:0;border-radius:6px;overflow:hidden;width:56px;height:56px;cursor:pointer;opacity:0.5;border:2px solid transparent;transition:all .2s;}
.mg-review-lightbox-thumb img{width:100%;height:100%;object-fit:cover;display:block;}
.mg-review-lightbox-thumb.is-active{opacity:1;border-color:#52047D;}
.mg-review-lightbox-info{flex:0 0 280px;padding:24px;border-left:1px solid #eee;display:flex;flex-direction:column;gap:12px;}
.mg-review-lightbox-rating{display:flex;gap:2px;font-size:18px;color:#ddd;}
.mg-review-lightbox-rating span.is-active{color:#FCCB02;}
.mg-review-lightbox-text{font-size:14px;color:#333;line-height:1.6;}
.mg-review-lightbox-date,.mg-review-lightbox-author{font-size:12px;color:#888;}
html.mg-review-lightbox-open,html.mg-review-lightbox-open body{overflow:hidden;}
	@media (max-width: 768px){
		.mg-reviews-header{flex-direction:column;gap:20px;}
		.mg-reviews-photos-box{width:100%;}
		.mg-reviews-photo-thumb{width:100px;height:125px;}
		.mg-reviews-toolbar{align-items:stretch;gap:10px;}
		.mg-reviews-filters{width:100%;gap:10px;flex-wrap:wrap;}
		.mg-reviews-filters label{width:100%;white-space:normal;justify-content:space-between;}
		.mg-reviews-filters select{width:100%;min-width:0!important;max-width:100%!important;}
		.mg-reviews-actions{width:100%;flex-wrap:wrap;}
		.mg-reviews-button{width:100%;}
		.mg-review-lightbox-body{flex-direction:column;}
		.mg-review-lightbox-info{border-left:0;border-top:1px solid #eee;flex:0 0 auto;}
	}
