/*
 * MTG Universal 90 Width
 * Regla global de ancho para tienda, productos y flujo de venta.
 * No pertenece a TM1/TM2/TM3.
 * Creado y distribuido por antoniocarpio.com (web developer with IA)
 */

/* =========================================================
   SHOP / PRODUCTOS
   ========================================================= */

body:has(.mtg-shortcode-products),
body:has(.mtg-shop-shell),
body:has(.mtg-shortcode-grid){
    background:#fff !important;
}

body:has(.mtg-shortcode-products) .site,
body:has(.mtg-shortcode-products) .site-main,
body:has(.mtg-shortcode-products) .content-area,
body:has(.mtg-shortcode-products) .site-content,
body:has(.mtg-shortcode-products) article,
body:has(.mtg-shortcode-products) .entry-content,
body:has(.mtg-shop-shell) .site,
body:has(.mtg-shop-shell) .site-main,
body:has(.mtg-shop-shell) .content-area,
body:has(.mtg-shop-shell) .site-content,
body:has(.mtg-shop-shell) article,
body:has(.mtg-shop-shell) .entry-content{
    width:100% !important;
    max-width:none !important;
    margin-left:0 !important;
    margin-right:0 !important;
}

.mtg-shortcode-products,
.mtg-shop-shell,
.mtg-shop-page,
.mtg-archive-product-page{
    width:90% !important;
    max-width:1280px !important;
    margin-left:auto !important;
    margin-right:auto !important;
}

/* Si el shortcode ya trae padding interno, mantenemos ancho real */
.mtg-shortcode-products{
    box-sizing:border-box !important;
}

/* Sidebar + contenido dentro del 90% */
.mtg-shortcode-shell,
.mtg-shop-shell{
    width:100% !important;
    max-width:100% !important;
}

/* =========================================================
   SINGLE PRODUCT
   ========================================================= */

body.single-mtg_product .site,
body.single-mtg_product .site-main,
body.single-mtg_product .content-area,
body.single-mtg_product .site-content,
body.single-mtg_product article,
body.single-mtg_product .entry-content,
body.single-product .site,
body.single-product .site-main,
body.single-product .content-area,
body.single-product .site-content,
body.single-product article,
body.single-product .entry-content{
    width:100% !important;
    max-width:none !important;
    margin-left:0 !important;
    margin-right:0 !important;
}

.mtg-single-product,
.mtg-single-product-page,
.tm1-single-product,
.tm1-product-single,
.single-mtg_product .site-main > *,
.single-product .site-main > *{
    width:90% !important;
    max-width:1280px !important;
    margin-left:auto !important;
    margin-right:auto !important;
}

/* Evitar que el header/footer se deformen */
.single-mtg_product header,
.single-mtg_product footer,
.single-product header,
.single-product footer{
    width:auto !important;
    max-width:none !important;
}

/* =========================================================
   CART / CHECKOUT / REVIEW / THANK YOU
   ========================================================= */

body:has(.mtg-usf) .site,
body:has(.mtg-usf) .site-main,
body:has(.mtg-usf) .content-area,
body:has(.mtg-usf) .site-content,
body:has(.mtg-usf) article,
body:has(.mtg-usf) .entry-content{
    width:100% !important;
    max-width:none !important;
    margin-left:0 !important;
    margin-right:0 !important;
}

