/* ==========================================================================
   MG Global — Brand colors, typography, buttons, forms, footer
   ========================================================================== */

/* ==========================================================================
   Global: Brand colors for buttons, links, accents
   ========================================================================== */
:root {
    /* ── Brand Manual V.1 — Paleta completa ── */
    /* Principales */
    --mg-purple:       #490D78;
    --mg-white:        #FFFFFF;
    --mg-gold:         #F5CD46;
    --mg-magenta:      #892075;
    /* Secundarios */
    --mg-sky:          #7DE7FB;
    --mg-mint:         #9DFCDF;
    --mg-purple-mid:   #531078;

    /* ── Theme tokens (usados en el sitio) ── */
    --theme-palette-color-1: #490D78;
    --theme-palette-color-2: #3a0a61;
    --theme-palette-color-3: #d69942;
    --theme-button-background-initial-color: #490D78;
    --theme-button-background-hover-color: #3a0a61;
    --theme-button-text-initial-color: #ffffff;
    --theme-button-text-hover-color: #ffffff;
    --theme-link-initial-color: #490D78;
    --theme-link-hover-color: #3a0a61;
}

/* Global Typography: keep a fast local/system stack for first paint */
body,
.site-header,
.entry-content,
h1, h2, h3, h4, h5, h6,
.woocommerce div.product .product_title,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
button, input, select, textarea {
    font-family: var(--theme-font-stack-default), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Grey background for home page only */
body.home {
    background-color: #f5f5f5 !important;
}
body.home .site-main,
body.home .entry-content {
    background: #f5f5f5;
}

/* WooCommerce buttons: purple primary, gold secondary */
.single_add_to_cart_button,
.single_add_to_cart_button.button,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce .button.alt,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce .button.alt:not(.checkout-button),
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce a.button.alt,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce button.button.alt,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce input.button.alt,
.ct-cart-content .woocommerce-mini-cart__buttons .button:last-child {
    background-color: #490D78 !important;
    color: #fff !important;
    border: none !important;
}

.single_add_to_cart_button:hover,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce .button.alt:hover,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce a.button.alt:hover,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce button.button.alt:hover {
    background-color: #3d0360 !important;
}

/* "Comprar ahora" / secondary buttons */
.mg-buy-now-btn,
.button.checkout,
.checkout-button,
.ct-cart-content .woocommerce-mini-cart__buttons .button:first-child {
    background-color: #d69942 !important;
    color: #fff !important;
    border: none !important;
}

.mg-buy-now-btn:hover,
.button.checkout:hover,
.checkout-button:hover {
    background-color: #c18835 !important;
}

/* Generic WP/WC buttons */
.wp-element-button,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce .button,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce a.button,
.wc-block-components-button {
    background-color: #490D78 !important;
    color: #fff !important;
}

.wp-element-button:hover,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce .button:hover,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce a.button:hover {
    background-color: #3d0360 !important;
}

/* ==========================================================================
   Product Cards: Unified Styling for Home & Shop
   ========================================================================== */

/* Target both Gutenberg blocks and standard WooCommerce archives */
.home .wc-block-grid__product,
.archive.post-type-archive-product .product,
.archive.tax-product_cat .product,
.related.products .product,
.upsells.products .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;
}

.home .wc-block-grid__product:hover,
.archive.post-type-archive-product .product:hover,
.archive.tax-product_cat .product:hover,
.related.products .product:hover,
.upsells.products .product:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px rgba(82, 4, 125, 0.12) !important;
    border-color: rgba(82, 4, 125, 0.15) !important;
}

/* Ensure consistent image styling */
.home .wc-block-grid__product-image,
.archive .product-inner .ct-media-container,
.related .product-inner .ct-media-container {
    border-radius: 8px !important;
    margin-bottom: 15px !important;
    overflow: hidden !important;
}

/* Product Titles */
.home .wc-block-grid__product-title,
.archive .product .woocommerce-loop-product__title,
.related .product .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;
}

/* Price styling in loop */
.home .wc-block-grid__product-price,
.archive .product .price,
.related .product .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;
}

.home .wc-block-grid__product-price del,
.archive .product .price del,
.related .product .price del {
    font-size: 14px !important;
    color: #999 !important;
    margin-right: 6px !important;
}

/* Sale Badge — unified red pill */
.home .wc-block-grid__product-onsale,
.archive .onsale,
.related .onsale,
.upsells .onsale,
[data-products] .onsale,
.single-product .onsale {
    background: #e53e3e !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    padding: 5px 12px !important;
    border-radius: 999px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    top: 12px !important;
    left: 12px !important;
    right: auto !important;
    margin: 0 !important;
    line-height: 1 !important;
    z-index: 2 !important;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3) !important;
}

