/* ==========================================================================
   Shop archive native contact CTA (replaces Elementor section data-id=0be1edf)
   ========================================================================== */
body.post-type-archive-product .elementor-element[data-id="0be1edf"],
body.tax-product_cat .elementor-element[data-id="0be1edf"] {
    display: none !important;
}

.mg-shop-contact-native {
    margin-top: 24px;
    margin-bottom: 8px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 20px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(120deg, #2f0a49 0%, #490D78 55%, #7931a9 100%);
    color: #fff;
    box-shadow: 0 14px 28px rgba(50, 8, 78, 0.22);
}

.mg-shop-contact-native__content {
    padding: 30px 34px;
}

.mg-shop-contact-native__content h2 {
    margin: 0 0 10px;
    font-size: 28px;
    line-height: 1.15;
    color: #fff;
}

.mg-shop-contact-native__content p {
    margin: 0 0 18px;
    color: rgba(255, 255, 255, 0.92);
}

.mg-shop-contact-native__button {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 999px;
    background: #25d366;
    color: #0f301f;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-decoration: none;
}

.mg-shop-contact-native__button:hover {
    background: #1db455;
    color: #082011;
}

.mg-shop-contact-native__media {
    align-self: stretch;
}

.mg-shop-contact-native__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 220px;
}

@media (max-width: 1024px) {
    .mg-shop-contact-native {
        display: none;
    }
}


/* ==========================================================================
   Shop Archive: Blocksy-native product grid & FILTERS
   ========================================================================== */

/* Force 4 columns on desktop (override Blocksy default of 3) */
[data-products] {
    --shop-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
}