.mtg-usf,
.mtg-usf-cart,
.mtg-usf-checkout,
.mtg-usf-review,
.mtg-usf-thankyou,
.tm1-cart-shell,
.tm1-checkout-shell,
.tm1-review-clean,
.tm1-thankyou-shell{
    width:90% !important;
    max-width:1280px !important;
    margin-left:auto !important;
    margin-right:auto !important;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media(max-width:720px){
    .mtg-shortcode-products,
    .mtg-shop-shell,
    .mtg-shop-page,
    .mtg-archive-product-page,
    .mtg-single-product,
    .mtg-single-product-page,
    .tm1-single-product,
    .tm1-product-single,
    .single-mtg_product .site-main > *,
    .single-product .site-main > *,
    .mtg-usf,
    .mtg-usf-cart,
    .mtg-usf-checkout,
    .mtg-usf-review,
    .mtg-usf-thankyou,
    .tm1-cart-shell,
    .tm1-checkout-shell,
    .tm1-review-clean,
    .tm1-thankyou-shell{
        width:92% !important;
        max-width:92% !important;
    }
}

/* =========================================================
   MTG FORCE UNBOX 90%
   Rompe contenedores boxed de WordPress y centra al 90vw.
   No pertenece a TM1/TM2/TM3.
   ========================================================= */

/* SHOP shortcode real */
body.page:has(.mtg-shortcode-products) .entry-content,
body.page:has(.mtg-shortcode-products) .site-main,
body.page:has(.mtg-shortcode-products) .content-area,
body.page:has(.mtg-shortcode-products) article,
body.page:has(.mtg-shortcode-products) .page,
body.page:has(.mtg-shortcode-products) .post{
    width:100% !important;
    max-width:none !important;
    margin-left:0 !important;
    margin-right:0 !important;
    padding-left:0 !important;
    padding-right:0 !important;
}

body.page:has(.mtg-shortcode-products) .mtg-shortcode-products{
    width:90vw !important;
    max-width:1280px !important;
    margin-left:calc(50% - 45vw) !important;
    margin-right:auto !important;
    box-sizing:border-box !important;
}

/* Si la pantalla es mayor al max-width, mantener centrado */
@media(min-width:1422px){
    body.page:has(.mtg-shortcode-products) .mtg-shortcode-products{
        width:1280px !important;
        margin-left:calc(50% - 640px) !important;
    }
}

/* CART / CHECKOUT universal sales flow */
body.page:has(.mtg-usf) .entry-content,
body.page:has(.mtg-usf) .site-main,
body.page:has(.mtg-usf) .content-area,
body.page:has(.mtg-usf) article,
body.page:has(.mtg-usf) .page,
body.page:has(.mtg-usf) .post{
    width:100% !important;
    max-width:none !important;
    margin-left:0 !important;
    margin-right:0 !important;
    padding-left:0 !important;
    padding-right:0 !important;
}

body.page:has(.mtg-usf) .mtg-usf{
    width:90vw !important;
    max-width:1280px !important;
    margin-left:calc(50% - 45vw) !important;
    margin-right:auto !important;
    box-sizing:border-box !important;
}

@media(min-width:1422px){
    body.page:has(.mtg-usf) .mtg-usf{
        width:1280px !important;
        margin-left:calc(50% - 640px) !important;
    }
}

/* SINGLE PRODUCT */
body.single-mtg_product .site-main,
body.single-mtg_product .content-area,
body.single-mtg_product .site-content,
body.single-mtg_product article,
body.single-product .site-main,
body.single-product .content-area,
body.single-product .site-content,
body.single-product article{
    width:100% !important;
    max-width:none !important;
    margin-left:0 !important;
    margin-right:0 !important;
    padding-left:0 !important;
    padding-right:0 !important;
}

body.single-mtg_product .mtg-single-product,
body.single-mtg_product .tm1-single-product,
body.single-mtg_product .tm1-product-single,
body.single-product .mtg-single-product,
body.single-product .tm1-single-product,
body.single-product .tm1-product-single{
    width:90vw !important;
    max-width:1280px !important;
    margin-left:calc(50% - 45vw) !important;
    margin-right:auto !important;
    box-sizing:border-box !important;
}

@media(min-width:1422px){
    body.single-mtg_product .mtg-single-product,
    body.single-mtg_product .tm1-single-product,
    body.single-mtg_product .tm1-product-single,
    body.single-product .mtg-single-product,
    body.single-product .tm1-single-product,
    body.single-product .tm1-product-single{
        width:1280px !important;
        margin-left:calc(50% - 640px) !important;
    }
}

@media(max-width:720px){
    body.page:has(.mtg-shortcode-products) .mtg-shortcode-products,
    body.page:has(.mtg-usf) .mtg-usf,
    body.single-mtg_product .mtg-single-product,
    body.single-mtg_product .tm1-single-product,
    body.single-mtg_product .tm1-product-single,
    body.single-product .mtg-single-product,
    body.single-product .tm1-single-product,
    body.single-product .tm1-product-single{
        width:92vw !important;
        max-width:92vw !important;
        margin-left:calc(50% - 46vw) !important;
    }
}

/* MTG FORCE SHOP 90VW FINAL - override global */
html body .mtg-shortcode-products{
    width:90vw !important;
    max-width:none !important;
    margin-left:calc(50% - 45vw) !important;
    margin-right:0 !important;
    box-sizing:border-box !important;
}

html body .mtg-shortcode-products .mtg-shortcode-shell{
    width:100% !important;
    max-width:none !important;
}

@media(max-width:720px){
    html body .mtg-shortcode-products{
        width:92vw !important;
        max-width:92vw !important;
        margin-left:calc(50% - 46vw) !important;
    }
}