/* Push add-to-cart to bottom of card */
.home .wc-block-grid__product-add-to-cart,
.archive .product .ct-woo-card-extra,
.related .product .ct-woo-card-extra,
.upsells .product .ct-woo-card-extra,
[data-products] .product .ct-woo-card-extra {
    margin-top: auto !important;
}

/* Buttons in Loop */
.home .wc-block-grid__product-add-to-cart .wp-block-button__link,
.archive .product .button,
.related .product .button {
    width: 100% !important;
    border-radius: 8px !important;
    padding: 10px 15px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 12px !important;
    letter-spacing: 0.5px !important;
    transition: all 0.2s ease !important;
}


/* Product grid: 2 columns on mobile */
@media (max-width: 768px) {
    .home .wc-block-grid.has-4-columns .wc-block-grid__product {
        flex: 1 0 50% !important;
        max-width: 50% !important;
    }
}

/* ==========================================================================
   Elementor icon guardrail
   Prevent oversized inline SVG icons (e.g. WhatsApp CTA icon in shop footer)
   ========================================================================== */
.elementor-button .elementor-button-icon .e-font-icon-svg {
    width: 1em !important;
    height: 1em !important;
    min-width: 1em;
    max-width: 1em;
    display: inline-block;
    vertical-align: middle;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.mg-footer {
    background: #1a1a2e;
    color: #d1d1d6;
    padding: 60px 24px 0;
    font-size: 14px;
    line-height: 1.7;
}
.mg-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}
.mg-footer__logo {
    max-height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}
.mg-footer__site-name {
    font-size: 18px;
    color: #fff;
}
.mg-footer__logo-wrap {
    margin-bottom: 12px;
}
.mg-footer__brand {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
    letter-spacing: 0.3px;
}
.mg-footer__desc {
    color: #a0a0aa;
    margin: 0 0 16px;
    font-size: 13px;
}
.mg-footer__social {
    display: flex;
    gap: 12px;
}
.mg-footer__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #d1d1d6;
    transition: background 0.2s, color 0.2s;
}
.mg-footer__social a:hover {
    background: #490D78;
    color: #fff;
}
.mg-footer__heading {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mg-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mg-footer__links li {
    margin-bottom: 8px;
}
.mg-footer__links a {
    color: #a0a0aa;
    text-decoration: none;
    transition: color 0.2s;
}
.mg-footer__links a:hover {
    color: #d69942;
}
.mg-footer__contact {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mg-footer__contact li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    color: #a0a0aa;
}
.mg-footer__contact li svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #d69942;
}
.mg-footer__contact a {
    color: #a0a0aa;
    text-decoration: none;
}
.mg-footer__contact a:hover {
    color: #d69942;
}
.mg-footer__payment {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.mg-footer__badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    color: #d1d1d6;
    font-size: 12px;
    font-weight: 600;
}
.mg-footer__badge--webpay {
    background: #fff;
    padding: 4px 10px;
}
.mg-footer__badge--webpay img {
    height: 22px;
    width: auto;
    display: block;
}
.mg-footer__badge--retail {
    background: #fff;
    padding: 4px 10px;
}
.mg-footer__badge--retail img {
    height: 20px;
    width: auto;
    display: block;
}
.mg-footer__secure {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #8bc34a;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 16px;
}
.mg-footer__bottom {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #d6dae6;
}
.mg-footer__bottom-links {
    display: flex;
    gap: 20px;
}
.mg-footer__bottom-links a {
    color: #d6dae6;
    text-decoration: none;
}
.mg-footer__bottom-links a:hover {
    color: #d69942;
}

@media (max-width: 768px) {
    .mg-footer__inner {
        grid-template-columns: 1fr 1fr;
        gap: 24px 16px;
    }
    /* Brand (col 1) and Payment (col 4) span full width */
    .mg-footer__col:first-child,
    .mg-footer__col:last-child {
        grid-column: 1 / -1;
        text-align: center;
    }
    /* Nav and Contact: left-aligned side by side */
    .mg-footer__col:nth-child(2),
    .mg-footer__col:nth-child(3) {
        text-align: left;
    }
    .mg-footer__contact li {
        justify-content: flex-start;
    }
    .mg-footer__payment {
        justify-content: center;
    }
    .mg-footer__secure {
        justify-content: center;
    }
    .mg-footer__bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding-bottom: 24px;
    }
    .mg-footer__bottom-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px 20px;
    }
}
@media (max-width: 480px) {
    .mg-footer__inner {
        grid-template-columns: 1fr 1fr;
        gap: 20px 12px;
    }
    .mg-footer__heading {
        font-size: 13px;
    }
    .mg-footer__links a,
    .mg-footer__contact li {
        font-size: 12px;
    }
}

/* ==========================================================================
   Micro-interactions & General Refinements
   ========================================================================== */