@media (max-width: 1200px) {
    [data-products] { --shop-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 768px) {
    [data-products] {
        --shop-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
}

/* Override Blocksy inline CSS that forces 1 column on small mobile */
@media (max-width: 689.98px) {
    [data-products] {
        --shop-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* --- SHOP FILTERS OVERHAUL (YITH & Blocksy) --- */
.ct-sidebar, .yith-wcan-filters {
    background: #fff !important;
    border-radius: 12px !important;
}

/* Filter Widget Titles */
.ct-sidebar .widget-title,
.yith-wcan-filters .filter-title {
    font-size: 15px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: var(--theme-palette-color-4) !important;
    border-bottom: 2px solid var(--theme-palette-color-1) !important;
    padding-bottom: 10px !important;
    margin-bottom: 20px !important;
    display: block !important;
}

/* Remove any pseudo-element pipe/decoration from filter titles */
.yith-wcan-filters .filter-title::after,
.yith-wcan-filters .filter-title.collapsable::after,
.yith-wcan-filters .yith-wcan-filter .filter-title::after,
.yith-wcan-filters .yith-wcan-filter .filter-title.collapsable::after {
    display: none !important;
    content: none !important;
}

/* Filter Lists (Checkboxes/Labels) */
.ct-sidebar ul, .yith-wcan-filters ul {
    list-style: none !important;
    padding: 0 !important;
}

.ct-sidebar ul li, .yith-wcan-filters ul li {
    padding: 8px 0 !important;
    border-bottom: 1px solid rgba(0,0,0,0.03) !important;
    display: flex !important;
    align-items: center !important;
    font-size: 14px !important;
    color: #555 !important;
    transition: all 0.2s ease !important;
}

.ct-sidebar ul li:hover, .yith-wcan-filters ul li:hover {
    padding-left: 5px !important;
    color: var(--theme-palette-color-1) !important;
}

/* Custom Checkbox Style (CSS only) */
.yith-wcan-filters li a::before, 
.widget_rating_filter li a::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    margin-right: 10px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.yith-wcan-filters li.chosen a::before {
    background: var(--theme-palette-color-1);
    border-color: var(--theme-palette-color-1);
    box-shadow: inset 0 0 0 3px #fff;
}

/* Range Filter */
.widget_price_filter .ui-slider-range {
    background-color: var(--theme-palette-color-1) !important;
}
.widget_price_filter .ui-slider-handle {
    background-color: #fff !important;
    border: 2px solid var(--theme-palette-color-1) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
}

/* Off-canvas Filter (Mobile) */
.ct-offcanvas-content {
    padding: 30px 20px !important;
}


/* --- MOBILE GLOBAL RESETS --- */
@media (max-width: 768px) {
    /* Kill excessive vertical space */
    :root {
        --theme-content-vertical-spacing: 25px !important;
    }

    /* Standardize Container Padding */
    .ct-container, .entry-content > * {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Mobile Typography Fixes — scoped to WooCommerce pages */
    .woocommerce h1, .woocommerce-page h1 { font-size: 24px !important; line-height: 1.2 !important; font-weight: 800 !important; }
    .woocommerce h2, .woocommerce-page h2 { font-size: 20px !important; line-height: 1.3 !important; font-weight: 700 !important; }
    .woocommerce h3, .woocommerce-page h3 { font-size: 17px !important; }
    .woocommerce p, .woocommerce-page p { font-size: 14px !important; line-height: 1.6 !important; }

    /* Product Grid specifically for Shop */
    .archive .product-inner {
        padding: 8px !important;
        border-radius: 10px !important;
    }
    
    .archive .woocommerce-loop-product__title {
        font-size: 13px !important;
        min-height: 3.9em !important;
        line-height: 1.3 !important;
        -webkit-line-clamp: 3 !important;
    }

    .archive .price {
        font-size: 15px !important;
        margin-bottom: 8px !important;
    }

    .archive .product .button {
        padding: 8px 10px !important;
        font-size: 11px !important;
        border-radius: 6px !important;
    }

    /* Footer Mobile: 2-column layout for nav+contact */
    .mg-footer {
        padding: 40px 15px 20px !important;
    }
    .mg-footer__inner {
        grid-template-columns: 1fr 1fr !important;
        gap: 24px 16px !important;
    }
    /* Brand col spans full width */
    .mg-footer__col:first-child {
        grid-column: 1 / -1;
        text-align: center;
    }
    /* Nav (col 2) and Contact (col 3): left-aligned, side by side */
    .mg-footer__col:nth-child(2),
    .mg-footer__col:nth-child(3) {
        text-align: left;
    }
    /* Payment col spans full width */
    .mg-footer__col:last-child {
        grid-column: 1 / -1;
        text-align: center;
    }
    .mg-footer__social {
        justify-content: center !important;
    }
    .mg-footer__contact li {
        justify-content: flex-start !important;
    }
    .mg-footer__payment {
        justify-content: center !important;
    }
    .mg-footer__secure {
        justify-content: center !important;
    }

    /* Add-to-cart layout moved to mg-single-product-layout.css */
}


.mg-cat-pills {
    padding: 15px 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Category pills on shop/archive pages */
.mg-cat-pills--shop {
    margin-bottom: 20px;
}
.mg-pill--active {
    background: var(--mg-purple, #490D78) !important;
    color: #fff !important;
    border-color: var(--mg-purple, #490D78) !important;
}

/* --- SHOP PAGE TITLE & SORTING BAR --- */
.woocommerce-products-header {
    margin-bottom: 30px !important;
    padding: 40px 0 !important;
    background: #f8f6fb !important;
    text-align: center !important;
    border-radius: 0 0 30px 30px !important;
}

.woo-listing-top {
    background: #fff !important;
    padding: 15px 20px !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03) !important;
    margin-bottom: 25px !important;
}

.woocommerce-result-count {
    font-size: 14px !important;
    color: #888 !important;
}

.woocommerce-ordering select {
    border: none !important;
    font-weight: 600 !important;
    background: #f8f6fb !important;
    padding: 8px 15px !important;
}


/* ==========================================================================
   Search Results Page — hide duplicate WC header & empty grey block
   ========================================================================== */

/* Empty WC products header creates a grey block — collapse it */
body.search .woocommerce-products-header {
    display: none !important;
}

/* Search hero: compact, styled like shop archives */
body.search .hero-section[data-type="type-2"] {
    --container-padding: clamp(8px, 1.4vw, 14px) 0 !important;
    --min-height: 96px !important;
    background: linear-gradient(180deg, #f3eef9 0%, #f8f6fb 100%) !important;
    border-bottom: 1px solid rgba(82, 4, 125, 0.08) !important;
    margin-bottom: 0 !important;
}

body.search .hero-section .page-title {
    font-size: clamp(20px, 3vw, 28px) !important;
    font-weight: 700 !important;
    color: var(--theme-palette-color-4, #1a1a2e) !important;
}

/* Search page pills spacing */
body.search .mg-cat-pills--shop {
    margin-bottom: 20px;
    padding: 15px 0;
}

/* ==========================================================================
   Shop Archive Refresh — Visual hierarchy, filters, cards, mobile UX
   ========================================================================== */

/* 1) Header compacto + remoción de placeholders vacíos */
.hero-section .term-description,
.hero-section .entry-meta {
    display: none !important;
}

body.post-type-archive-product .hero-section[data-type="type-2"],
body.tax-product_cat .hero-section[data-type="type-2"],
body.tax-product_tag .hero-section[data-type="type-2"] {
    --container-padding: clamp(8px, 1.4vw, 14px) 0 !important;
    --min-height: 96px !important;
    background: linear-gradient(180deg, #f3eef9 0%, #f8f6fb 100%) !important;
    border-bottom: 1px solid rgba(82, 4, 125, 0.08) !important;
    margin-bottom: 0 !important;
}

body.post-type-archive-product .hero-section[data-type="type-2"] > [class*="ct-container"],
body.tax-product_cat .hero-section[data-type="type-2"] > [class*="ct-container"],
body.tax-product_tag .hero-section[data-type="type-2"] > [class*="ct-container"] {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

body.post-type-archive-product .hero-section .page-title,
body.tax-product_cat .hero-section .page-title,
body.tax-product_tag .hero-section .page-title {
    font-size: clamp(36px, 3vw, 48px) !important;
    line-height: 1.05 !important;
    letter-spacing: -0.02em !important;
    margin: 0 !important;
}

body.post-type-archive-product .woocommerce-products-header:empty,
body.tax-product_cat .woocommerce-products-header:empty,
body.tax-product_tag .woocommerce-products-header:empty {
    display: none !important;
}

/* 2) Jerarquía limpia: breadcrumb + título + barra de resultados */
body.post-type-archive-product .ct-container[data-sidebar="left"] > section,
body.tax-product_cat .ct-container[data-sidebar="left"] > section,
body.tax-product_tag .ct-container[data-sidebar="left"] > section {
    max-width: 100%;
}

body.post-type-archive-product .woocommerce-breadcrumb,
body.tax-product_cat .woocommerce-breadcrumb,
body.tax-product_tag .woocommerce-breadcrumb {
    margin: 4px 0 10px !important;
    font-size: 12px !important;
    color: #6f6680 !important;
}

body.post-type-archive-product .woo-listing-top,
body.tax-product_cat .woo-listing-top,
body.tax-product_tag .woo-listing-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    border: 1px solid #eee7f7 !important;
    box-shadow: 0 10px 24px rgba(32, 10, 52, 0.05) !important;
    padding: 12px 16px !important;
    margin-bottom: 12px !important;
}

body.post-type-archive-product .ct-container[data-sidebar="left"][data-vertical-spacing],
body.tax-product_cat .ct-container[data-sidebar="left"][data-vertical-spacing],
body.tax-product_tag .ct-container[data-sidebar="left"][data-vertical-spacing] {
    padding-top: 14px !important;
}

body.post-type-archive-product .woo-listing-top .woocommerce-result-count,
body.tax-product_cat .woo-listing-top .woocommerce-result-count,
body.tax-product_tag .woo-listing-top .woocommerce-result-count {
    margin: 0 !important;
    font-size: 12px !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    color: #5d4b76 !important;
}

body.post-type-archive-product .woo-listing-top .woocommerce-ordering,
body.tax-product_cat .woo-listing-top .woocommerce-ordering,
body.tax-product_tag .woo-listing-top .woocommerce-ordering {
    margin: 0 !important;
}

body.post-type-archive-product .woo-listing-top .woocommerce-ordering select,
body.tax-product_cat .woo-listing-top .woocommerce-ordering select,
body.tax-product_tag .woo-listing-top .woocommerce-ordering select {
    border: 1px solid #e6def1 !important;
    border-radius: 8px !important;
    background: #f7f3fc !important;
    color: #39224f !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 10px 14px !important;
    min-width: 236px !important;
}

/* 3) Chips de filtros activos */
.mg-shop-active-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 24px;
}

.mg-shop-active-filters[hidden] {
    display: none;
}

.mg-shop-active-filters__label {
    font-size: 12px;
    font-weight: 700;
    color: #726083;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.mg-active-filter-chip,
.mg-active-filter-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e5daef;
    border-radius: 999px;
    background: #fbf8fe;
    color: #4a3860;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    padding: 7px 12px;
    box-shadow: 0 8px 18px rgba(40, 15, 63, 0.04);
}

.mg-active-filter-chip:hover,
.mg-active-filter-clear:hover {
    color: #2e2140;
    border-color: #cfbee1;
    background: #f6f0fc;
}

.mg-active-filter-clear {
    margin-left: 2px;
    background: #efe7f8;
    border-color: #dccdea;
}

/* 4) Sidebar filtros — narrower + clean minimal design */
body.post-type-archive-product .ct-container[data-sidebar],
body.tax-product_cat .ct-container[data-sidebar],
body.tax-product_tag .ct-container[data-sidebar] {
    --sidebar-width: 220px;
}

body.post-type-archive-product #sidebar .ct-sidebar,
body.tax-product_cat #sidebar .ct-sidebar,
body.tax-product_tag #sidebar .ct-sidebar {
    position: sticky;
    top: 112px;
    background: #fff;
    border: 1px solid #eae5ef;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border-radius: 14px !important;
    padding: 6px 0 0;
}

body.post-type-archive-product #sidebar .ct-sidebar {
    position: static;
    top: auto;
}

body.post-type-archive-product #sidebar .widget-title,
body.tax-product_cat #sidebar .widget-title,
body.tax-product_tag #sidebar .widget-title,
body.post-type-archive-product #sidebar .filter-title,
body.tax-product_cat #sidebar .filter-title,
body.tax-product_tag #sidebar .filter-title {
    position: relative;
    margin: 0 0 0 !important;
    padding: 14px 18px !important;
    border-bottom: 1px solid #f0ecf3 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
    color: #2d1c44 !important;
}

body.post-type-archive-product #sidebar .widget-title::after,
body.tax-product_cat #sidebar .widget-title::after,
body.tax-product_tag #sidebar .widget-title::after,
body.post-type-archive-product #sidebar .filter-title::after,
body.tax-product_cat #sidebar .filter-title::after,
body.tax-product_tag #sidebar .filter-title::after {
    display: none;
}

.yith-wcan-filters .yith-wcan-filter {
    border-bottom: 1px solid #f0ecf3;
    padding: 0;
}

.yith-wcan-filters .yith-wcan-filter:last-child {
    border-bottom: 0;
}

.yith-wcan-filters .filter-content {
    padding: 4px 0 8px;
}

.yith-wcan-filters .show-more {
    display: inline-block;
    padding: 6px 18px 10px;
    font-size: 12px;
    color: #8a7a9e;
    cursor: pointer;
}

.yith-wcan-filters .filter-item {
    line-height: 1.4 !important;
    padding: 0 !important;
    border-bottom: 0 !important;
    color: inherit !important;
}

.yith-wcan-filters .filter-item.mg-zero-count {
    display: none !important;
}

/* Injected active filter items (re-added when YITH removes them) */
.yith-wcan-filters .filter-item.mg-injected-active > label {
    font-weight: 600;
}
.yith-wcan-filters .filter-item.mg-injected-active input[type="checkbox"] {
    accent-color: var(--mg-purple, #490D78);
}

/* Reorder: Categorías before Marcas */
.yith-wcan-filters .filters-container > form {
    display: flex;
    flex-direction: column;
}
.yith-wcan-filter.filter-price-range {
    order: 1;
}
.yith-wcan-filter[data-taxonomy="product_cat"],
.yith-wcan-filter.mg-injected-section[data-taxonomy="product_cat"] {
    order: 2;
}
.yith-wcan-filter[data-taxonomy="product_brand"] {
    order: 3;
}

.yith-wcan-filters .filter-item:hover {
    padding-left: 0 !important;
    color: inherit !important;
}

.yith-wcan-filters .filter-item + .filter-item {
    margin-top: 0;
}

.yith-wcan-filters .filter-item > label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 8px 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s ease;
}

.yith-wcan-filters .filter-item > label:hover {
    background: #f9f7fb;
}

.yith-wcan-filters .filter-item > label input {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    margin: 0 !important;
    flex-shrink: 0;
    border: 1.5px solid #c4b8d2;
    background: #fff;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.yith-wcan-filters .filter-item > label input[type="radio"] {
    border-radius: 50%;
}

.yith-wcan-filters .filter-item > label input[type="checkbox"] {
    border-radius: 4px;
}

.yith-wcan-filters .filter-item > label input:checked {
    border-color: #490D78;
    background: #490D78;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 7l3 3 5-5' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.yith-wcan-filters .filter-item .term-label {
    min-width: 0;
    flex: 1;
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #3a3048 !important;
    text-decoration: none !important;
}

.yith-wcan-filters .filter-item > label input:checked + .term-label {
    color: #2d1c44 !important;
    font-weight: 600 !important;
}

.yith-wcan-filters .filter-item .item-count {
    margin-left: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #a89bb8 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.35;
    white-space: nowrap;
}

.yith-wcan-filters .filter-item > label input:checked + .term-label .item-count {
    background: transparent;
    color: #7c6a8f !important;
}

.mg-filter-trigger {
    width: 100%;
    border: 0;
    background: transparent;
    color: #2d1c44;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.mg-filter-trigger:hover {
    color: #490D78;
}

.mg-filter-trigger__icon {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid #8a7a9e;
    border-bottom: 1.5px solid #8a7a9e;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.yith-wcan-filter.is-collapsed .mg-filter-trigger__icon {
    transform: rotate(-45deg) translate(-1px, 1px);
}

.yith-wcan-filter.is-collapsed .filter-content {
    display: none;
}

.mg-filter-search-wrap {
    position: relative;
    margin: 0 14px 8px;
}

.mg-filter-search-wrap::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    width: 10px;
    height: 10px;
    border: 1.5px solid #b0a3c0;
    border-radius: 50%;
    transform: translateY(-60%);
    pointer-events: none;
}

.mg-filter-search-wrap::after {
    content: "";
    position: absolute;
    left: 19px;
    top: calc(50% + 4px);
    width: 5px;
    height: 1.5px;
    border-radius: 999px;
    background: #b0a3c0;
    transform: rotate(45deg);
    pointer-events: none;
}

.mg-filter-search {
    width: 100%;
    border: 1px solid #e8e2ef !important;
    border-radius: 8px !important;
    padding: 8px 10px 8px 32px !important;
    font-size: 12.5px !important;
    background: #faf8fc !important;
    color: #3f3750;
    box-sizing: border-box;
}

.mg-filter-search:focus {
    outline: none;
    border-color: #490D78;
    background: #fff;
}

.yith-wcan-filter.mg-filter-search-ready ul.filter-items {
    max-height: min(34vh, 320px);
    overflow-y: auto;
    padding-right: 4px !important;
}

.yith-wcan-filter.mg-filter-search-ready ul.filter-items::-webkit-scrollbar {
    width: 6px;
}

.yith-wcan-filter.mg-filter-search-ready ul.filter-items::-webkit-scrollbar-thumb {
    background: #d4c4e4;
    border-radius: 999px;
}

.yith-wcan-filters .filter-price-range select.filter-items {
    width: calc(100% - 36px);
    margin: 0 18px;
    min-height: 40px;
    border: 1px solid #e8e2ef;
    border-radius: 8px;
    background: #faf8fc;
    color: #3a3048;
    font-size: 13px;
    font-weight: 500;
    padding: 9px 36px 9px 12px;
}

.yith-wcan-filters .filter-price-range select.filter-items:focus {
    outline: none;
    border-color: #9d78c3;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(82, 4, 125, 0.08);
}

/* 5) Tarjetas de producto consistentes */
body.post-type-archive-product ul.products li.product,
body.tax-product_cat ul.products li.product,
body.tax-product_tag ul.products li.product {
    border: 1px solid #ece6f5 !important;
    border-radius: 14px !important;
    padding: 14px 14px 16px !important;
    background: #fff !important;
    box-shadow: 0 7px 20px rgba(26, 12, 38, 0.04) !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    gap: 0 !important;
}

body.post-type-archive-product ul.products li.product:hover,
body.tax-product_cat ul.products li.product:hover,
body.tax-product_tag ul.products li.product:hover {
    transform: translateY(-4px) !important;
    border-color: #dcc9ef !important;
    box-shadow: 0 16px 28px rgba(35, 10, 58, 0.1) !important;
}

body.post-type-archive-product ul.products li.product figure,
body.tax-product_cat ul.products li.product figure,
body.tax-product_tag ul.products li.product figure {
    min-height: 176px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 10px !important;
}

body.post-type-archive-product ul.products li.product .ct-media-container,
body.tax-product_cat ul.products li.product .ct-media-container,
body.tax-product_tag ul.products li.product .ct-media-container {
    width: 100%;
    min-height: 176px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fbfbfd;
    border-radius: 10px;
    overflow: hidden;
}

body.post-type-archive-product ul.products li.product .ct-media-container img,
body.tax-product_cat ul.products li.product .ct-media-container img,
body.tax-product_tag ul.products li.product .ct-media-container img {
    width: 100% !important;
    max-height: 172px;
    object-fit: contain !important;
}

body.post-type-archive-product ul.products li.product .woocommerce-loop-product__title,
body.tax-product_cat ul.products li.product .woocommerce-loop-product__title,
body.tax-product_tag ul.products li.product .woocommerce-loop-product__title {
    margin: 0 0 10px !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    color: #201a2a !important;
    min-height: 3.75em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.post-type-archive-product ul.products li.product .price,
body.tax-product_cat ul.products li.product .price,
body.tax-product_tag ul.products li.product .price {
    margin: 0 0 8px !important;
    min-height: 48px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.15;
}

body.post-type-archive-product ul.products li.product .price .amount,
body.tax-product_cat ul.products li.product .price .amount,
body.tax-product_tag ul.products li.product .price .amount {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #2b1842 !important;
}

body.post-type-archive-product ul.products li.product .price del .amount,
body.tax-product_cat ul.products li.product .price del .amount,
body.tax-product_tag ul.products li.product .price del .amount {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #8b8498 !important;
}

body.post-type-archive-product ul.products li.product .entry-meta,
body.tax-product_cat ul.products li.product .entry-meta,
body.tax-product_tag ul.products li.product .entry-meta {
    margin: 0 0 10px !important;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.post-type-archive-product ul.products li.product .entry-meta a,
body.tax-product_cat ul.products li.product .entry-meta a,
body.tax-product_tag ul.products li.product .entry-meta a {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    color: #786585 !important;
    line-height: 1.35 !important;
}

body.post-type-archive-product ul.products li.product .ct-woo-card-actions,
body.tax-product_cat ul.products li.product .ct-woo-card-actions,
body.tax-product_tag ul.products li.product .ct-woo-card-actions {
    margin-top: auto !important;
}

/* 6) Estados de botón más claros */
body.post-type-archive-product ul.products li.product .button,
body.tax-product_cat ul.products li.product .button,
body.tax-product_tag ul.products li.product .button {
    min-height: 44px !important;
    width: 100% !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    padding: 10px 12px !important;
}

body.post-type-archive-product ul.products li.product .button.product_type_simple,
body.tax-product_cat ul.products li.product .button.product_type_simple,
body.tax-product_tag ul.products li.product .button.product_type_simple {
    background: #490D78 !important;
    color: #fff !important;
}

body.post-type-archive-product ul.products li.product .button.product_type_variable,
body.tax-product_cat ul.products li.product .button.product_type_variable,
body.tax-product_tag ul.products li.product .button.product_type_variable {
    background: transparent !important;
    color: #490D78 !important;
    border: 2px solid #490D78 !important;
}

body.post-type-archive-product ul.products li.product .button.product_type_variable:hover,
body.tax-product_cat ul.products li.product .button.product_type_variable:hover,
body.tax-product_tag ul.products li.product .button.product_type_variable:hover {
    background: #490D78 !important;
    color: #fff !important;
}

body.post-type-archive-product ul.products li.product.outofstock .button,
body.tax-product_cat ul.products li.product.outofstock .button,
body.tax-product_tag ul.products li.product.outofstock .button {
    background: #bbb8c2 !important;
    color: #fff !important;
    border: 0 !important;
    pointer-events: none;
}

/* 7) Badge de oferta uniforme + descuento */
[data-products] .onsale {
    min-height: 26px;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 11px !important;
}

[data-products] .onsale .mg-sale-percent {
    font-size: 10px;
    font-weight: 800;
    opacity: 0.95;
}

/* 8) Paginación más visible */
body.post-type-archive-product .ct-pagination,
body.tax-product_cat .ct-pagination,
body.tax-product_tag .ct-pagination {
    margin-top: 28px !important;
    margin-bottom: 12px !important;
    padding: 10px 12px !important;
    border: 1px solid #e5dbf2 !important;
    border-radius: 12px !important;
    background: #fff !important;
}

body.post-type-archive-product .ct-pagination .page-numbers,
body.tax-product_cat .ct-pagination .page-numbers,
body.tax-product_tag .ct-pagination .page-numbers {
    min-width: 38px;
    min-height: 38px;
    border-radius: 8px !important;
    border: 1px solid transparent;
    font-size: 14px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    color: #4d3b67 !important;
}

body.post-type-archive-product .ct-pagination .page-numbers:hover,
body.tax-product_cat .ct-pagination .page-numbers:hover,
body.tax-product_tag .ct-pagination .page-numbers:hover {
    border-color: #d7cae8;
    background: #f8f4fd !important;
}

body.post-type-archive-product .ct-pagination .page-numbers.current,
body.tax-product_cat .ct-pagination .page-numbers.current,
body.tax-product_tag .ct-pagination .page-numbers.current {
    background: #490D78 !important;
    color: #fff !important;
    border-color: #490D78 !important;
}

/* 9) CTA final con más aire */
.mg-shop-contact-native {
    margin-top: 40px !important;
    margin-bottom: 28px !important;
}

/* 10) Móvil: barra sticky Filtros / Ordenar + drawer */
.mg-shop-mobile-actions,
.mg-shop-drawer {
    display: none;
}

@media (max-width: 999px) {
    body.post-type-archive-product .woo-listing-top,
    body.tax-product_cat .woo-listing-top,
    body.tax-product_tag .woo-listing-top {
        flex-wrap: wrap !important;
        padding: 12px !important;
    }

    body.post-type-archive-product .woo-listing-top .woocommerce-ordering,
    body.tax-product_cat .woo-listing-top .woocommerce-ordering,
    body.tax-product_tag .woo-listing-top .woocommerce-ordering {
        width: 100%;
    }

    body.post-type-archive-product .woo-listing-top .woocommerce-ordering select,
    body.tax-product_cat .woo-listing-top .woocommerce-ordering select,
    body.tax-product_tag .woo-listing-top .woocommerce-ordering select {
        width: 100%;
        min-width: 0 !important;
    }

    body.post-type-archive-product ul.products li.product,
    body.tax-product_cat ul.products li.product,
    body.tax-product_tag ul.products li.product {
        padding: 10px 10px 12px !important;
    }

    body.post-type-archive-product ul.products li.product figure,
    body.tax-product_cat ul.products li.product figure,
    body.tax-product_tag ul.products li.product figure,
    body.post-type-archive-product ul.products li.product .ct-media-container,
    body.tax-product_cat ul.products li.product .ct-media-container,
    body.tax-product_tag ul.products li.product .ct-media-container {
        min-height: 130px;
    }

    body.post-type-archive-product ul.products li.product .ct-media-container img,
    body.tax-product_cat ul.products li.product .ct-media-container img,
    body.tax-product_tag ul.products li.product .ct-media-container img {
        max-height: 126px;
    }

    body.post-type-archive-product ul.products li.product .woocommerce-loop-product__title,
    body.tax-product_cat ul.products li.product .woocommerce-loop-product__title,
    body.tax-product_tag ul.products li.product .woocommerce-loop-product__title {
        font-size: 15px !important;
        min-height: 3.9em;
    }

    body.post-type-archive-product ul.products li.product .price .amount,
    body.tax-product_cat ul.products li.product .price .amount,
    body.tax-product_tag ul.products li.product .price .amount {
        font-size: 18px !important;
    }

    body.post-type-archive-product .ct-container[data-sidebar="left"],
    body.tax-product_cat .ct-container[data-sidebar="left"],
    body.tax-product_tag .ct-container[data-sidebar="left"] {
        padding-bottom: 84px;
    }

    .mg-shop-mobile-actions {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 9999;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(12px);
        border: 1px solid rgba(230, 223, 241, 0.95);
        border-radius: 18px;
        box-shadow: 0 18px 28px rgba(34, 10, 55, 0.18);
        padding: 10px;
    }

    .mg-shop-mobile-actions__btn {
        min-height: 48px;
        border: 0;
        border-radius: 14px;
        background: #490D78;
        color: #fff;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        box-shadow: 0 12px 20px rgba(73, 13, 120, 0.18);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mg-shop-mobile-actions__btn:last-child {
        background: #f4eefb;
        color: #41295b;
        box-shadow: none;
    }

    .mg-shop-drawer {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 10000;
        pointer-events: none;
    }

    .mg-shop-drawer__overlay {
        position: absolute;
        inset: 0;
        background: rgba(17, 8, 28, 0.45);
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .mg-shop-drawer__panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 86vh;
        background: #fff;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
        transition: transform 0.24s ease;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .mg-shop-drawer__panel::before {
        content: "";
        width: 48px;
        height: 5px;
        border-radius: 999px;
        background: #dbcfe8;
        margin: 10px auto 0;
        flex-shrink: 0;
    }

    .mg-shop-drawer__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px 12px;
        border-bottom: 1px solid #efe8f8;
    }

    .mg-shop-drawer__title {
        margin: 0;
        font-size: 18px;
        font-weight: 800;
        color: #2d1c44;
        letter-spacing: -0.02em;
    }

    .mg-shop-drawer__close {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        border: 0;
        background: #490D78;
        color: #fff;
        font-size: 22px;
        line-height: 1;
        box-shadow: 0 10px 18px rgba(73, 13, 120, 0.18);
    }

    .mg-shop-drawer__body {
        overflow-y: auto;
        padding: 10px 16px 8px;
        background: linear-gradient(180deg, #ffffff 0%, #fbf8fe 100%);
    }

    .mg-shop-drawer__footer {
        display: none;
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
        gap: 10px;
        padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
        border-top: 1px solid #eee5f4;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(12px);
    }

    .mg-shop-drawer__footer.is-visible {
        display: grid;
    }

    .mg-shop-drawer__footer-btn {
        min-height: 46px;
        border-radius: 14px;
        border: 1px solid #dfd1ee;
        background: #fff;
        color: #46335c;
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .mg-shop-drawer__footer-btn--primary {
        border-color: #490D78;
        background: #490D78;
        color: #fff;
        box-shadow: 0 12px 20px rgba(73, 13, 120, 0.18);
    }

    .mg-shop-drawer__footer-btn[disabled] {
        opacity: 0.45;
    }

    .mg-shop-drawer.is-open {
        pointer-events: auto;
    }

    .mg-shop-drawer.is-open .mg-shop-drawer__overlay {
        opacity: 1;
    }

    .mg-shop-drawer.is-open .mg-shop-drawer__panel {
        transform: translateY(0);
    }

    .mg-shop-drawer-open {
        overflow: hidden;
    }

    .mg-shop-drawer-open .joinchat,
    .mg-shop-drawer-open .whatsapp,
    .mg-shop-drawer-open [class*="whatsapp"] {
        pointer-events: none !important;
        opacity: 0 !important;
    }

    .mg-mobile-clone-filters .yith-wcan-filter {
        padding: 4px 0 14px;
    }

    .mg-mobile-clone-filters .filter-item > label {
        padding: 12px;
        border-color: #eee5f4;
        background: #fcfbfe;
    }

    .mg-mobile-clone-filters .yith-wcan-filter.mg-filter-search-ready ul.filter-items {
        max-height: none;
        overflow: visible;
        padding-right: 0 !important;
    }

    .mg-sort-options {
        display: grid;
        gap: 10px;
    }

    .mg-sort-option {
        border: 1px solid #e4dbf2;
        border-radius: 14px;
        background: #fff;
        color: #432c5f;
        font-size: 14px;
        font-weight: 700;
        text-align: left;
        padding: 14px 14px;
    }

    .mg-sort-option.is-selected {
        border-color: #490D78;
        background: #f3ebfe;
        color: #2b1941;
        box-shadow: 0 12px 20px rgba(73, 13, 120, 0.12);
    }

    .mg-shop-drawer-empty {
        margin: 0;
        color: #6d6080;
        font-size: 14px;
    }
}


/* ==========================================================================
   Shop mobile fixes: sorting icon, filter search, top products
   ========================================================================== */

/* Hide Blocksy's sort toggle icon on mobile (we use the drawer instead) */
.ct-sort-icon {
    display: none !important;
}

/* Filter search: add padding so text doesn't overlap magnifying glass icon */
.mg-filter-search {
    padding-left: 34px !important;
}

/* Top products in category: center on mobile */
@media (max-width: 767px) {
    .mg-il-products li.product {
        text-align: center !important;
    }

    .mg-il-products li.product .ct-media-container,
    .mg-il-products li.product figure {
        display: flex !important;
        justify-content: center !important;
    }

    .mg-il-products li.product .ct-media-container img {
        margin: 0 auto !important;
    }

    .mg-il-products li.product .woocommerce-loop-product__title {
        text-align: center !important;
    }

    .mg-il-products li.product .price {
        justify-content: center !important;
        text-align: center !important;
    }

    .mg-il-products li.product .product-categories {
        text-align: center !important;
    }

    .mg-il-products li.product .button,
    .mg-il-products li.product .add_to_cart_button {
        margin: 0 auto !important;
        display: block !important;
    }

    .mg-il-title {
        text-align: center !important;
    }
}

   Fix: Add to cart / Buy Now buttons on mobile (2026-04-05)
   ========================================================================== */
@media (max-width: 768px) {
    body.post-type-archive-product ul.products[data-products],
    body.tax-product_cat ul.products[data-products],
    body.tax-product_tag ul.products[data-products] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        align-items: stretch !important;
    }

    body.post-type-archive-product ul.products[data-products] li.product,
    body.tax-product_cat ul.products[data-products] li.product,
    body.tax-product_tag ul.products[data-products] li.product {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        min-width: 0 !important;
    }

    body.post-type-archive-product ul.products[data-products] li.product .ct-woo-card-actions,
    body.post-type-archive-product ul.products[data-products] li.product .ct-woo-card-extra,
    body.tax-product_cat ul.products[data-products] li.product .ct-woo-card-actions,
    body.tax-product_cat ul.products[data-products] li.product .ct-woo-card-extra,
    body.tax-product_tag ul.products[data-products] li.product .ct-woo-card-actions,
    body.tax-product_tag ul.products[data-products] li.product .ct-woo-card-extra {
        margin-top: auto !important;
    }

    body.post-type-archive-product ul.products[data-products] li.product .button,
    body.tax-product_cat ul.products[data-products] li.product .button,
    body.tax-product_tag ul.products[data-products] li.product .button {
        min-height: 48px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 8px 10px !important;
        font-size: 10.5px !important;
        line-height: 1.15 !important;
        letter-spacing: 0.03em !important;
        white-space: nowrap !important;
    }