/* Button hover effects */
.button,
.wp-block-button__link,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce a.button,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce button.button {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
}

.button:hover,
.wp-block-button__link:hover,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce a.button:hover,
body:is(.single-product, .post-type-archive-product, .tax-product_cat, .woocommerce-cart, .woocommerce-checkout) .woocommerce button.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(82, 4, 125, 0.2);
}

/* Smooth scroll for the whole page */
html {
    scroll-behavior: smooth;
}

/* Breadcrumbs styling */
.woocommerce-breadcrumb {
    font-size: 13px;
    margin-bottom: 20px;
    color: #888;
}
.woocommerce-breadcrumb a {
    color: var(--theme-palette-color-1);
    text-decoration: none;
    transition: color 0.2s;
}
.woocommerce-breadcrumb a:hover {
    color: var(--theme-palette-color-3);
}

/* Forms refinement */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
textarea,
select {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 44px !important;
    overflow: visible !important;
    text-overflow: ellipsis !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--theme-palette-color-1) !important;
    box-shadow: 0 0 0 3px rgba(82, 4, 125, 0.1) !important;
    outline: none !important;
}

/* ==========================================================================
   Pagination & Empty States
   ========================================================================== */

/* WooCommerce Pagination */
.woocommerce-pagination {
    margin: 40px 0 !important;
}
.woocommerce-pagination ul {
    border: none !important;
    display: flex !important;
    justify-content: center !important;
    gap: 10px !important;
}
.woocommerce-pagination ul li {
    border: none !important;
    margin: 0 !important;
}
.woocommerce-pagination ul li .page-numbers {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 8px !important;
    background: #f8f6fb !important;
    color: var(--theme-palette-color-1) !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
    border: 1px solid rgba(82, 4, 125, 0.05) !important;
}
.woocommerce-pagination ul li .page-numbers:hover {
    background: var(--theme-palette-color-1) !important;
    color: #fff !important;
}
.woocommerce-pagination ul li .page-numbers.current {
    background: var(--theme-palette-color-1) !important;
    color: #fff !important;
}

/* Empty State / Info messages */
.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
    border: none !important;
    border-left: 3px solid var(--theme-palette-color-1) !important;
    background: #f8f6fb !important;
    border-radius: 8px !important;
    padding: 16px 20px 16px 50px !important;
    color: var(--theme-palette-color-4) !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
    font-size: 14px !important;
}
.woocommerce-error {
    border-left-color: #dc3545 !important;
    background: #fff5f5 !important;
}

.woocommerce-info::before {
    color: var(--theme-palette-color-1) !important;
}

/* ==========================================================================
   Premium UI Enhancements (Modern & "Alive" Feel)
   ========================================================================== */

/* 1. Global Branding Details */

/* Override yellow highlights/marks to brand purple */
mark,
.has-luminous-vivid-amber-background-color,
.wp-block-heading mark {
    background: none !important;
    color: var(--mg-purple, #490D78) !important;
}

::selection {
    background: var(--theme-palette-color-1);
    color: #fff;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 5px;
    border: 2px solid #f1f1f1;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--theme-palette-color-1);
}

/* 6. Footer Newsletter / Input Polish */
.mg-footer input[type="email"] {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: #fff !important;
}

.mg-footer input[type="email"]:focus {
    background: rgba(255,255,255,0.1) !important;
    border-color: var(--theme-palette-color-3) !important;
}

/* ==========================================================================
   Wishlist page: hide comments
   ========================================================================== */
.page-id-360 #comments,
.page-id-360 .comments-area,
.page-id-360 #respond {
    display: none !important;
}

/* ==========================================================================
   Category Pills — shared base styles (used on home, shop, search)
   ========================================================================== */
.mg-cat-pills__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 4px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mg-cat-pills__inner::-webkit-scrollbar {
    display: none;
}

.mg-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    color: #333;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid rgba(82, 4, 125, 0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.mg-pill:hover {
    background: var(--theme-palette-color-1, #490D78);
    color: #fff;
    border-color: var(--theme-palette-color-1, #490D78);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(82, 4, 125, 0.2);
}

.mg-pill--active {
    background: var(--mg-purple, #490D78) !important;
    color: #fff !important;
    border-color: var(--mg-purple, #490D78) !important;
}

.mg-pill--shop {
    background: #fff;
    color: #333;
    border-color: rgba(82, 4, 125, 0.1);
}

.mg-pill--shop:hover {
    background: var(--theme-palette-color-1, #490D78);
    color: #fff;
    border-color: var(--theme-palette-color-1, #490D78);
}

@media (max-width: 768px) {
    .mg-cat-pills__inner {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        padding: 0 12px;
        overflow-x: visible;
    }
    .mg-pill {
        font-size: 12px;
        padding: 6px 12px;
    }
}
