/*
Theme Name: BuenTheme
Theme URI: https://github.com/walteraguilar/buentheme
Author: Antigravity & Walter
Description: Un tema de WordPress de bloques (FSE) de alto rendimiento, ultra-ligero y modular.
Version: 2.6.101
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: buentheme
Tags: full-site-editing, block-themes, one-column, wide-blocks, translation-ready, accessibility-ready
*/

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
}
body {
    overflow-x: clip;
    width: 100%;

    /*
     * Padding lateral de PÁGINAS / main (dashboard).
     * Tokens por breakpoint; --buentheme-global-padding es el valor EFECTIVO
     * (se reasigna en media queries tablet/móvil).
     * Breakpoints alineados con grid WC: móvil ≤781 · tablet 782–1079 · desktop ≥1080.
     */
    --buentheme-global-padding: 30px; /* escritorio default md */
    --buentheme-global-padding-tablet: 15px;
    --buentheme-global-padding-mobile: 15px;

    /*
     * Padding de PLANTILLAS WC + pie (dashboard). Independiente de páginas/filas.
     * --buentheme-template-edge-padding es el valor EFECTIVO por viewport.
     */
    --buentheme-template-edge-padding: 15px; /* escritorio default sm */
    --buentheme-template-edge-padding-tablet: 15px;
    --buentheme-template-edge-padding-mobile: 15px;

    /* Alias usado por hijos WC (sigue el token efectivo de plantillas). */
    --buentheme-wc-edge-pad: var(--buentheme-template-edge-padding, 15px);

    /*
     * NO alias de content-size aquí: al definir
     *   --buentheme-content-width: var(--wp--style--global--content-size)
     * en body, el valor se RESUELVE y congela (p. ej. 1290px) y los hijos
     * heredan el px fijo, ignorando contentSize del bloque/plantilla.
     * Usar siempre var(--wp--style--global--content-size) en el punto de uso.
     */
    --buentheme-narrow-width: 720px;

    /* Space scale tokens used by buentheme-blocks for named padding/margin (SM/XS etc).
       These make var(--buentheme-space-SM) etc. resolve on frontend for row/section spacing. */
    --buentheme-space-0: 0px;
    --buentheme-space-SS: 12px;
    --buentheme-space-XS: 24px;
    --buentheme-space-SM: 40px;
    --buentheme-space-MD: 64px;
    --buentheme-space-LG: 80px;
    --buentheme-space-XL: 120px;
    --buentheme-space-XXL: 160px;
}

/*
 * Contenedor FSE: sin padding lateral root.
 * El aire L/R lo controlan content_padding (main páginas) y template_padding (WC/pie).
 * Evita doble padding con Global Styles / useRootPaddingAwareAlignments.
 */
.wp-site-blocks {
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Seguridad: el contenedor de fila NUNCA debe exceder el viewport */
.buentheme-row-container {
    box-sizing: border-box !important;
    max-width: 100%;
}

/**
 * BuenTheme Base Stylesheet Overrides
 */

/*
 * Floating stack (bottom-right):
 *  - sticky buy bar: full-width bottom
 *  - BuenChat launcher: bottom-right above sticky bar
 *  - back-to-top: above chat (or sticky bar) so nothing overlaps
 */
:root {
    --buentheme-sticky-bar-height: 0px;
    --buentheme-floating-gap: 16px;
    --buentheme-back-to-top-base: 30px;
    --buentheme-chat-slot: 0px;
}

/* Botón flotante Volver Arriba */
.wp-block-buttons.js-back-to-top {
    position: fixed;
    bottom: calc(
        var(--buentheme-back-to-top-base) +
        var(--buentheme-sticky-bar-height) +
        var(--buentheme-chat-slot)
    );
    right: 30px;
    z-index: 1000100;
    margin: 0 !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.wp-block-buttons.js-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Optimización de diseño y transiciones en botón flotante */
.wp-block-buttons.js-back-to-top .wp-block-button__link {
    width: 48px;
    height: 48px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
}

.wp-block-buttons.js-back-to-top .wp-block-button__link:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.wp-block-buttons.js-back-to-top .wp-block-button__link:focus-visible {
    outline: 3px solid var(--wp--preset--color--accent-1, #2563eb);
    outline-offset: 3px;
    transform: scale(1.05);
}

.wp-block-buttons.js-back-to-top .wp-block-button__link:active {
    transform: scale(0.95);
}

/* Slot para el launcher de BuenChat (~60px + gap) */
body:has(#buenchat-launcher),
body:has(#buenchat-container) {
    --buentheme-chat-slot: 80px;
}

/*
 * BuenChat: subir launcher, ventana y notificación cuando hay sticky buy bar.
 * z-index del chat (999999) ya queda por encima de la barra (1000).
 */
body.buentheme-sticky-bar-active #buenchat-launcher {
    bottom: calc(20px + var(--buentheme-sticky-bar-height)) !important;
    transition: bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.buentheme-sticky-bar-active #buenchat-window {
    bottom: calc(90px + var(--buentheme-sticky-bar-height)) !important;
    transition: bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s, transform 0.3s;
}

body.buentheme-sticky-bar-active .bc-notification {
    bottom: calc(90px + var(--buentheme-sticky-bar-height)) !important;
}




/* ==========================================================================
   SISTEMA DE DISEÑO DE PÁGINAS Y MAQUETACIÓN PREMIUM (KADENCE STYLE)
   ========================================================================== */

/* 1. Página Diseño (Contenedores y Anchos) */
/* Narrow: acotar main y su contenido (no el header/footer full-bleed). */
body.buentheme-layout-narrow .wp-site-blocks > main,
body.buentheme-layout-narrow .wp-site-blocks > main.is-layout-constrained > :where(:not(.alignfull):not(.alignleft):not(.alignright)),
body.buentheme-layout-narrow .wp-block-post-content > :where(:not(.alignfull):not(.alignleft):not(.alignright)),
body.buentheme-layout-narrow .entry-content > :where(:not(.alignfull):not(.alignleft):not(.alignright)) {
    max-width: var(--buentheme-narrow-width, 720px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.buentheme-layout-full_width .wp-site-blocks {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
body.buentheme-layout-full_width .wp-site-blocks > main {
    max-width: 100% !important;
}

/* 2. Estilo del Contenido (Caja / Boxed vs Sin Caja) */
body.buentheme-style-boxed {
    background-color: #f1f5f9 !important;
}
body.buentheme-style-boxed .wp-site-blocks > main {
    background-color: #ffffff;
    max-width: var(--wp--style--global--content-size, 1290px);
    margin: 40px auto !important;
    /* Solo vertical: L/R lo gobiernan content_padding / template_padding (no hardcodear 40px). */
    padding-top: 50px !important;
    padding-bottom: 50px !important;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}
@media (prefers-color-scheme: dark) {
    body.buentheme-style-boxed {
        background-color: #0f172a !important;
    }
    body.buentheme-style-boxed .wp-site-blocks > main {
        background-color: #1e293b;
        border-color: #334155;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    }
}

/* 3. Espaciado Vertical del Contenido (Paddings) */
body.buentheme-spacing-yes .wp-site-blocks > main {
    padding-top: var(--wp--preset--spacing--50) !important;
    padding-bottom: var(--wp--preset--spacing--50) !important;
}
body.buentheme-spacing-no .wp-site-blocks > main {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
body.buentheme-spacing-top_only .wp-site-blocks > main {
    padding-top: var(--wp--preset--spacing--50) !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}
body.buentheme-spacing-bottom_only .wp-site-blocks > main {
    padding-top: 0 !important;
    padding-bottom: var(--wp--preset--spacing--50) !important;
    margin-top: 0 !important;
}

/* 4. Soporte para Diseños con Barra Lateral (Left / Right Sidebar) */
body.buentheme-layout-left_sidebar .wp-site-blocks > main,
body.buentheme-layout-right_sidebar .wp-site-blocks > main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: var(--wp--style--global--content-size, 1290px);
    margin: 40px auto !important;
    /* L/R vía content_padding del dashboard (no hardcodear 20px). */
    padding-left: var(--buentheme-global-padding, 30px);
    padding-right: var(--buentheme-global-padding, 30px);
    box-sizing: border-box;
}

@media (min-width: 992px) {
    body.buentheme-layout-right_sidebar .wp-site-blocks > main {
        grid-template-columns: 8fr 3fr;
    }
    body.buentheme-layout-left_sidebar .wp-site-blocks > main {
        grid-template-columns: 3fr 8fr;
    }
    body.buentheme-layout-right_sidebar .wp-site-blocks > main > .buentheme-dynamic-sidebar {
        grid-column: 2;
        grid-row: 1 / -1;
    }
    body.buentheme-layout-right_sidebar .wp-site-blocks > main > *:not(.buentheme-dynamic-sidebar) {
        grid-column: 1;
    }
    body.buentheme-layout-left_sidebar .wp-site-blocks > main > .buentheme-dynamic-sidebar {
        grid-column: 1;
        grid-row: 1 / -1;
    }
    body.buentheme-layout-left_sidebar .wp-site-blocks > main > *:not(.buentheme-dynamic-sidebar) {
        grid-column: 2;
    }
}

/* Sidebar Estético Decorativo Genérico Autogenerado */
.buentheme-dynamic-sidebar {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 30px;
    height: fit-content;
}
@media (prefers-color-scheme: dark) {
    .buentheme-dynamic-sidebar {
        background-color: #1e293b;
        border-color: #334155;
    }
}
.buentheme-dynamic-sidebar h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--wp--preset--color--text-1, #0f172a);
    border-bottom: 2px solid #2563eb;
    padding-bottom: 8px;
    margin-top: 0;
}
.buentheme-dynamic-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
}
.buentheme-dynamic-sidebar ul:last-child {
    margin-bottom: 0;
}
.buentheme-dynamic-sidebar ul li {
    margin-bottom: 12px;
    font-size: 14px;
}
.buentheme-dynamic-sidebar ul li a {
    color: var(--wp--preset--color--accent-1, #2563eb);
    text-decoration: none;
    transition: color 0.15s ease;
}
.buentheme-dynamic-sidebar ul li a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   OPTIMIZACIÓN DE ANCHOS Y SINCRONIZACIÓN DE MAQUETACIÓN FSE & ROW BLOCKS
   ========================================================================== */

/* 1. Full width: el contenedor main puede ser 100%; el ANCHO de contenido
   de los hijos lo define content-size (sección E), no se fuerza 100% aquí.
   Solo alignfull debe romper el límite. */
body.buentheme-layout-full_width .wp-site-blocks,
body.buentheme-layout-full_width .wp-site-blocks > main,
body.buentheme-layout-full_width .wp-block-post-content,
body.buentheme-layout-full_width .is-layout-constrained {
    max-width: 100% !important;
}

/* Hijos alignfull / filas full-bleed en modo full width */
body.buentheme-layout-full_width .is-layout-constrained > .alignfull,
body.buentheme-layout-full_width .wp-block-post-content > .alignfull,
body.buentheme-layout-full_width .is-layout-constrained > .buentheme-row-container.alignfull,
body.buentheme-layout-full_width .is-layout-constrained > .buentheme-row.alignfull {
    max-width: 100% !important;
    width: 100% !important;
}

/* 2. Sincronización de 'Heredar ancho máximo del tema' (has-inherit-width) según el diseño de página */

/*
 * CANÓNICO — «Heredar el ancho máximo del tema»:
 * El INNER se acota a contentSize del dashboard/Global Styles.
 * El OUTER de la fila puede ser 100% (fondo edge-to-edge).
 *
 * Importante cabecera vs página:
 * - En main constrained, un hijo max-width:100% aún se ve “acotado” por el padre.
 * - En .buentheme-header-wrapper el padre es el viewport: max-width:100% estira el
 *   contenido de la cabecera y parece que “Heredar” no aplica. Por eso esta regla
 *   es global + !important (misma semántica en página y cabecera).
 */
.buentheme-row-inner-wrapper.has-inherit-width,
.buentheme-row__inner.has-inherit-width {
    max-width: var(--wp--style--global--content-size, 1290px) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

/* Diseño estrecho: heredar = narrow-width del tema */
body.buentheme-layout-narrow .buentheme-row-inner-wrapper.has-inherit-width,
body.buentheme-layout-narrow .buentheme-row__inner.has-inherit-width {
    max-width: var(--buentheme-narrow-width, 720px) !important;
}

/* Nested: siempre 100% del padre (no re-aplicar content-size) */
.buentheme-row-inner-wrapper.has-inherit-width.is-nested-inner,
.buentheme-row__inner.has-inherit-width.is-nested-inner,
.buentheme-row.is-nested-row > .buentheme-row__inner.has-inherit-width,
.buentheme-row-container.is-nested-row > .buentheme-row-inner-wrapper.has-inherit-width {
    max-width: 100% !important;
}

/* A. Diseño Estrecho (Narrow) — outer de filas en post-content */
body.buentheme-layout-narrow .wp-block-post-content > .buentheme-row-container:not(.has-custom-content-width) {
    max-width: var(--buentheme-narrow-width, 720px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* B. Diseño Normal / Por Defecto */
/*
 * main / post-content a 100%: el ancho lo marcan los hijos via layout constrained de WP
 * (contentSize de theme.json, Estilos globales o del bloque en la plantilla).
 * NO forzar max-width !important en hijos de .is-layout-constrained: eso pisa el
 * contentSize del editor de plantilla.
 */
body.buentheme-layout-normal .wp-site-blocks > main,
body:not([class*="buentheme-layout-"]) .wp-site-blocks > main,
body.buentheme-layout-normal .wp-block-post-content,
body:not([class*="buentheme-layout-"]) .wp-block-post-content {
    max-width: 100% !important;
}

/* Fallback solo fuera de layout constrained (p. ej. main con layout default). */
body.buentheme-layout-normal .wp-block-post-content:not(.is-layout-constrained) > .buentheme-row-container:not(.alignfull):not(.has-custom-content-width),
body:not([class*="buentheme-layout-"]) .wp-block-post-content:not(.is-layout-constrained) > .buentheme-row-container:not(.alignfull):not(.has-custom-content-width),
body.buentheme-layout-normal .wp-site-blocks > main:not(.is-layout-constrained) > .buentheme-row-container:not(.alignfull):not(.has-custom-content-width),
body:not([class*="buentheme-layout-"]) .wp-site-blocks > main:not(.is-layout-constrained) > .buentheme-row-container:not(.alignfull):not(.has-custom-content-width) {
    max-width: var(--wp--style--global--content-size, 1290px);
    margin-left: auto;
    margin-right: auto;
}

/* Ancho personalizado de Disposición de la fila: outer full, inner con max-width exacto.
   Selectores amplios (no solo hijo directo de post-content) + is-layout-constrained.
   Debe ganar a body.buentheme-layout-full_width .is-layout-constrained > * { max-width:100% }. */
body .buentheme-row.has-custom-content-width,
body .buentheme-row-container.has-custom-content-width,
body .wp-block-buentheme-advanced-grid.has-custom-content-width,
body .is-layout-constrained > .buentheme-row.has-custom-content-width,
body .is-layout-constrained > .buentheme-row-container.has-custom-content-width,
body .is-layout-constrained > .wp-block-buentheme-advanced-grid.has-custom-content-width,
body .wp-block-post-content > .buentheme-row-container.has-custom-content-width,
body .wp-block-post-content > .buentheme-row.has-custom-content-width,
body .entry-content > .buentheme-row-container.has-custom-content-width,
body .entry-content > .buentheme-row.has-custom-content-width,
body.buentheme-layout-full_width .wp-block-post-content > .buentheme-row.has-custom-content-width,
body.buentheme-layout-full_width .wp-block-post-content > .buentheme-row-container.has-custom-content-width,
body.buentheme-layout-full_width .is-layout-constrained > .buentheme-row.has-custom-content-width,
body.buentheme-layout-full_width .is-layout-constrained > .buentheme-row-container.has-custom-content-width,
body.buentheme-layout-full_width .is-layout-constrained > .wp-block-buentheme-advanced-grid.has-custom-content-width {
    max-width: none !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
body .buentheme-row-inner-wrapper.has-custom-max-width,
body .buentheme-row__inner.has-custom-max-width,
body .is-layout-constrained .buentheme-row-inner-wrapper.has-custom-max-width,
body .is-layout-constrained .buentheme-row__inner.has-custom-max-width,
body.buentheme-layout-full_width .buentheme-row-inner-wrapper.has-custom-max-width,
body.buentheme-layout-full_width .buentheme-row__inner.has-custom-max-width,
body.buentheme-layout-narrow .buentheme-row-inner-wrapper.has-custom-max-width,
body.buentheme-layout-narrow .buentheme-row__inner.has-custom-max-width {
    /* Preferir valor en px del var; el style inline del save también aporta maxWidth */
    max-width: var(--bt-row-custom-max, var(--bt-row-max-w-d, var(--bt-row-max-w, 1290px))) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

/* Alineación de celdas: no forzar height 100% en secciones cuando valign ≠ stretch */
body .buentheme-row.has-valign-start .buentheme-row__grid > .buentheme-dynamic-section,
body .buentheme-row.has-valign-center .buentheme-row__grid > .buentheme-dynamic-section,
body .buentheme-row.has-valign-end .buentheme-row__grid > .buentheme-dynamic-section,
body .buentheme-row-container.has-valign-start .buentheme-row-layout > .buentheme-dynamic-section,
body .buentheme-row-container.has-valign-center .buentheme-row-layout > .buentheme-dynamic-section,
body .buentheme-row-container.has-valign-end .buentheme-row-layout > .buentheme-dynamic-section {
    height: auto !important;
    min-height: 0 !important;
    align-self: auto !important;
}

/*
 * Alto mínimo de fila: la cadena outer→inner→grid rellena el min-height
 * para que align-items (valign) posicione las celdas dentro de la altura.
 * Solo con .has-min-height (valor > 0). Con 0/vacío: .is-height-auto → hug content.
 */
body .buentheme-row.is-height-auto,
body .buentheme-row-container.is-height-auto,
body .buentheme-row:not(.has-min-height),
body .buentheme-row-container:not(.has-min-height) {
    min-height: 0 !important;
    height: auto !important;
}
body .buentheme-row.has-min-height,
body .buentheme-row-container.has-min-height {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}
body .buentheme-row.has-min-height > .buentheme-row__inner,
body .buentheme-row.has-min-height > .buentheme-row-inner-wrapper,
body .buentheme-row-container.has-min-height > .buentheme-row-inner-wrapper {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
}
body .buentheme-row.has-min-height > .buentheme-row__inner > .buentheme-row__grid,
body .buentheme-row.has-min-height > .buentheme-row__inner > .buentheme-row-layout,
body .buentheme-row-container.has-min-height > .buentheme-row-inner-wrapper > .buentheme-row-layout {
    flex: 1 1 auto !important;
    min-height: 100% !important;
    height: 100% !important;
    width: 100% !important;
    grid-template-rows: var(--bt-row-rows-d, minmax(0, 1fr)) !important;
    align-content: stretch !important;
}

/*
 * Alineación horizontal de celdas (justify-items): las secciones traen width:100%
 * y rellenan la pista → start/center/end no se ven. Forzar width:auto + justify-self.
 */
body .buentheme-row.has-justify-start .buentheme-row__grid,
body .buentheme-row.has-justify-start .buentheme-row-layout,
body .buentheme-row-container.has-justify-start .buentheme-row-layout {
    justify-items: start !important;
}
body .buentheme-row.has-justify-center .buentheme-row__grid,
body .buentheme-row.has-justify-center .buentheme-row-layout,
body .buentheme-row-container.has-justify-center .buentheme-row-layout {
    justify-items: center !important;
}
body .buentheme-row.has-justify-end .buentheme-row__grid,
body .buentheme-row.has-justify-end .buentheme-row-layout,
body .buentheme-row-container.has-justify-end .buentheme-row-layout {
    justify-items: end !important;
}
body .buentheme-row.has-justify-start .buentheme-row__grid > .buentheme-dynamic-section,
body .buentheme-row.has-justify-center .buentheme-row__grid > .buentheme-dynamic-section,
body .buentheme-row.has-justify-end .buentheme-row__grid > .buentheme-dynamic-section,
body .buentheme-row.has-justify-start .buentheme-row-layout > .buentheme-dynamic-section,
body .buentheme-row.has-justify-center .buentheme-row-layout > .buentheme-dynamic-section,
body .buentheme-row.has-justify-end .buentheme-row-layout > .buentheme-dynamic-section,
body .buentheme-row-container.has-justify-start .buentheme-row-layout > .buentheme-dynamic-section,
body .buentheme-row-container.has-justify-center .buentheme-row-layout > .buentheme-dynamic-section,
body .buentheme-row-container.has-justify-end .buentheme-row-layout > .buentheme-dynamic-section {
    width: auto !important;
    max-width: 100% !important;
}
body .buentheme-row.has-justify-start .buentheme-row__grid > .buentheme-dynamic-section,
body .buentheme-row.has-justify-start .buentheme-row-layout > .buentheme-dynamic-section,
body .buentheme-row-container.has-justify-start .buentheme-row-layout > .buentheme-dynamic-section {
    justify-self: start !important;
}
body .buentheme-row.has-justify-center .buentheme-row__grid > .buentheme-dynamic-section,
body .buentheme-row.has-justify-center .buentheme-row-layout > .buentheme-dynamic-section,
body .buentheme-row-container.has-justify-center .buentheme-row-layout > .buentheme-dynamic-section {
    justify-self: center !important;
}
body .buentheme-row.has-justify-end .buentheme-row__grid > .buentheme-dynamic-section,
body .buentheme-row.has-justify-end .buentheme-row-layout > .buentheme-dynamic-section,
body .buentheme-row-container.has-justify-end .buentheme-row-layout > .buentheme-dynamic-section {
    justify-self: end !important;
}

/* C. Diseño Ancho Completo (Full Width) */
/* Outer de filas en el contenido: edge-to-edge (fondo fluido). */
body.buentheme-layout-full_width .wp-block-post-content > .buentheme-row-container,
body.buentheme-layout-full_width .wp-block-post-content > .buentheme-row,
body.buentheme-layout-full_width .wp-site-blocks > main > .buentheme-row-container,
body.buentheme-layout-full_width .wp-site-blocks > main > .buentheme-row {
    max-width: 100% !important;
    width: 100% !important;
}
/*
 * INNER con «Heredar»: SIEMPRE content-size (no 100%).
 * Antes se forzaba max-width:100% y en cabeceras (padre = viewport) el contenido
 * se iba a todo el ancho; en páginas el main constrained enmascaraba el bug.
 * Para contenido 100% fluido: desactivar herencia y usar ancho personalizado alto
 * o sin tope.
 */
body.buentheme-layout-full_width .buentheme-row-inner-wrapper.has-inherit-width,
body.buentheme-layout-full_width .buentheme-row__inner.has-inherit-width {
    max-width: var(--wp--style--global--content-size, 1290px) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/*
 * Cabecera personalizada: mismas reglas de herencia que el contenido.
 * Refuerzo de especificidad (el wrapper es full-bleed por diseño).
 */
.buentheme-header-wrapper .buentheme-row-inner-wrapper.has-inherit-width,
.buentheme-header-wrapper .buentheme-row__inner.has-inherit-width {
    max-width: var(--wp--style--global--content-size, 1290px) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}
body.buentheme-layout-narrow .buentheme-header-wrapper .buentheme-row-inner-wrapper.has-inherit-width,
body.buentheme-layout-narrow .buentheme-header-wrapper .buentheme-row__inner.has-inherit-width {
    max-width: var(--buentheme-narrow-width, 720px) !important;
}
/* Outer de filas de cabecera: siempre fluidas (fondo de zona top/main/bottom). */
.buentheme-header-wrapper .buentheme-row-container,
.buentheme-header-wrapper .buentheme-row {
    max-width: 100% !important;
    width: 100% !important;
}

/*
 * 3. Padding lateral — tokens del dashboard (clases body).
 *
 * Fuente de verdad en px: #buentheme-padding-inline (page-settings.php v5).
 * Aquí solo: tokens CSS + reglas de respaldo (mismas reglas que el inline).
 *
 * ┌────────────────────────────┬──────────────────────────────────────────┐
 * │ Ajuste dashboard           │ Dónde se aplica                          │
 * ├────────────────────────────┼──────────────────────────────────────────┤
 * │ Páginas / main             │ <main> páginas NO-WC (no full_width).    │
 * │ (content_padding*)         │ full_width → main 0 (padding en filas).  │
 * ├────────────────────────────┼──────────────────────────────────────────┤
 * │ Plantillas WC / pie        │ Catálogo: loop outer + títulos.          │
 * │ (template_padding*)        │ Cart/checkout/ficha: main. Pie: siempre. │
 * └────────────────────────────┴──────────────────────────────────────────┘
 *
 * Breakpoints: móvil ≤781 · tablet 782–1079 · escritorio ≥1080.
 */

/* --- Tokens: escritorio --- */
body.buentheme-padding-none { --buentheme-global-padding: 0px; }
body.buentheme-padding-sm   { --buentheme-global-padding: 15px; }
body.buentheme-padding-md   { --buentheme-global-padding: 30px; }
body.buentheme-padding-lg   { --buentheme-global-padding: 45px; }
body.buentheme-padding-xl   { --buentheme-global-padding: 60px; }

body.buentheme-padding-t-none { --buentheme-global-padding-tablet: 0px; }
body.buentheme-padding-t-sm   { --buentheme-global-padding-tablet: 15px; }
body.buentheme-padding-t-md   { --buentheme-global-padding-tablet: 30px; }
body.buentheme-padding-t-lg   { --buentheme-global-padding-tablet: 45px; }
body.buentheme-padding-t-xl   { --buentheme-global-padding-tablet: 60px; }

body.buentheme-padding-m-none { --buentheme-global-padding-mobile: 0px; }
body.buentheme-padding-m-sm   { --buentheme-global-padding-mobile: 15px; }
body.buentheme-padding-m-md   { --buentheme-global-padding-mobile: 30px; }
body.buentheme-padding-m-lg   { --buentheme-global-padding-mobile: 45px; }
body.buentheme-padding-m-xl   { --buentheme-global-padding-mobile: 60px; }

body.buentheme-tpl-pad-none { --buentheme-template-edge-padding: 0px; }
body.buentheme-tpl-pad-sm   { --buentheme-template-edge-padding: 15px; }
body.buentheme-tpl-pad-md   { --buentheme-template-edge-padding: 30px; }
body.buentheme-tpl-pad-lg   { --buentheme-template-edge-padding: 45px; }
body.buentheme-tpl-pad-xl   { --buentheme-template-edge-padding: 60px; }

body.buentheme-tpl-pad-t-none { --buentheme-template-edge-padding-tablet: 0px; }
body.buentheme-tpl-pad-t-sm   { --buentheme-template-edge-padding-tablet: 15px; }
body.buentheme-tpl-pad-t-md   { --buentheme-template-edge-padding-tablet: 30px; }
body.buentheme-tpl-pad-t-lg   { --buentheme-template-edge-padding-tablet: 45px; }
body.buentheme-tpl-pad-t-xl   { --buentheme-template-edge-padding-tablet: 60px; }

body.buentheme-tpl-pad-m-none { --buentheme-template-edge-padding-mobile: 0px; }
body.buentheme-tpl-pad-m-sm   { --buentheme-template-edge-padding-mobile: 15px; }
body.buentheme-tpl-pad-m-md   { --buentheme-template-edge-padding-mobile: 30px; }
body.buentheme-tpl-pad-m-lg   { --buentheme-template-edge-padding-mobile: 45px; }
body.buentheme-tpl-pad-m-xl   { --buentheme-template-edge-padding-mobile: 60px; }

/* --- Reasignar tokens efectivos por viewport --- */
@media (min-width: 782px) and (max-width: 1079px) {
    body {
        --buentheme-global-padding: var(--buentheme-global-padding-tablet, 15px);
        --buentheme-template-edge-padding: var(--buentheme-template-edge-padding-tablet, 15px);
        --buentheme-wc-edge-pad: var(--buentheme-template-edge-padding, 15px);
    }
}
@media (max-width: 781px) {
    body {
        --buentheme-global-padding: var(--buentheme-global-padding-mobile, 15px);
        --buentheme-template-edge-padding: var(--buentheme-template-edge-padding-mobile, 15px);
        --buentheme-wc-edge-pad: var(--buentheme-template-edge-padding, 15px);
    }
}

/*
 * Respaldo (vars). El CSS inline v5 escribe px del dashboard con !important
 * y gana a Global Styles / LiteSpeed. Mantener selectores alineados con PHP.
 */

/* Páginas normales (no WC), no full_width. */
body:not(.buentheme-layout-full_width):not(.buentheme-wc-catalog):not(.woocommerce-shop):not(.post-type-archive-product):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_brand):not(.single-product):not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-order-received):not(.search-results.woocommerce):not(.buentheme-wc-single-product) .wp-site-blocks > main:not(.buentheme-wc-catalog-main):not(.buentheme-wc-cart-main):not(.buentheme-wc-checkout-main):not(.buentheme-wc-order-confirmation-main):not(.buentheme-wc-product-search-main):not(.buentheme-single-product-main) {
    padding-left: var(--buentheme-global-padding, 30px) !important;
    padding-right: var(--buentheme-global-padding, 30px) !important;
    box-sizing: border-box !important;
}

/* full_width no-WC → main 0. */
body.buentheme-layout-full_width:not(.buentheme-wc-catalog):not(.woocommerce-shop):not(.post-type-archive-product):not(.tax-product_cat):not(.tax-product_tag):not(.tax-product_brand):not(.single-product):not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-order-received):not(.search-results.woocommerce):not(.buentheme-wc-single-product) .wp-site-blocks > main {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Catálogo: main 0; loop outer + títulos con template_padding.
 * NO padear .wc-block-product-template (appearance fuerza padding:0 en el grid). */
body.buentheme-wc-catalog .wp-site-blocks > main,
body.woocommerce-shop .wp-site-blocks > main,
body.post-type-archive-product .wp-site-blocks > main,
body.tax-product_cat .wp-site-blocks > main,
body.tax-product_tag .wp-site-blocks > main,
body.tax-product_brand .wp-site-blocks > main,
body.search-results.woocommerce .wp-site-blocks > main,
.wp-site-blocks > main.buentheme-wc-catalog-main,
.wp-site-blocks > main.buentheme-wc-product-search-main {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.buentheme-wc-catalog .buentheme-wc-catalog-root,
body.buentheme-wc-catalog .wp-block-woocommerce-product-collection,
body.woocommerce-shop .buentheme-wc-catalog-root,
body.woocommerce-shop .wp-block-woocommerce-product-collection,
body.post-type-archive-product .buentheme-wc-catalog-root,
body.post-type-archive-product .wp-block-woocommerce-product-collection,
body.tax-product_cat .buentheme-wc-catalog-root,
body.tax-product_cat .wp-block-woocommerce-product-collection,
body.tax-product_tag .buentheme-wc-catalog-root,
body.tax-product_tag .wp-block-woocommerce-product-collection,
body.tax-product_brand .buentheme-wc-catalog-root,
body.tax-product_brand .wp-block-woocommerce-product-collection,
body.search-results.woocommerce .buentheme-wc-catalog-root,
body.search-results.woocommerce .wp-block-woocommerce-product-collection,
.buentheme-wc-catalog-main > .buentheme-wc-catalog-root,
.buentheme-wc-catalog-main > .wp-block-woocommerce-product-collection,
.buentheme-wc-product-search-main > .buentheme-wc-catalog-root,
.buentheme-wc-product-search-main > .wp-block-woocommerce-product-collection {
    padding-left: var(--buentheme-template-edge-padding, 15px) !important;
    padding-right: var(--buentheme-template-edge-padding, 15px) !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
}

body.buentheme-wc-catalog main > .wp-block-query-title,
body.buentheme-wc-catalog main > .wp-block-term-description,
body.buentheme-wc-catalog main > .wp-block-woocommerce-store-notices,
body.buentheme-wc-catalog main > .wp-block-heading,
body.woocommerce-shop main > .wp-block-query-title,
body.woocommerce-shop main > .wp-block-term-description,
body.woocommerce-shop main > .wp-block-woocommerce-store-notices,
body.woocommerce-shop main > .wp-block-heading,
body.post-type-archive-product main > .wp-block-query-title,
body.post-type-archive-product main > .wp-block-term-description,
body.tax-product_cat main > .wp-block-query-title,
body.tax-product_cat main > .wp-block-term-description,
body.tax-product_tag main > .wp-block-query-title,
body.tax-product_tag main > .wp-block-term-description,
.buentheme-wc-catalog-main > .wp-block-query-title,
.buentheme-wc-catalog-main > .wp-block-term-description,
.buentheme-wc-catalog-main > .wp-block-woocommerce-store-notices,
.buentheme-wc-catalog-main > .wp-block-heading,
.buentheme-wc-product-search-main > .wp-block-query-title {
    padding-left: var(--buentheme-template-edge-padding, 15px) !important;
    padding-right: var(--buentheme-template-edge-padding, 15px) !important;
    box-sizing: border-box !important;
}

/* Carrito / checkout / ficha: padding en el main. */
body.woocommerce-cart .wp-site-blocks > main,
body.woocommerce-checkout .wp-site-blocks > main,
body.woocommerce-order-received .wp-site-blocks > main,
body.single-product .wp-site-blocks > main,
body.buentheme-wc-single-product .wp-site-blocks > main,
.wp-site-blocks > main.buentheme-wc-cart-main,
.wp-site-blocks > main.buentheme-wc-checkout-main,
.wp-site-blocks > main.buentheme-wc-order-confirmation-main,
.wp-site-blocks > main.buentheme-single-product-main {
    padding-left: var(--buentheme-template-edge-padding, 15px) !important;
    padding-right: var(--buentheme-template-edge-padding, 15px) !important;
    box-sizing: border-box !important;
}

/* Hijos de ficha/cart: sin pad extra (el main ya aporta el aire). */
.buentheme-wc-cart-main > :where(:not(.alignfull)),
.buentheme-wc-checkout-main > :where(:not(.alignfull)),
.buentheme-wc-order-confirmation-main > :where(:not(.alignfull)),
.buentheme-single-product-main > .wp-block-columns,
.buentheme-single-product-main > .buentheme-product-tabs-section,
.buentheme-single-product-main > .buentheme-product-related {
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

/* Pie: template_padding. NO padear template-parts genéricos (cabecera). */
.wp-site-blocks > footer,
.wp-site-blocks > footer.alignfull,
.wp-site-blocks > footer.wp-block-template-part,
.wp-site-blocks .wp-block-template-part > footer,
.wp-site-blocks footer.wp-block-group,
.wp-site-blocks footer.alignfull,
footer.wp-block-group.alignfull:not(.buentheme-header-wrapper),
footer.wp-block-group:not(.buentheme-header-wrapper) {
    padding-left: var(--buentheme-template-edge-padding, 15px) !important;
    padding-right: var(--buentheme-template-edge-padding, 15px) !important;
    box-sizing: border-box !important;
}

/* Cabecera: nunca hereda padding de plantillas WC/pie. */
.wp-site-blocks > .buentheme-header-wrapper,
.wp-site-blocks > .wp-block-template-part.buentheme-header-wrapper,
.buentheme-header-wrapper.wp-block-template-part,
.buentheme-header-wrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.buentheme-layout-full_width .wp-block-post-title {
    max-width: var(--wp--style--global--content-size, 1290px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ==========================================================================
   SINCRONIZACIÓN DE MAQUETACIÓN Y ALINEACIÓN DE TÍTULO (FSE)
   ========================================================================== */

/* A. Diseño Estrecho (Narrow) */
body.buentheme-layout-narrow .wp-block-post-title {
    max-width: var(--buentheme-narrow-width, 720px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* B. Diseño Normal (Default) — solo títulos FUERA de constrained (WP ya los acota dentro). */
body.buentheme-layout-normal .wp-site-blocks > main:not(.is-layout-constrained) > .wp-block-post-title,
body:not([class*="buentheme-layout-"]) .wp-site-blocks > main:not(.is-layout-constrained) > .wp-block-post-title {
    max-width: var(--wp--style--global--content-size, 1290px);
    margin-left: auto;
    margin-right: auto;
}

/* C. Diseño Ancho Completo (Full Width) */
body.buentheme-layout-full_width .wp-block-post-title {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: var(--buentheme-global-padding, 30px) !important;
    padding-right: var(--buentheme-global-padding, 30px) !important;
}

/* D. Alineación Horizontal del Título (Global y Específica) */
body.buentheme-title-align-left .wp-block-post-title,
body.buentheme-title-align-left .wp-block-query-title {
    text-align: left !important;
}
body.buentheme-title-align-center .wp-block-post-title,
body.buentheme-title-align-center .wp-block-query-title {
    text-align: center !important;
}
body.buentheme-title-align-right .wp-block-post-title,
body.buentheme-title-align-right .wp-block-query-title {
    text-align: right !important;
}

body.buentheme-hide-page-title .wp-block-query-title,
body.buentheme-hide-page-title .wp-site-blocks > main > .wp-block-post-title {
    display: none !important;
}

body.buentheme-layout-narrow .wp-block-query-title {
    max-width: var(--buentheme-narrow-width, 720px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
body.buentheme-layout-normal .wp-site-blocks > main:not(.is-layout-constrained) > .wp-block-query-title,
body:not([class*="buentheme-layout-"]) .wp-site-blocks > main:not(.is-layout-constrained) > .wp-block-query-title {
    max-width: var(--wp--style--global--content-size, 1290px);
    margin-left: auto;
    margin-right: auto;
}
body.buentheme-layout-full_width .wp-block-query-title {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/*
 * E. Contenido principal (páginas WC + constrained).
 *
 * La cabecera acota con filas (has-inherit-width / max-w). El main del producto
 * usa layout constrained: hay que acotar sus HIJOS con content-size resuelto
 * en el punto de uso (hereda contentSize local del bloque si existe).
 * Sin esta regla, columnas/galería/tabs van edge-to-edge y la cabecera no.
 */
body.buentheme-layout-normal .wp-site-blocks > main.is-layout-constrained > :where(:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide)),
body:not([class*="buentheme-layout-"]) .wp-site-blocks > main.is-layout-constrained > :where(:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide)),
body.buentheme-layout-normal .wp-site-blocks > main.buentheme-single-product-main > :where(:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide)),
body.buentheme-layout-normal .wp-site-blocks > main.buentheme-wc-catalog-main > :where(:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide)),
body.buentheme-layout-normal .wp-site-blocks > main.buentheme-wc-cart-main > :where(:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide)),
body.buentheme-layout-normal .wp-site-blocks > main.buentheme-wc-checkout-main > :where(:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide)),
body.buentheme-layout-normal .wp-site-blocks > main.buentheme-wc-order-confirmation-main > :where(:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide)),
body.buentheme-layout-normal .wp-site-blocks > main.buentheme-wc-product-search-main > :where(:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide)),
body:not([class*="buentheme-layout-"]) .wp-site-blocks > main.buentheme-single-product-main > :where(:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide)),
body:not([class*="buentheme-layout-"]) .wp-site-blocks > main.buentheme-wc-catalog-main > :where(:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide)),
body:not([class*="buentheme-layout-"]) .wp-site-blocks > main.buentheme-wc-cart-main > :where(:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide)),
body:not([class*="buentheme-layout-"]) .wp-site-blocks > main.buentheme-wc-checkout-main > :where(:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide)) {
    max-width: var(--wp--style--global--content-size, 1290px) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

/* alignwide → wide size (o content-size si no hay wide) */
body.buentheme-layout-normal .wp-site-blocks > main.is-layout-constrained > .alignwide,
body:not([class*="buentheme-layout-"]) .wp-site-blocks > main.is-layout-constrained > .alignwide,
body.buentheme-layout-normal .wp-site-blocks > main.buentheme-single-product-main > .alignwide,
body.buentheme-layout-normal .wp-site-blocks > main.buentheme-wc-cart-main > .alignwide,
body.buentheme-layout-normal .wp-site-blocks > main.buentheme-wc-checkout-main > .alignwide,
body:not([class*="buentheme-layout-"]) .wp-site-blocks > main > .alignwide {
    max-width: var(--wp--style--global--wide-size, var(--wp--style--global--content-size, 1290px)) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

/* Refuerzo ficha de producto (columnas / tabs / relacionados) */
.buentheme-single-product-main > .wp-block-columns,
.buentheme-single-product-main > .buentheme-product-tabs-section,
.buentheme-single-product-main > .buentheme-product-related {
    max-width: var(--wp--style--global--content-size, 1290px) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

/*
 * Ficha: el main ya aporta template_padding; no duplicar en hijos.
 * (Si template_padding = none, el main ya va a 0; hijos siguen sin pad extra.)
 */
.buentheme-single-product-main > .wp-block-columns,
.buentheme-single-product-main > .buentheme-product-tabs-section,
.buentheme-single-product-main > .buentheme-product-related {
    padding-left: 0;
    padding-right: 0;
}

body.buentheme-layout-narrow .wp-site-blocks > main.is-layout-constrained > :where(:not(.alignfull):not(.alignleft):not(.alignright)),
body.buentheme-layout-narrow .wp-site-blocks > main > .wp-block-woocommerce-product-collection,
body.buentheme-layout-narrow .wp-site-blocks > main > .buentheme-wc-catalog-root,
body.buentheme-layout-narrow .wp-site-blocks > main > .wp-block-query.buentheme-wc-catalog-root,
body.buentheme-layout-narrow .wp-site-blocks > main > .wp-block-term-description,
body.buentheme-layout-narrow .wp-site-blocks > main > .wp-block-woocommerce-cart,
body.buentheme-layout-narrow .wp-site-blocks > main > .wp-block-woocommerce-checkout,
body.buentheme-layout-narrow .wp-site-blocks > main > .wp-block-columns,
body.buentheme-layout-narrow .wp-site-blocks > main > .wp-block-heading,
body.buentheme-layout-narrow .wp-site-blocks > main > .wp-block-group:not(.alignfull),
body.buentheme-layout-narrow .buentheme-single-product-main > .wp-block-columns,
body.buentheme-layout-narrow .buentheme-single-product-main > .buentheme-product-tabs-section,
body.buentheme-layout-narrow .buentheme-single-product-main > .buentheme-product-related {
    max-width: var(--buentheme-narrow-width, 720px) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/*
 * Full width del dashboard: filas pueden ir edge-to-edge, pero el contenido
 * de producto/tienda sigue el content-size (como la cabecera con inherit).
 * Solo alignfull rompe el límite.
 */
body.buentheme-layout-full_width .wp-site-blocks > main.is-layout-constrained > :where(:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide)),
body.buentheme-layout-full_width .wp-site-blocks > main.buentheme-single-product-main > :where(:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide)),
body.buentheme-layout-full_width .buentheme-single-product-main > .wp-block-columns,
body.buentheme-layout-full_width .buentheme-single-product-main > .buentheme-product-tabs-section,
body.buentheme-layout-full_width .buentheme-single-product-main > .buentheme-product-related {
    max-width: var(--wp--style--global--content-size, 1290px) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

body.buentheme-layout-full_width .wp-site-blocks > main.is-layout-constrained > .alignwide,
body.buentheme-layout-full_width .wp-site-blocks > main > .alignwide {
    max-width: var(--wp--style--global--wide-size, var(--wp--style--global--content-size, 1290px)) !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.buentheme-layout-full_width .wp-site-blocks > main.is-layout-constrained > .alignfull,
body.buentheme-layout-full_width .wp-block-woocommerce-product-collection.alignfull {
    max-width: 100% !important;
    width: 100% !important;
}

body.buentheme-layout-narrow .wp-site-blocks > main > .wp-block-heading {
    max-width: var(--buentheme-narrow-width, 720px) !important;
}
/* full_width: títulos en main usan content_padding (no template WC). */
body.buentheme-layout-full_width .wp-site-blocks > main > .wp-block-heading {
    max-width: var(--wp--style--global--content-size, 1290px) !important;
    padding-left: var(--buentheme-global-padding, 0px) !important;
    padding-right: var(--buentheme-global-padding, 0px) !important;
    box-sizing: border-box !important;
}

/* En tienda/ficha full_width el título de archivo sigue template_padding. */
body.buentheme-layout-full_width.woocommerce-shop .wp-site-blocks > main > .wp-block-heading,
body.buentheme-layout-full_width.post-type-archive-product .wp-site-blocks > main > .wp-block-heading,
body.buentheme-layout-full_width.tax-product_cat .wp-site-blocks > main > .wp-block-heading,
body.buentheme-layout-full_width.tax-product_tag .wp-site-blocks > main > .wp-block-heading,
body.buentheme-layout-full_width.buentheme-wc-catalog .wp-site-blocks > main > .wp-block-heading {
    padding-left: var(--buentheme-template-edge-padding, 15px) !important;
    padding-right: var(--buentheme-template-edge-padding, 15px) !important;
}

body.buentheme-title-align-left .wp-block-term-description,
body.buentheme-title-align-left .wp-site-blocks > main > .wp-block-heading {
    text-align: left !important;
}
body.buentheme-title-align-center .wp-block-term-description,
body.buentheme-title-align-center .wp-site-blocks > main > .wp-block-heading {
    text-align: center !important;
}
body.buentheme-title-align-right .wp-block-term-description,
body.buentheme-title-align-right .wp-site-blocks > main > .wp-block-heading {
    text-align: right !important;
}

body.buentheme-wc-catalog.buentheme-style-boxed .wp-site-blocks > main > .wp-block-woocommerce-product-collection,
body.buentheme-wc-catalog.buentheme-style-boxed .wp-site-blocks > main > .buentheme-wc-catalog-root {
    background-color: transparent;
}

/*
 * Boxed: acota el main (no los hijos constrained).
 * layout-normal pone main a 100% !important — reafirmar caja con content-size global.
 */
body.buentheme-style-boxed.buentheme-layout-normal .wp-site-blocks > main,
body.buentheme-style-boxed:not([class*="buentheme-layout-"]) .wp-site-blocks > main {
    max-width: var(--wp--style--global--content-size, 1290px) !important;
}



/* ==========================================================================
   ESTILOS ESTILOS ESTÁTICOS PARA EL EDITOR DE PÁGINAS (PREVISUALIZACIÓN DE ANCHO Y TÍTULO)
   ========================================================================== */

/* 1. Diseños de Página (Page Layouts) en el Editor */
body.buentheme-editor-layout-narrow {
    max-width: var(--buentheme-narrow-width, 720px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
body.buentheme-editor-layout-narrow .block-editor-block-list__layout {
    max-width: var(--buentheme-narrow-width, 720px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
body.buentheme-editor-layout-narrow .wp-block-post-title,
body.buentheme-editor-layout-narrow .editor-post-title,
body.buentheme-editor-layout-narrow .editor-post-title__block {
    max-width: var(--buentheme-narrow-width, 720px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.buentheme-editor-layout-full_width .block-editor-block-list__layout {
    max-width: 100% !important;
}
body.buentheme-editor-layout-full_width .wp-block {
    max-width: 100% !important;
}
body.buentheme-editor-layout-full_width .wp-block-post-title,
body.buentheme-editor-layout-full_width .editor-post-title,
body.buentheme-editor-layout-full_width .editor-post-title__block {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

body.buentheme-editor-layout-normal .wp-block-post-title,
body.buentheme-editor-layout-normal .editor-post-title,
body.buentheme-editor-layout-normal .editor-post-title__block {
    max-width: var(--wp--style--global--content-size, 1290px);
    margin-left: auto;
    margin-right: auto;
}

/* 2. Mostrar/Ocultar Título y Alineación en el Editor */
body.buentheme-editor-title-yes .wp-block-post-title,
body.buentheme-editor-title-yes .editor-post-title,
body.buentheme-editor-title-yes .editor-post-title__block {
    display: block !important;
}

body.buentheme-editor-title-no .wp-block-post-title,
body.buentheme-editor-title-no .editor-post-title,
body.buentheme-editor-title-no .editor-post-title__block {
    display: none !important;
}

body.buentheme-editor-title-align-left .wp-block-post-title,
body.buentheme-editor-title-align-left .editor-post-title,
body.buentheme-editor-title-align-left .editor-post-title__block {
    text-align: left !important;
}

body.buentheme-editor-title-align-center .wp-block-post-title,
body.buentheme-editor-title-align-center .editor-post-title,
body.buentheme-editor-title-align-center .editor-post-title__block {
    text-align: center !important;
}

body.buentheme-editor-title-align-right .wp-block-post-title,
body.buentheme-editor-title-align-right .editor-post-title,
body.buentheme-editor-title-align-right .editor-post-title__block {
    text-align: right !important;
}

/* 3. Estilo de contenido y espaciado vertical en el Editor */
body.buentheme-editor-style-boxed.editor-styles-wrapper {
    background-color: #f1f5f9 !important;
    padding: 40px 20px !important;
}
body.buentheme-editor-style-boxed.editor-styles-wrapper .block-editor-block-list__layout {
    background-color: #ffffff;
    max-width: var(--wp--style--global--content-size, 1290px);
    margin: 0 auto !important;
    padding: 40px !important;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

body.buentheme-editor-spacing-no.editor-styles-wrapper {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
body.buentheme-editor-spacing-top_only.editor-styles-wrapper {
    padding-bottom: 0 !important;
}
body.buentheme-editor-spacing-bottom_only.editor-styles-wrapper {
    padding-top: 0 !important;
}

/* 4. Layouts con barra lateral en el Editor */
body.buentheme-editor-layout-left_sidebar .block-editor-block-list__layout,
body.buentheme-editor-layout-right_sidebar .block-editor-block-list__layout {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ==========================================================================
   SISTEMA DE CABECERAS MODULARES FSE (TOP, MAIN, BOTTOM ROWS)
   Sprint 1: estados scrolled/shrunk/hidden + altura
   Sprint 2: glass/blur, sticky por device, logo dual, colores por estado
   ========================================================================== */

html {
    scroll-padding-top: var(--buentheme-header-offset, 0px);
}

.buentheme-header-wrapper {
    position: relative !important;
    z-index: 100 !important;
    --buentheme-header-transition-ms: 300ms;
    --buentheme-header-logo-scale: 1;
    --buentheme-header-shrink-padding: 12px;
    --buentheme-header-blur: 12px;
    transition:
        background-color var(--buentheme-header-transition-ms, 300ms) ease,
        box-shadow var(--buentheme-header-transition-ms, 300ms) ease,
        padding var(--buentheme-header-transition-ms, 300ms) ease,
        transform var(--buentheme-header-transition-ms, 300ms) cubic-bezier(0.16, 1, 0.3, 1),
        border-color var(--buentheme-header-transition-ms, 300ms) ease,
        color var(--buentheme-header-transition-ms, 300ms) ease;
    width: 100%;
    /* NUNCA will-change:transform ni backdrop-filter en este nodo:
       crean containing-block y atrapan el overlay fixed del menú móvil. */
}

/*
 * Cuando el menú modal está abierto, liberar containing-block del header
 * (CSS puro, sin depender de navigation.js ni body.buentheme-nav-open).
 */
.buentheme-header-wrapper:has(.wp-block-navigation__responsive-container.is-menu-open),
.buentheme-header-wrapper:has(.wp-block-navigation.has-modal-open),
.buentheme-header-wrapper:has(.wp-block-navigation-overlay.is-menu-open) {
    transform: none !important;
    will-change: auto !important;
    filter: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    perspective: none !important;
    contain: none !important;
    pointer-events: auto !important;
    overflow: visible !important;
    /* sticky/fixed en el wrapper también puede interferir con el modal */
    position: relative !important;
    top: auto !important;
}

/* --- Sprint 2: colores de primer plano por estado --- */
.buentheme-header-wrapper.has-header-fg-default,
.buentheme-header-wrapper.has-header-fg-scrolled {
    color: var(--buentheme-header-fg, inherit);
}

.buentheme-header-wrapper.has-header-fg-default a:not(.wp-element-button):not(.wp-block-button__link),
.buentheme-header-wrapper.has-header-fg-scrolled a:not(.wp-element-button):not(.wp-block-button__link),
.buentheme-header-wrapper.has-header-fg-default .wp-block-navigation-item__content,
.buentheme-header-wrapper.has-header-fg-scrolled .wp-block-navigation-item__content,
.buentheme-header-wrapper.has-header-fg-default .wp-block-site-title a,
.buentheme-header-wrapper.has-header-fg-scrolled .wp-block-site-title a,
.buentheme-header-wrapper.has-header-fg-default .buentheme-menu-block a,
.buentheme-header-wrapper.has-header-fg-scrolled .buentheme-menu-block a {
    color: var(--buentheme-header-fg, inherit);
}

.buentheme-header-wrapper.has-header-fg-default .wp-block-navigation__responsive-container-open,
.buentheme-header-wrapper.has-header-fg-scrolled .wp-block-navigation__responsive-container-open,
.buentheme-header-wrapper.has-header-fg-default .wp-block-navigation__responsive-container-open svg,
.buentheme-header-wrapper.has-header-fg-scrolled .wp-block-navigation__responsive-container-open svg {
    color: var(--buentheme-header-fg, inherit);
    fill: var(--buentheme-header-fg, inherit);
    --buentheme-hamburger-color: var(--buentheme-header-fg, inherit);
}

/* Scrolled scheme override (cuando hay fg_scrolled) */
.buentheme-header-wrapper.has-header-fg-scrolled.is-header-scrolled,
.buentheme-header-wrapper.has-header-fg-scrolled.is-header-scrolled-visual {
    --buentheme-header-fg: var(--buentheme-header-fg-scrolled);
}

/*
 * Sprint 2: glass / blur en ::before (NO en el wrapper).
 * backdrop-filter en el wrapper atrapa position:fixed del menú.
 */
.buentheme-header-wrapper.has-header-blur.is-style-transparent-header:not(.is-header-scrolled):not(.is-header-scrolled-visual)::before,
.buentheme-header-wrapper.has-header-blur.is-header-scrolled::before,
.buentheme-header-wrapper.has-header-blur.is-header-scrolled-visual::before,
.buentheme-header-wrapper.has-header-blur.is-sticky-active::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    -webkit-backdrop-filter: blur(var(--buentheme-header-blur, 12px)) saturate(1.2);
    backdrop-filter: blur(var(--buentheme-header-blur, 12px)) saturate(1.2);
}
.buentheme-header-wrapper.has-header-blur > * {
    position: relative;
    z-index: 1;
}
/* Sin blur del pseudo mientras el menú modal está abierto */
.buentheme-header-wrapper.has-header-blur:has(.wp-block-navigation__responsive-container.is-menu-open)::before,
.buentheme-header-wrapper.has-header-blur:has(.wp-block-navigation.has-modal-open)::before {
    display: none !important;
}

/*
 * Site Logo en cabeceras: sin aire fantasma.
 * - figure / a / img con margin+padding 0 (ajustables por CSS vars).
 * - Solo el logo default está en flujo; variantes duales SIEMPRE absolute
 *   (si no, al fijar ancho con .has-logo-width las 2–3 imgs suman altura).
 * - No usar transform:scale para el tamaño base (no reduce la caja de layout).
 */
.buentheme-header-wrapper .wp-block-site-logo,
.buentheme-header-wrapper .wp-block-site-logo.wp-block-site-logo,
.buentheme-header-wrapper figure.wp-block-site-logo,
.buentheme-header-wrapper .buentheme-bar-logo,
.buentheme-header-wrapper .buentheme-drawer-brand__logo {
    display: block !important;
    margin: var(--buentheme-header-logo-margin-y, 0px) 0 !important;
    padding: var(--buentheme-header-logo-padding-y, 0px) 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    width: fit-content !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    box-sizing: border-box !important;
    visibility: visible !important;
    overflow: visible !important;
}

.buentheme-header-wrapper .custom-logo-link,
.buentheme-header-wrapper .wp-block-site-logo a,
.buentheme-header-wrapper .buentheme-bar-logo a,
.buentheme-header-wrapper .buentheme-drawer-brand__logo a {
    position: relative !important;
    display: block !important; /* no flex: evita min-height de line-box */
    align-items: initial !important;
    justify-content: initial !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    border: none !important;
    width: fit-content !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    visibility: visible !important;
    text-decoration: none !important;
    overflow: visible !important;
}

/* Solo el logo en flujo (default). Excluir duales. */
.buentheme-header-wrapper .wp-block-site-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper .custom-logo-link img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper .buentheme-logo-default,
.buentheme-header-wrapper .buentheme-bar-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper .buentheme-drawer-brand__logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled) {
    display: block !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    vertical-align: top;
    line-height: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: 100%;
    height: auto !important;
    /* Anula width/height HTML del adjunto (p. ej. 2000×800) que inflan la fila */
    width: auto;
    box-sizing: border-box !important;
}

/*
 * Dual logo: superpuestas al default. Especificidad alta para ganar a
 * `.has-logo-width`, barra y drawer (antes volvían al flujo y sumaban altura).
 * Nunca contribuyen a la altura de la Disposición de la fila.
 */
.buentheme-header-wrapper img.buentheme-logo-transparent,
.buentheme-header-wrapper img.buentheme-logo-scrolled,
.buentheme-header-wrapper .custom-logo.buentheme-logo-transparent,
.buentheme-header-wrapper .custom-logo.buentheme-logo-scrolled,
.buentheme-header-wrapper.has-logo-width img.buentheme-logo-transparent,
.buentheme-header-wrapper.has-logo-width img.buentheme-logo-scrolled,
.buentheme-header-wrapper.has-logo-width .custom-logo.buentheme-logo-transparent,
.buentheme-header-wrapper.has-logo-width .custom-logo.buentheme-logo-scrolled,
.buentheme-header-wrapper.is-header-shrunk img.buentheme-logo-transparent,
.buentheme-header-wrapper.is-header-shrunk img.buentheme-logo-scrolled,
.buentheme-header-wrapper .buentheme-bar-logo img.buentheme-logo-transparent,
.buentheme-header-wrapper .buentheme-bar-logo img.buentheme-logo-scrolled,
.buentheme-header-wrapper .buentheme-bar-logo .custom-logo.buentheme-logo-transparent,
.buentheme-header-wrapper .buentheme-bar-logo .custom-logo.buentheme-logo-scrolled,
.buentheme-header-wrapper .buentheme-drawer-brand__logo img.buentheme-logo-transparent,
.buentheme-header-wrapper .buentheme-drawer-brand__logo img.buentheme-logo-scrolled,
.buentheme-header-wrapper .buentheme-drawer-brand__logo .custom-logo.buentheme-logo-transparent,
.buentheme-header-wrapper .buentheme-drawer-brand__logo .custom-logo.buentheme-logo-scrolled {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    object-fit: contain !important;
    object-position: left center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    pointer-events: none !important;
    display: block !important;
    opacity: 0 !important;
    visibility: hidden !important;
    z-index: 1 !important;
    transform: none !important;
    /* Fuera del cálculo de altura de flex/grid */
    flex: none !important;
    align-self: auto !important;
}

/* Estado transparente (hero): muestra variante, oculta default solo visualmente */
.buentheme-header-wrapper.has-logo-transparent.is-style-transparent-header:not(.is-header-scrolled):not(.is-header-scrolled-visual) .buentheme-logo-default {
    opacity: 0 !important;
    /* sigue ocupando espacio → la fila no colapsa */
}
.buentheme-header-wrapper.has-logo-transparent.is-style-transparent-header:not(.is-header-scrolled):not(.is-header-scrolled-visual) img.buentheme-logo-transparent {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Estado scrolled: muestra logo scrolled encima */
.buentheme-header-wrapper.has-logo-scrolled.is-header-scrolled .buentheme-logo-default,
.buentheme-header-wrapper.has-logo-scrolled.is-header-scrolled-visual .buentheme-logo-default {
    opacity: 0 !important;
}
.buentheme-header-wrapper.has-logo-scrolled.is-header-scrolled img.buentheme-logo-scrolled,
.buentheme-header-wrapper.has-logo-scrolled.is-header-scrolled-visual img.buentheme-logo-scrolled {
    opacity: 1 !important;
    visibility: visible !important;
}
.buentheme-header-wrapper.has-logo-scrolled.is-header-scrolled img.buentheme-logo-transparent,
.buentheme-header-wrapper.has-logo-scrolled.is-header-scrolled-visual img.buentheme-logo-transparent {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* ==========================================================================
   Sprint 3 — Zonas de cabecera (roles de fila)
   .bt-header-zone + data-header-role / data-header-on-scroll
   ========================================================================== */

.buentheme-header-wrapper.has-header-zones {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.buentheme-header-wrapper .bt-header-zone {
    width: 100%;
    transition:
        max-height var(--buentheme-header-transition-ms, 300ms) cubic-bezier(0.16, 1, 0.3, 1),
        opacity var(--buentheme-header-transition-ms, 300ms) ease,
        padding var(--buentheme-header-transition-ms, 300ms) cubic-bezier(0.16, 1, 0.3, 1),
        margin var(--buentheme-header-transition-ms, 300ms) ease,
        border-width var(--buentheme-header-transition-ms, 300ms) ease,
        transform var(--buentheme-header-transition-ms, 300ms) ease;
}

/* Ocultar zona al scrollear (típica top bar) */
.buentheme-header-wrapper .bt-header-on-hide {
    max-height: 240px;
    opacity: 1;
    overflow: hidden;
    /* Contain layout so max-height collapse doesn't thrash sticky spacer / scrollY */
    contain: layout style;
    will-change: max-height, opacity;
}

.buentheme-header-wrapper .bt-header-on-hide.is-zone-hidden {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-top-width: 0 !important;
    border-bottom-width: 0 !important;
    pointer-events: none;
    /* Evitar que el fondo del row “parpadee” al colapsar */
    min-height: 0 !important;
    visibility: hidden;
}

/* Una vez colapsada, no participar en el flujo (evita micro-reflows del spacer) */
.buentheme-header-wrapper .bt-header-on-hide.is-zone-hidden {
    flex-shrink: 0;
}

/* Compactar zona (típica main) */
.buentheme-header-wrapper .bt-header-on-shrink.is-zone-shrunk {
    padding-top: var(--buentheme-header-shrink-padding, 12px) !important;
    padding-bottom: var(--buentheme-header-shrink-padding, 12px) !important;
}

.buentheme-header-wrapper .bt-header-on-shrink.is-zone-shrunk.buentheme-header-main,
.buentheme-header-wrapper .bt-header-role-main.bt-header-on-shrink.is-zone-shrunk {
    padding-top: var(--buentheme-header-shrink-padding, 12px) !important;
    padding-bottom: var(--buentheme-header-shrink-padding, 12px) !important;
}

/* Barra secundaria: oculta hasta scrollear (reveal) */
.buentheme-header-wrapper .bt-header-on-reveal {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-width: 0 !important;
    min-height: 0 !important;
    pointer-events: none;
}

.buentheme-header-wrapper .bt-header-on-reveal.is-zone-revealed {
    max-height: 200px;
    opacity: 1;
    pointer-events: auto;
    /* Restaurar padding del bloque (vars del row o fallback) */
    padding-top: var(--bt-row-pad-t, var(--wp--preset--spacing--20, 12px)) !important;
    padding-bottom: var(--bt-row-pad-b, var(--wp--preset--spacing--20, 12px)) !important;
    border-width: initial;
}

/* Rol sticky-bar: ligero énfasis visual cuando se revela */
.buentheme-header-wrapper .bt-header-role-sticky-bar.is-zone-revealed {
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

/* Editor: badge de rol en filas de cabecera */
.editor-styles-wrapper .bt-header-zone.is-in-header-editor,
.editor-styles-wrapper .buentheme-row.bt-header-zone {
    outline: 1px dashed transparent;
}

.editor-styles-wrapper .bt-header-zone.bt-header-role-top {
    outline-color: rgba(59, 130, 246, 0.35);
}

.editor-styles-wrapper .bt-header-zone.bt-header-role-main {
    outline-color: rgba(16, 185, 129, 0.4);
}

.editor-styles-wrapper .bt-header-zone.bt-header-role-bottom {
    outline-color: rgba(245, 158, 11, 0.4);
}

.editor-styles-wrapper .bt-header-zone.bt-header-role-sticky-bar {
    outline-color: rgba(168, 85, 247, 0.4);
}

@media (prefers-reduced-motion: reduce) {
    .buentheme-header-wrapper .bt-header-zone {
        transition: none !important;
    }
}

/* --- Sprint 2: sticky por dispositivo --- */
/* Desktop */
@media (min-width: 1025px) {
    .buentheme-header-wrapper.is-position-sticky:not(.sticky-on-desktop),
    .buentheme-header-wrapper.is-position-sticky.is-sticky-device-disabled[data-sticky-device="desktop"] {
        position: relative !important;
        top: auto !important;
    }

    .buentheme-header-wrapper.is-position-sticky:not(.sticky-on-desktop).is-style-transparent-header {
        position: absolute !important;
    }
}

/* Tablet */
@media (min-width: 782px) and (max-width: 1024px) {
    .buentheme-header-wrapper.is-position-sticky:not(.sticky-on-tablet),
    .buentheme-header-wrapper.is-position-sticky.is-sticky-device-disabled[data-sticky-device="tablet"] {
        position: relative !important;
        top: auto !important;
    }

    .buentheme-header-wrapper.is-position-sticky:not(.sticky-on-tablet).is-style-transparent-header {
        position: absolute !important;
    }
}

/* Mobile */
@media (max-width: 781px) {
    .buentheme-header-wrapper.is-position-sticky:not(.sticky-on-mobile),
    .buentheme-header-wrapper.is-position-sticky.is-sticky-device-disabled[data-sticky-device="mobile"] {
        position: relative !important;
        top: auto !important;
    }

    .buentheme-header-wrapper.is-position-sticky:not(.sticky-on-mobile).is-style-transparent-header {
        position: absolute !important;
    }
}

/* Spacer para modo sticky "después del scroll" (position fixed) */
.buentheme-header-spacer {
    display: none;
    width: 100%;
    flex-shrink: 0;
    pointer-events: none;
}

/* Fila Superior (Top Row) */
.buentheme-header-top {
    font-size: 13px;
    padding-top: var(--wp--preset--spacing--10) !important;
    padding-bottom: var(--wp--preset--spacing--10) !important;
    border-bottom: 1px solid var(--wp--preset--color--bg-3) !important;
}

/* Fila Principal (Main Row)
 * Padding vertical por defecto 0: el aire lo controla la Disposición de la fila
 * (--bt-row-pad-*). Antes el fallback 1.5rem se sumaba al padding de la fila
 * y parecía un “margen fantasma” al ajustar el logo.
 */
.buentheme-header-main {
    padding-top: var(--buentheme-header-main-pad-y, 0px);
    padding-bottom: var(--buentheme-header-main-pad-y, 0px);
    padding-left: var(--buentheme-global-padding, 1.25rem);
    padding-right: var(--buentheme-global-padding, 1.25rem);
    box-sizing: border-box;
    transition: padding var(--buentheme-header-transition-ms, 300ms) cubic-bezier(0.16, 1, 0.3, 1);
}

/* Si la main es una fila BuenTheme, el padding vertical es SOLO el de la fila */
.buentheme-header-wrapper .buentheme-header-main.buentheme-row,
.buentheme-header-wrapper .bt-header-role-main.buentheme-row,
.buentheme-header-wrapper .buentheme-header-main.buentheme-row-container,
.buentheme-header-wrapper .bt-header-role-main.buentheme-row-container {
    padding-top: var(--bt-row-pad-t, var(--buentheme-header-main-pad-y, 0px));
    padding-bottom: var(--bt-row-pad-b, var(--buentheme-header-main-pad-y, 0px));
}

/* Aire también en top/bottom del header si usan alignfull sin padding propio */
.buentheme-header-top,
.buentheme-header-bottom {
    padding-left: var(--buentheme-global-padding, 1.25rem);
    padding-right: var(--buentheme-global-padding, 1.25rem);
    box-sizing: border-box;
}

/* Hamburguesa: no pegar al borde del viewport */
.buentheme-header-wrapper .wp-block-navigation__responsive-container-open {
    margin: 0;
    flex-shrink: 0;
}

/*
 * Tamaño de logo (normal + comprimido).
 * - width / max-height reducen la caja real (a diferencia de transform:scale).
 * - Solo aplica al logo en flujo (no a duales absolute).
 */
.buentheme-header-wrapper .wp-block-site-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper .custom-logo-link img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper .buentheme-logo-default,
.buentheme-header-wrapper .buentheme-drawer-brand__logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper .buentheme-bar-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled) {
    height: auto !important;
    max-width: 100%;
    width: auto;
    max-height: var(--buentheme-header-logo-max-height, none);
    object-fit: contain;
    object-position: left center;
    transform: none !important;
    transform-origin: left center;
    transition:
        width var(--buentheme-header-transition-ms, 300ms) cubic-bezier(0.16, 1, 0.3, 1),
        max-width var(--buentheme-header-transition-ms, 300ms) cubic-bezier(0.16, 1, 0.3, 1),
        max-height var(--buentheme-header-transition-ms, 300ms) cubic-bezier(0.16, 1, 0.3, 1);
}

/* Compactar sin ancho fijo: reducir max-width de layout (no transform) */
.buentheme-header-wrapper.is-header-shrunk:not(.has-logo-width):not(.has-logo-width-shrunk) .wp-block-site-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.is-header-shrunk:not(.has-logo-width):not(.has-logo-width-shrunk) .custom-logo-link img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.is-header-shrunk:not(.has-logo-width):not(.has-logo-width-shrunk) .buentheme-logo-default,
.buentheme-header-wrapper.is-header-shrunk:not(.has-logo-width):not(.has-logo-width-shrunk) .buentheme-bar-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.is-header-shrunk:not(.has-logo-width):not(.has-logo-width-shrunk) .buentheme-drawer-brand__logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled) {
    max-width: calc(100% * var(--buentheme-header-logo-scale-shrunk, 0.85)) !important;
    width: auto !important;
}

/* Ancho normal (meta «Ancho del logotipo») — solo default en flujo */
.buentheme-header-wrapper.has-logo-width .wp-block-site-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.has-logo-width .custom-logo-link img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.has-logo-width .buentheme-logo-default,
.buentheme-header-wrapper.has-logo-width .buentheme-drawer-brand__logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.has-logo-width .buentheme-bar-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper[style*="--buentheme-header-logo-width"] .wp-block-site-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper[style*="--buentheme-header-logo-width"] .custom-logo-link img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper[style*="--buentheme-header-logo-width"] .buentheme-logo-default,
.buentheme-header-wrapper[style*="--buentheme-header-logo-width"] .buentheme-drawer-brand__logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper[style*="--buentheme-header-logo-width"] .buentheme-bar-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled) {
    width: var(--buentheme-header-logo-width) !important;
    max-width: min(100%, var(--buentheme-header-logo-width)) !important;
    height: auto !important;
    max-height: var(--buentheme-header-logo-max-height, none) !important;
}

/* También el wrapper del site-logo (algunos temas limitan el figure) */
.buentheme-header-wrapper.has-logo-width .wp-block-site-logo,
.buentheme-header-wrapper.has-logo-width .custom-logo-link,
.buentheme-header-wrapper[style*="--buentheme-header-logo-width"] .wp-block-site-logo,
.buentheme-header-wrapper[style*="--buentheme-header-logo-width"] .custom-logo-link {
    width: fit-content !important;
    max-width: min(100%, var(--buentheme-header-logo-width)) !important;
    height: auto !important;
    min-height: 0 !important;
}

/* Ancho al compactar / scroll — solo default en flujo */
.buentheme-header-wrapper.is-header-shrunk.has-logo-width-shrunk .wp-block-site-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.is-header-shrunk.has-logo-width-shrunk .custom-logo-link img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.is-header-shrunk.has-logo-width-shrunk .buentheme-logo-default,
.buentheme-header-wrapper.is-header-shrunk.has-logo-width-shrunk .buentheme-drawer-brand__logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.is-header-shrunk.has-logo-width-shrunk .buentheme-bar-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.is-header-shrunk[style*="--buentheme-header-logo-width-shrunk"] .wp-block-site-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.is-header-shrunk[style*="--buentheme-header-logo-width-shrunk"] .custom-logo-link img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.is-header-shrunk[style*="--buentheme-header-logo-width-shrunk"] .buentheme-logo-default,
.buentheme-header-wrapper.is-header-shrunk[style*="--buentheme-header-logo-width-shrunk"] .buentheme-drawer-brand__logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.is-header-shrunk[style*="--buentheme-header-logo-width-shrunk"] .buentheme-bar-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled) {
    width: var(--buentheme-header-logo-width-shrunk) !important;
    max-width: min(100%, var(--buentheme-header-logo-width-shrunk)) !important;
    height: auto !important;
    max-height: var(--buentheme-header-logo-max-height, none) !important;
}

.buentheme-header-wrapper.is-header-shrunk.has-logo-width-shrunk .wp-block-site-logo,
.buentheme-header-wrapper.is-header-shrunk.has-logo-width-shrunk .custom-logo-link,
.buentheme-header-wrapper.is-header-shrunk[style*="--buentheme-header-logo-width-shrunk"] .wp-block-site-logo,
.buentheme-header-wrapper.is-header-shrunk[style*="--buentheme-header-logo-width-shrunk"] .custom-logo-link {
    max-width: min(100%, var(--buentheme-header-logo-width-shrunk)) !important;
    height: auto !important;
    min-height: 0 !important;
}

/* Si hay ancho normal pero no comprimido, al shrink mantener el normal */
.buentheme-header-wrapper.is-header-shrunk.has-logo-width:not(.has-logo-width-shrunk) .wp-block-site-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.is-header-shrunk.has-logo-width:not(.has-logo-width-shrunk) .custom-logo-link img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-header-wrapper.is-header-shrunk.has-logo-width:not(.has-logo-width-shrunk) .buentheme-logo-default,
.buentheme-header-wrapper.is-header-shrunk.has-logo-width:not(.has-logo-width-shrunk) .buentheme-drawer-brand__logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled) {
    width: var(--buentheme-header-logo-width) !important;
    max-width: min(100%, var(--buentheme-header-logo-width)) !important;
}

/* Filas de cabecera: no forzar min-height por stretch del logo */
.buentheme-header-wrapper .buentheme-row,
.buentheme-header-wrapper .buentheme-row-container,
.buentheme-header-wrapper .bt-header-zone {
    min-height: 0;
}
.buentheme-header-wrapper .buentheme-row__grid > .buentheme-dynamic-section,
.buentheme-header-wrapper .buentheme-row-layout > .buentheme-dynamic-section {
    min-height: 0;
    align-self: center;
}

/*
 * Contenedor del logo: altura = solo el img default.
 * Evita que gap/flex de la sección o line-box “fantasma” sumen aire vertical.
 */
.buentheme-header-wrapper .wp-block-site-logo,
.buentheme-header-wrapper .buentheme-bar-logo,
.buentheme-header-wrapper .buentheme-drawer-brand__logo {
    align-self: center;
}
.buentheme-header-wrapper .wp-block-site-logo .custom-logo-link,
.buentheme-header-wrapper .buentheme-bar-logo .custom-logo-link,
.buentheme-header-wrapper .buentheme-drawer-brand__logo .custom-logo-link {
    /* relative ya definido arriba; anclar duales aquí */
    isolation: isolate;
}

.buentheme-header-wrapper .buentheme-header-branding {
    transition: gap var(--buentheme-header-transition-ms, 300ms) ease;
}

.buentheme-header-branding {
    align-items: center;
    gap: 12px;
}

.buentheme-header-navigation-actions {
    align-items: center;
    gap: 20px;
}

/* Soporte para el bloque Menú BuenTheme (buentheme/menu) cuando se usa dentro de cabeceras.
   Sprint M2: variables --bt-menu-* desde meta del CPT. */
.buentheme-menu-block,
.buentheme-menu-block.wp-block-navigation {
    display: flex;
    align-items: center;
    --bt-menu-gap: 1.25em;
    --bt-menu-font-size: inherit;
    --bt-menu-font-weight: inherit;
    --bt-menu-fg: inherit;
    --bt-menu-fg-hover: var(--wp--preset--color--accent-1, #3b82f6);
    --bt-menu-fg-active: var(--wp--preset--color--accent-1, #3b82f6);
    --bt-menu-dropdown-min-width: 220px;
    --bt-menu-dropdown-radius: 8px;
    --bt-menu-dropdown-bg: var(--wp--preset--color--bg-2, #ffffff);
    --bt-menu-cta-bg: var(--wp--preset--color--accent-1, #3b82f6);
    --bt-menu-cta-color: #ffffff;
}

.buentheme-menu-block ul,
.buentheme-menu-block .wp-block-navigation__container,
.buentheme-menu-block .wp-block-navigation-item {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Desktop / cerrado: una sola fila horizontal (sin wrap a 2 líneas) */
.buentheme-menu-block.wp-block-navigation > ul,
.buentheme-menu-block > ul,
.buentheme-menu-block .wp-block-navigation__container {
    display: flex;
    gap: var(--bt-menu-gap, 1.25em);
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
}

/* Overlay móvil abierto: siempre columna (evita menú “mal formado” horizontal) */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.wp-block-navigation-overlay.is-menu-open .wp-block-navigation__responsive-dialog,
.wp-block-navigation-overlay.is-menu-open .wp-block-navigation__responsive-container-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
}

.buentheme-menu-block .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
.buentheme-menu-block .wp-block-navigation__responsive-container.is-menu-open > ul,
.buentheme-menu-block .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content > ul,
.buentheme-menu-block .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog > ul,
.buentheme-menu-block .wp-block-navigation__responsive-container.is-menu-open ul,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content > ul,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog > ul,
.wp-block-navigation__responsive-container.is-menu-open ul.wp-block-navigation__container,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-page-list,
.wp-block-navigation-overlay.is-menu-open .wp-block-navigation__container,
.wp-block-navigation-overlay.is-menu-open ul.wp-block-navigation__container,
.wp-block-navigation-overlay.is-menu-open ul {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 0.15rem !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Submenús del overlay: también columna (no anular con row del desktop) */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container,
.wp-block-navigation-overlay.is-menu-open .wp-block-navigation__submenu-container {
    display: none;
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex-direction: column !important;
    box-shadow: none !important;
    border: none !important;
    left: auto !important;
    top: auto !important;
}

.buentheme-menu-block .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,
.wp-block-navigation__responsive-container.is-menu-open li,
.wp-block-navigation-overlay.is-menu-open .wp-block-navigation-item,
.wp-block-navigation-overlay.is-menu-open li {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    flex: 0 0 auto !important;
    float: none !important;
}

.buentheme-menu-block .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item > a,
.buentheme-menu-block .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item > a,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item > button,
.wp-block-navigation-overlay.is-menu-open .wp-block-navigation-item > a,
.wp-block-navigation-overlay.is-menu-open .wp-block-navigation-item__content,
.wp-block-navigation-overlay.is-menu-open .wp-block-navigation-item > button {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.85rem 0.5rem !important;
    box-sizing: border-box;
    white-space: normal !important;
}

.buentheme-menu-block a,
.buentheme-menu-block .wp-block-navigation-item__content {
    text-decoration: none;
    font-size: var(--bt-menu-font-size, inherit);
    font-weight: var(--bt-menu-font-weight, inherit);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Color base de items (nivel superior) — no fuerza submenús */
.buentheme-menu-block.has-menu-fg .wp-block-navigation__container > .wp-block-navigation-item > a,
.buentheme-menu-block.has-menu-fg .wp-block-navigation__container > .wp-block-navigation-item > button,
.buentheme-menu-block.has-menu-fg > ul > .wp-block-navigation-item > a {
    color: var(--bt-menu-fg, inherit);
}

/* Hover: solo color */
.buentheme-menu-block.has-menu-hover-color .wp-block-navigation__container > .wp-block-navigation-item > a:hover,
.buentheme-menu-block.has-menu-hover-color .wp-block-navigation__container > .wp-block-navigation-item > button:hover,
.buentheme-menu-block.has-menu-hover-color > ul > .wp-block-navigation-item > a:hover {
    color: var(--bt-menu-fg-hover, var(--wp--preset--color--accent-1, #3b82f6));
}

/* Hover: underline */
.buentheme-menu-block.has-menu-hover-underline .wp-block-navigation__container > .wp-block-navigation-item > a,
.buentheme-menu-block.has-menu-hover-underline > ul > .wp-block-navigation-item > a {
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0 2px;
    transition: background-size 0.2s ease, color 0.2s ease;
    padding-bottom: 2px;
}

.buentheme-menu-block.has-menu-hover-underline .wp-block-navigation__container > .wp-block-navigation-item > a:hover,
.buentheme-menu-block.has-menu-hover-underline > ul > .wp-block-navigation-item > a:hover {
    background-size: 100% 2px;
    color: var(--bt-menu-fg-hover, var(--bt-menu-fg, inherit));
}

/* Hover: fondo pill */
.buentheme-menu-block.has-menu-hover-bg .wp-block-navigation__container > .wp-block-navigation-item > a,
.buentheme-menu-block.has-menu-hover-bg > ul > .wp-block-navigation-item > a {
    padding: 6px 12px;
    border-radius: 6px;
}

.buentheme-menu-block.has-menu-hover-bg .wp-block-navigation__container > .wp-block-navigation-item > a:hover,
.buentheme-menu-block.has-menu-hover-bg > ul > .wp-block-navigation-item > a:hover {
    background-color: color-mix(in srgb, var(--bt-menu-fg-hover, #3b82f6) 12%, transparent);
    color: var(--bt-menu-fg-hover, var(--wp--preset--color--accent-1, #3b82f6));
}

/* Activo / current */
.buentheme-menu-block .wp-block-navigation-item.current-menu-item > a,
.buentheme-menu-block .wp-block-navigation-item.current-menu-ancestor > a,
.buentheme-menu-block .wp-block-navigation-item[class*="current"] > a,
.buentheme-menu-block .wp-block-navigation-item .wp-block-navigation-item__content[aria-current="page"] {
    color: var(--bt-menu-fg-active, var(--wp--preset--color--accent-1, #3b82f6));
    font-weight: 600;
}

/* CTA: último item de nivel superior como botón */
.buentheme-menu-block.has-menu-cta-last .wp-block-navigation__container > .wp-block-navigation-item:last-child > a,
.buentheme-menu-block.has-menu-cta-last > ul > .wp-block-navigation-item:last-child > a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    background-color: var(--bt-menu-cta-bg, var(--wp--preset--color--accent-1, #3b82f6)) !important;
    color: var(--bt-menu-cta-color, #ffffff) !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    text-decoration: none !important;
    background-image: none !important;
}

.buentheme-menu-block.has-menu-cta-last .wp-block-navigation__container > .wp-block-navigation-item:last-child > a:hover,
.buentheme-menu-block.has-menu-cta-last > ul > .wp-block-navigation-item:last-child > a:hover {
    filter: brightness(1.05);
    color: var(--bt-menu-cta-color, #ffffff) !important;
    background-color: var(--bt-menu-cta-bg, var(--wp--preset--color--accent-1, #3b82f6)) !important;
}

/* Estilos premium para los submenús de BuenTheme */
.buentheme-menu-block .wp-block-navigation__submenu-container {
    position: absolute !important;
    background-color: var(--bt-menu-dropdown-bg, var(--wp--preset--color--bg-2, #ffffff)) !important;
    border: 1px solid var(--wp--preset--color--bg-3, #e2e8f0) !important;
    border-radius: var(--bt-menu-dropdown-radius, 8px) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.08) !important;
    padding: 8px 0 !important;
    min-width: var(--bt-menu-dropdown-min-width, 220px) !important;
    margin-top: 12px !important;
}

/* Puente invisible para mantener el hover al mover el mouse desde el item padre al submenú */
.buentheme-menu-block .wp-block-navigation__submenu-container::before {
    content: "" !important;
    position: absolute !important;
    top: -20px !important;
    left: 0 !important;
    right: 0 !important;
    height: 20px !important;
    background: transparent !important;
    z-index: -1 !important;
}

.buentheme-menu-block .wp-block-navigation__submenu-container .wp-block-navigation-item {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.buentheme-menu-block .wp-block-navigation__submenu-container .wp-block-navigation-item a {
    display: block !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    color: var(--wp--preset--color--text-1, #1e293b) !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
    border-radius: 6px !important;
    margin: 2px 8px !important;
    font-weight: 400 !important;
    background-image: none !important;
}

.buentheme-menu-block .wp-block-navigation__submenu-container .wp-block-navigation-item a:hover {
    background-color: var(--wp--preset--color--bg-1, #f8fafc) !important;
    color: var(--bt-menu-fg-hover, var(--wp--preset--color--accent-1, #3b82f6)) !important;
    text-decoration: none !important;
}

/* Variantes por tipo */
.buentheme-menu-type-vertical,
.buentheme-menu-type-vertical.wp-block-navigation {
    flex-direction: column;
    align-items: flex-start;
}

.buentheme-menu-type-vertical > ul,
.buentheme-menu-type-vertical.wp-block-navigation > ul,
.buentheme-menu-type-vertical .wp-block-navigation__container {
    flex-direction: column;
    gap: var(--bt-menu-gap, 0.5em);
    align-items: flex-start;
}

/* CTA en vertical: full width del item */
.buentheme-menu-type-vertical.has-menu-cta-last .wp-block-navigation__container > .wp-block-navigation-item:last-child,
.buentheme-menu-type-vertical.has-menu-cta-last > ul > .wp-block-navigation-item:last-child {
    width: 100%;
    margin-top: 0.5em;
}

/* ==========================================================================
   Sprint M3 — Mega menú (paneles full-bleed + navigation clásico mejorado)
   ========================================================================== */

.buentheme-menu-type-mega-menu,
.buentheme-mega-menu {
    position: relative;
}

/* Items con hijos / panel */
.buentheme-menu-type-mega-menu .wp-block-navigation-item.has-child,
.buentheme-menu-type-mega-menu .wp-block-navigation-submenu,
.buentheme-mega-menu-item.has-mega-panel {
    position: relative;
}

/* Panel clásico (core/navigation submenu) en modo mega */
.buentheme-menu-type-mega-menu .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-container,
.buentheme-menu-type-mega-menu .wp-block-navigation-submenu > .wp-block-navigation__submenu-container {
    display: none;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    z-index: 1200 !important;
    min-width: min(640px, 92vw) !important;
    max-width: min(1100px, 96vw) !important;
    padding: 1.25rem 1.5rem !important;
    margin-top: 0.5rem !important;
    background: var(--bt-menu-dropdown-bg, var(--wp--preset--color--bg-2, #fff)) !important;
    border: 1px solid var(--wp--preset--color--bg-3, #e2e8f0) !important;
    border-radius: var(--bt-menu-dropdown-radius, 8px) !important;
    box-shadow:
        0 20px 40px -12px rgba(15, 23, 42, 0.14),
        0 8px 16px -8px rgba(15, 23, 42, 0.08) !important;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.25rem 1.5rem;
    box-sizing: border-box !important;
}

/* Cuando está abierto (JS o :focus-within) */
.buentheme-menu-type-mega-menu .wp-block-navigation-item.has-child.is-mega-open > .wp-block-navigation__submenu-container,
.buentheme-menu-type-mega-menu .wp-block-navigation-item.has-child:focus-within > .wp-block-navigation__submenu-container,
.buentheme-menu-type-mega-menu .wp-block-navigation-submenu.is-mega-open > .wp-block-navigation__submenu-container,
.buentheme-mega-menu-item.is-mega-open > .buentheme-mega-panel {
    display: grid !important;
}

.buentheme-mega-menu-item.is-mega-open > .buentheme-mega-panel {
    display: block !important;
}

/* Full-width: JS ajusta left/width; fallback CSS bajo el nav */
.buentheme-menu-type-mega-menu.has-mega-full-width .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-container,
.buentheme-mega-menu.has-mega-full-width .buentheme-mega-panel {
    border-radius: 0 0 var(--bt-menu-dropdown-radius, 8px) var(--bt-menu-dropdown-radius, 8px) !important;
}

/* Sub-links en panel mega clásico: una columna por item, no lista estrecha */
.buentheme-menu-type-mega-menu .wp-block-navigation__submenu-container > .wp-block-navigation-item {
    width: auto !important;
    min-width: 140px;
}

.buentheme-menu-type-mega-menu .wp-block-navigation__submenu-container > .wp-block-navigation-item > a {
    padding: 8px 10px !important;
    margin: 0 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
}

/* Contenido rico del panel (Disposición de fila, etc.) */
.buentheme-mega-panel__inner {
    width: 100%;
}

.buentheme-mega-panel__inner .buentheme-row,
.buentheme-mega-panel__inner .buentheme-row-container {
    max-width: 100%;
}

/* Evitar overflow hidden del header sobre paneles mega */
.buentheme-header-wrapper:has(.buentheme-menu-type-mega-menu),
.buentheme-header-wrapper:has(.buentheme-mega-menu) {
    overflow: visible !important;
}

@media (max-width: 781px) {
    .buentheme-menu-type-mega-menu .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-container,
    .buentheme-mega-panel {
        position: static !important;
        left: auto !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        box-shadow: none !important;
        grid-template-columns: 1fr !important;
    }
}

/* Efecto Sticky */
.buentheme-header-wrapper.is-position-sticky {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
}

/* Modo "después del scroll": empieza en flujo normal; JS activa fixed + spacer */
.buentheme-header-wrapper.is-position-sticky.is-sticky-after-scroll:not(.is-header-fixed-active) {
    position: relative !important;
    top: auto !important;
}

.buentheme-header-wrapper.is-position-sticky.is-sticky-after-scroll.is-header-fixed-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
}

/* Ajuste para evitar solapamientos con la barra de administración de WordPress */
.admin-bar .buentheme-header-wrapper.is-position-sticky {
    top: 32px !important;
}

.admin-bar .buentheme-header-wrapper.is-position-sticky.is-sticky-after-scroll:not(.is-header-fixed-active) {
    top: auto !important;
}

.admin-bar .buentheme-header-wrapper.is-position-sticky.is-sticky-after-scroll.is-header-fixed-active {
    top: 32px !important;
}

@media screen and (max-width: 782px) {
    .admin-bar .buentheme-header-wrapper.is-position-sticky {
        top: 46px !important;
    }

    .admin-bar .buentheme-header-wrapper.is-position-sticky.is-sticky-after-scroll:not(.is-header-fixed-active) {
        top: auto !important;
    }

    .admin-bar .buentheme-header-wrapper.is-position-sticky.is-sticky-after-scroll.is-header-fixed-active {
        top: 46px !important;
    }
}

/* Estado scrolled / sticky-active (compat + Sprint 1) */
.buentheme-header-wrapper.is-position-sticky.is-sticky-active,
.buentheme-header-wrapper.is-position-sticky.is-header-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    background-color: var(--buentheme-header-sticky-bg-rgba, var(--wp--preset--color--bg-2)) !important;
}

/* Shrink real: solo cuando el motor añade is-header-shrunk (meta shrink_enabled) */
.buentheme-header-wrapper.has-header-shrink.is-header-shrunk .buentheme-header-main {
    padding-top: var(--buentheme-header-shrink-padding, 12px) !important;
    padding-bottom: var(--buentheme-header-shrink-padding, 12px) !important;
}

/* Fallback legacy: si no hay data-shrink ni has-header-shrink, mantener shrink antiguo */
.buentheme-header-wrapper.is-position-sticky.is-sticky-active:not(.has-header-shrink):not([data-shrink]) .buentheme-header-main {
    padding-top: var(--wp--preset--spacing--20) !important;
    padding-bottom: var(--wp--preset--spacing--20) !important;
}

/* Hide on scroll down / reveal on scroll up */
.buentheme-header-wrapper.has-hide-on-scroll.is-header-hidden {
    transform: translateY(-100%);
    box-shadow: none !important;
    pointer-events: none;
}

.buentheme-header-wrapper.has-hide-on-scroll:not(.is-header-hidden) {
    transform: translateY(0);
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    .buentheme-header-wrapper,
    .buentheme-header-wrapper .buentheme-header-main,
    .buentheme-header-wrapper .wp-block-site-logo img,
    .buentheme-header-wrapper .custom-logo-link img,
    .buentheme-header-wrapper .custom-logo {
        transition: none !important;
    }

    .buentheme-header-wrapper.has-hide-on-scroll.is-header-hidden {
        transform: none;
        pointer-events: auto;
    }
}

/* Variación de Estilo de Bloque: Cabecera Transparente */
.buentheme-header-wrapper.is-style-transparent-header {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000 !important;
    background-color: var(--buentheme-header-trans-bg-rgba, transparent) !important;
    border-bottom: none !important;
}

.buentheme-header-wrapper.is-style-transparent-header .buentheme-header-top {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Ajuste automático para que el contenido empiece arriba si hay cabecera transparente activa */
body.has-transparent-header main,
body.has-transparent-header .wp-site-blocks > main {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Hacer que los bloques contenedores internos de la cabecera sean transparentes para que no bloqueen el fondo transparente/pegajoso */
.is-style-transparent-header .wp-block-group,
.is-style-transparent-header .wp-block-columns,
.is-style-transparent-header .wp-block-column,
.is-style-transparent-header .buentheme-row-container,
.is-style-transparent-header .buentheme-row-inner-wrapper,
.buentheme-header-wrapper.is-sticky-active .wp-block-group,
.buentheme-header-wrapper.is-sticky-active .wp-block-columns,
.buentheme-header-wrapper.is-sticky-active .wp-block-column,
.buentheme-header-wrapper.is-sticky-active .buentheme-row-container,
.buentheme-header-wrapper.is-sticky-active .buentheme-row-inner-wrapper {
    background-color: transparent !important;
    background: transparent !important;
}

/* Transición a Estado Sólido cuando es Sticky y está Activo (Scrolled) */
.is-style-transparent-header.is-position-sticky.is-sticky-active {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background-color: var(--buentheme-header-sticky-bg-rgba, var(--wp--preset--color--bg-2)) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    border-bottom: 1px solid var(--wp--preset--color--bg-3) !important;
}

.is-style-transparent-header.is-position-sticky.is-sticky-active .buentheme-header-top {
    border-bottom: 1px solid var(--wp--preset--color--bg-3) !important;
}

/* Soporte para borde inferior personalizado de la cabecera (sobrescribe estados transparentes y pegajosos) */
.buentheme-header-wrapper.has-custom-border,
.buentheme-header-wrapper.has-custom-border.is-sticky-active,
.buentheme-header-wrapper.has-custom-border.is-header-scrolled,
.is-style-transparent-header.is-position-sticky.is-sticky-active.has-custom-border {
    border-bottom: var(--buentheme-header-border-width, 1px) var(--buentheme-header-border-style, solid) var(--buentheme-header-border-color, #e2e8f0) !important;
}

/* ==========================================================================
   BREAKPOINTS PERSONALIZADOS PARA EL BLOQUE DE NAVEGACIÓN (FSE)
   ========================================================================== */

/*
 * Menú cerrado: ocultar botón X.
 * Chrome (logo+cuenta) en escritorio se integra en UNA fila con los links.
 */
.wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__responsive-container-close,
.wp-block-navigation-overlay:not(.is-menu-open) .wp-block-navigation__responsive-container-close {
    display: none !important;
}

/* ==========================================================================
   BARRA DE MENÚ — posiciones independientes (TODOS los breakpoints)
   Logo | Enlaces | Cuenta/Carrito | Hamburguesa
   Clases en <nav>: has-buentheme-bar-layout + bt-bar-logo-* + bt-bar-links-*
   + bt-bar-actions-* + bt-bar-toggle-*

   Importante:
   - Logo y acciones del slot (.buentheme-bar-logo / .buentheme-bar-actions)
     permanecen visibles en tablet/móvil (modo hamburguesa). Antes se ocultaban
     bajo el breakpoint y el logo solo aparecía al abrir el overlay.
   - El order de la hamburguesa aplica en todos los anchos (no solo ≥600px),
     para que no salte de derecha (tablet) a izquierda (móvil).
   ========================================================================== */

/* Slots de barra: base (visibles con has-buentheme-bar-layout). */
.buentheme-bar-logo,
.buentheme-bar-actions {
	display: none;
	align-items: center;
	flex: 0 0 auto;
	min-width: 0;
	gap: 4px;
	box-sizing: border-box;
}
.buentheme-bar-logo .buentheme-drawer-brand,
.buentheme-bar-logo .buentheme-drawer-brand__logo {
	display: flex !important;
	align-items: center;
	min-width: 0;
}
/* Solo logo en flujo — no forzar visible/altura en duales absolute */
.buentheme-bar-logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-bar-logo .custom-logo:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled) {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	height: auto !important;
	max-width: 100%;
	object-fit: contain;
}
.buentheme-bar-actions .buentheme-drawer-actions {
	display: flex !important;
	align-items: center;
	gap: 4px;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	width: auto !important;
}

/* Nav como flexbar: anula justify del bloque core (items-justified-*) */
.wp-block-navigation.buentheme-menu-block.has-buentheme-bar-layout,
.buentheme-menu-block.has-buentheme-bar-layout {
	position: relative !important;
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: flex-start !important;
	width: 100% !important;
	max-width: 100% !important;
	gap: 0.75rem !important;
	box-sizing: border-box !important;
}

/*
 * Slots SIEMPRE visibles con layout de barra (escritorio, tablet y móvil).
 * Incluye has-breakpoint-always (hamburguesa permanente).
 */
.wp-block-navigation.has-buentheme-bar-layout > .buentheme-bar-logo,
.wp-block-navigation.has-buentheme-bar-layout > .buentheme-bar-actions,
.buentheme-menu-block.has-buentheme-bar-layout > .buentheme-bar-logo,
.buentheme-menu-block.has-buentheme-bar-layout > .buentheme-bar-actions {
	display: flex !important;
}

/* Respetar “ocultar” en meta de barra */
.wp-block-navigation.has-buentheme-bar-layout.bt-bar-logo-hide > .buentheme-bar-logo,
.buentheme-menu-block.has-buentheme-bar-layout.bt-bar-logo-hide > .buentheme-bar-logo {
	display: none !important;
}
.wp-block-navigation.has-buentheme-bar-layout.bt-bar-actions-hide > .buentheme-bar-actions,
.buentheme-menu-block.has-buentheme-bar-layout.bt-bar-actions-hide > .buentheme-bar-actions {
	display: none !important;
}

/* Chrome interno del drawer: solo con menú abierto (evita logo duplicado en desktop cerrado) */
.wp-block-navigation.has-buentheme-bar-layout
	.wp-block-navigation__responsive-container:not(.is-menu-open)
	.buentheme-drawer-chrome {
	display: none !important;
}

/* —— Posiciones (todos los breakpoints) —— */
.bt-bar-logo-left > .buentheme-bar-logo {
	order: 1;
	margin-inline-end: 0.25rem;
}
.bt-bar-logo-center > .buentheme-bar-logo {
	order: 20;
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	pointer-events: auto;
}
.bt-bar-logo-right > .buentheme-bar-logo {
	order: 40;
}

/* Hamburguesa: order + empuje al borde (si no, un solo ítem queda a la izquierda) */
.bt-bar-toggle-left > .wp-block-navigation__responsive-container-open {
	order: 0;
	margin-inline-end: 0.5rem;
	margin-inline-start: 0;
}
.bt-bar-toggle-right > .wp-block-navigation__responsive-container-open {
	order: 50;
	margin-inline-start: auto;
}

/* Si hay acciones a la derecha + toggle a la derecha, el auto va en acciones */
.bt-bar-actions-right.bt-bar-toggle-right > .buentheme-bar-actions {
	order: 40;
	margin-inline-start: auto;
}
.bt-bar-actions-right.bt-bar-toggle-right > .wp-block-navigation__responsive-container-open {
	margin-inline-start: 0;
}

/* Enlaces (escritorio / sobre el breakpoint) */
.bt-bar-links-left > .wp-block-navigation__responsive-container:not(.is-menu-open),
.bt-bar-links-center > .wp-block-navigation__responsive-container:not(.is-menu-open),
.bt-bar-links-right > .wp-block-navigation__responsive-container:not(.is-menu-open) {
	order: 10;
	flex: 1 1 auto !important;
}
.bt-bar-links-left > .wp-block-navigation__responsive-container:not(.is-menu-open) {
	justify-content: flex-start !important;
}
.bt-bar-links-center > .wp-block-navigation__responsive-container:not(.is-menu-open) {
	justify-content: center !important;
}
.bt-bar-links-right > .wp-block-navigation__responsive-container:not(.is-menu-open) {
	justify-content: flex-end !important;
}
.bt-bar-links-left > .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container,
.bt-bar-links-left > .wp-block-navigation__responsive-container:not(.is-menu-open) ul {
	justify-content: flex-start !important;
	margin-inline: 0 !important;
}
.bt-bar-links-center > .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container,
.bt-bar-links-center > .wp-block-navigation__responsive-container:not(.is-menu-open) ul {
	justify-content: center !important;
	margin-inline: auto !important;
}
.bt-bar-links-right > .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container,
.bt-bar-links-right > .wp-block-navigation__responsive-container:not(.is-menu-open) ul {
	justify-content: flex-end !important;
	margin-inline-left: auto !important;
	margin-inline-right: 0 !important;
}

/* Acciones */
.bt-bar-actions-left > .buentheme-bar-actions {
	order: 2;
}
.bt-bar-actions-center > .buentheme-bar-actions {
	order: 15;
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
}
.bt-bar-actions-right > .buentheme-bar-actions {
	order: 30;
}

/* Escritorio: contenedor de enlaces en fila (sin arrastrar logo/acciones de los slots) */
@media (min-width: 600px) {
	.wp-block-navigation.has-buentheme-bar-layout:not(.has-breakpoint-always)
		.wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		width: auto !important;
		max-width: none !important;
		min-width: 0 !important;
		height: auto !important;
		margin: 0 !important;
		padding: 0 !important;
		background: transparent !important;
		box-shadow: none !important;
		overflow: visible !important;
		position: static !important;
		inset: auto !important;
	}
	.wp-block-navigation.has-buentheme-bar-layout:not(.has-breakpoint-always)
		.wp-block-navigation__responsive-container:not(.is-menu-open)
		.wp-block-navigation__responsive-close,
	.wp-block-navigation.has-buentheme-bar-layout:not(.has-breakpoint-always)
		.wp-block-navigation__responsive-container:not(.is-menu-open)
		.wp-block-navigation__responsive-dialog,
	.wp-block-navigation.has-buentheme-bar-layout:not(.has-breakpoint-always)
		.wp-block-navigation__responsive-container:not(.is-menu-open)
		.wp-block-navigation__responsive-container-content {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		width: auto !important;
		max-width: none !important;
		height: auto !important;
		margin: 0 !important;
		padding: 0 !important;
		background: transparent !important;
		box-shadow: none !important;
		overflow: visible !important;
		position: static !important;
		inset: auto !important;
	}
	.wp-block-navigation.has-buentheme-bar-layout:not(.has-breakpoint-always)
		.wp-block-navigation__responsive-container:not(.is-menu-open)
		.wp-block-navigation__container,
	.wp-block-navigation.has-buentheme-bar-layout:not(.has-breakpoint-always)
		.wp-block-navigation__responsive-container:not(.is-menu-open)
		ul {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		gap: var(--bt-menu-gap, 1.25em) !important;
		width: auto !important;
		margin: 0 !important;
	}

	/*
	 * Desktop: si el toggle está oculto y hay enlaces, no empujar acciones
	 * con margin-auto del toggle (está display:none). Las acciones right
	 * ya se alinean vía order; los enlaces flex:1 rellenan el centro.
	 */
	.bt-bar-actions-right:not(.has-breakpoint-always) > .buentheme-bar-actions {
		margin-inline-start: 0;
	}
}

/* Legacy fallback (sin has-buentheme-bar-layout): una fila con chrome aplanado */
@media (min-width: 600px) {
    .wp-block-navigation:not(.has-buentheme-bar-layout):not(.has-breakpoint-always) .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 1rem !important;
        width: 100% !important;
    }
    .wp-block-navigation:not(.has-buentheme-bar-layout):not(.has-breakpoint-always) .wp-block-navigation__responsive-container:not(.is-menu-open) .buentheme-drawer-chrome {
        display: contents !important;
    }
    .wp-block-navigation:not(.has-buentheme-bar-layout):not(.has-breakpoint-always) .wp-block-navigation__responsive-container:not(.is-menu-open) .buentheme-drawer-brand {
        order: 1;
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        min-width: 0;
    }
    .wp-block-navigation:not(.has-buentheme-bar-layout):not(.has-breakpoint-always) .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__responsive-close,
    .wp-block-navigation:not(.has-buentheme-bar-layout):not(.has-breakpoint-always) .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__responsive-dialog,
    .wp-block-navigation:not(.has-buentheme-bar-layout):not(.has-breakpoint-always) .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__responsive-container-content {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        order: 2;
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
        position: static !important;
        inset: auto !important;
    }
    .wp-block-navigation:not(.has-buentheme-bar-layout):not(.has-breakpoint-always) .wp-block-navigation__responsive-container:not(.is-menu-open) .buentheme-drawer-actions {
        order: 3;
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        margin-left: auto !important;
        gap: 4px !important;
    }
    .wp-block-navigation:not(.has-buentheme-bar-layout):not(.has-breakpoint-always) .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container,
    .wp-block-navigation:not(.has-buentheme-bar-layout):not(.has-breakpoint-always) .wp-block-navigation__responsive-container:not(.is-menu-open) ul {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: var(--bt-menu-gap, 1.25em) !important;
        width: auto !important;
    }
}

@media (min-width: 782px) {
    .wp-block-navigation.has-breakpoint-782:not(.has-buentheme-bar-layout) .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 1rem !important;
        width: 100% !important;
    }
    .wp-block-navigation.has-breakpoint-782:not(.has-buentheme-bar-layout) .wp-block-navigation__responsive-container:not(.is-menu-open) .buentheme-drawer-chrome {
        display: contents !important;
    }
    .wp-block-navigation.has-breakpoint-782:not(.has-buentheme-bar-layout) .wp-block-navigation__responsive-container:not(.is-menu-open) .buentheme-drawer-brand {
        order: 1;
        flex: 0 0 auto !important;
    }
    .wp-block-navigation.has-breakpoint-782:not(.has-buentheme-bar-layout) .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__responsive-close,
    .wp-block-navigation.has-breakpoint-782:not(.has-buentheme-bar-layout) .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__responsive-dialog,
    .wp-block-navigation.has-breakpoint-782:not(.has-buentheme-bar-layout) .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__responsive-container-content {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        order: 2;
        flex: 1 1 auto !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
        position: static !important;
    }
    .wp-block-navigation.has-breakpoint-782:not(.has-buentheme-bar-layout) .wp-block-navigation__responsive-container:not(.is-menu-open) .buentheme-drawer-actions {
        order: 3;
        flex: 0 0 auto !important;
        margin-left: auto !important;
    }
    .wp-block-navigation.has-breakpoint-782:not(.has-buentheme-bar-layout) .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }
}

/* ==========================================================================
   BREAKPOINTS — default WP es 600px; el tema usa has-breakpoint-N (siempre
   se añade, p.ej. has-breakpoint-782) para alinear con el CPT de menú.
   ========================================================================== */

/* Fallback sin clase: mismo comportamiento que 600px de core */
@media (min-width: 600px) {
    .wp-block-navigation:not([class*="has-breakpoint-"]):not(.has-breakpoint-always) .wp-block-navigation__responsive-container-open:not(.always-shown) {
        display: none !important;
    }
    .wp-block-navigation:not([class*="has-breakpoint-"]):not(.has-breakpoint-always) .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: flex !important;
        position: relative !important;
        width: auto !important;
        height: auto !important;
        inset: auto !important;
        background: transparent !important;
        transform: none !important;
        opacity: 1 !important;
        overflow: visible !important;
        z-index: auto !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
}
@media (max-width: 599px) {
    .wp-block-navigation:not([class*="has-breakpoint-"]) .wp-block-navigation__responsive-container-open {
        display: flex !important;
    }
    .wp-block-navigation:not([class*="has-breakpoint-"]) .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: none !important;
    }
}

/* --- 1. Breakpoint: 600px --- */
@media (min-width: 600px) {
    .wp-block-navigation.has-breakpoint-600 .wp-block-navigation__responsive-container-open:not(.always-shown) {
        display: none !important;
    }
    .wp-block-navigation.has-breakpoint-600 .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: flex !important;
        position: relative !important;
        inset: auto !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        transform: none !important;
        opacity: 1 !important;
        overflow: visible !important;
        z-index: auto !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
}
@media (max-width: 599px) {
    .wp-block-navigation.has-breakpoint-600 .wp-block-navigation__responsive-container-open {
        display: flex !important;
    }
    .wp-block-navigation.has-breakpoint-600 .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: none !important;
    }
}

/* Desktop closed helper (sin display:contents — rompe Interactivity API / clicks) */
/* --- 2. 768 --- */
@media (min-width: 768px) {
    .wp-block-navigation.has-breakpoint-768 .wp-block-navigation__responsive-container-open:not(.always-shown) { display: none !important; }
    .wp-block-navigation.has-breakpoint-768 .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: flex !important; position: relative !important; inset: auto !important;
        width: auto !important; height: auto !important; background: transparent !important;
        transform: none !important; opacity: 1 !important; overflow: visible !important;
        z-index: auto !important; padding: 0 !important; box-shadow: none !important;
    }
}
@media (max-width: 767px) {
    .wp-block-navigation.has-breakpoint-768 .wp-block-navigation__responsive-container-open { display: flex !important; }
    .wp-block-navigation.has-breakpoint-768 .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
}

/* --- 2b. 782 (default BuenTheme / menú CPT) --- */
@media (min-width: 782px) {
    .wp-block-navigation.has-breakpoint-782 .wp-block-navigation__responsive-container-open:not(.always-shown) { display: none !important; }
    .wp-block-navigation.has-breakpoint-782 .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: flex !important; position: relative !important; inset: auto !important;
        width: auto !important; height: auto !important; background: transparent !important;
        transform: none !important; opacity: 1 !important; overflow: visible !important;
        z-index: auto !important; padding: 0 !important; box-shadow: none !important;
    }
}
@media (max-width: 781px) {
    .wp-block-navigation.has-breakpoint-782 .wp-block-navigation__responsive-container-open { display: flex !important; }
    .wp-block-navigation.has-breakpoint-782 .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
}

/* --- 3. 992 --- */
@media (min-width: 992px) {
    .wp-block-navigation.has-breakpoint-992 .wp-block-navigation__responsive-container-open:not(.always-shown) { display: none !important; }
    .wp-block-navigation.has-breakpoint-992 .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: flex !important; position: relative !important; inset: auto !important;
        width: auto !important; height: auto !important; background: transparent !important;
        transform: none !important; opacity: 1 !important; overflow: visible !important;
        z-index: auto !important; padding: 0 !important; box-shadow: none !important;
    }
}
@media (max-width: 991px) {
    .wp-block-navigation.has-breakpoint-992 .wp-block-navigation__responsive-container-open { display: flex !important; }
    .wp-block-navigation.has-breakpoint-992 .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
}

/* --- 4. 1024 --- */
@media (min-width: 1024px) {
    .wp-block-navigation.has-breakpoint-1024 .wp-block-navigation__responsive-container-open:not(.always-shown) { display: none !important; }
    .wp-block-navigation.has-breakpoint-1024 .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: flex !important; position: relative !important; inset: auto !important;
        width: auto !important; height: auto !important; background: transparent !important;
        transform: none !important; opacity: 1 !important; overflow: visible !important;
        z-index: auto !important; padding: 0 !important; box-shadow: none !important;
    }
}
@media (max-width: 1023px) {
    .wp-block-navigation.has-breakpoint-1024 .wp-block-navigation__responsive-container-open { display: flex !important; }
    .wp-block-navigation.has-breakpoint-1024 .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
}

/* --- 5. 1200 --- */
@media (min-width: 1200px) {
    .wp-block-navigation.has-breakpoint-1200 .wp-block-navigation__responsive-container-open:not(.always-shown) { display: none !important; }
    .wp-block-navigation.has-breakpoint-1200 .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: flex !important; position: relative !important; inset: auto !important;
        width: auto !important; height: auto !important; background: transparent !important;
        transform: none !important; opacity: 1 !important; overflow: visible !important;
        z-index: auto !important; padding: 0 !important; box-shadow: none !important;
    }
}
@media (max-width: 1199px) {
    .wp-block-navigation.has-breakpoint-1200 .wp-block-navigation__responsive-container-open { display: flex !important; }
    .wp-block-navigation.has-breakpoint-1200 .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
}

/* --- 6. Breakpoint: siempre (.has-breakpoint-always) --- */
.wp-block-navigation.has-breakpoint-always .wp-block-navigation__responsive-container-open {
    display: flex !important;
}
.wp-block-navigation.has-breakpoint-always .wp-block-navigation__responsive-container:not(.is-menu-open) {
    display: none !important;
}

/* --- 7. Breakpoint: nunca (.has-breakpoint-never) --- */
.wp-block-navigation.has-breakpoint-never .wp-block-navigation__responsive-container-open {
    display: none !important;
}
.wp-block-navigation.has-breakpoint-never .wp-block-navigation__responsive-container:not(.is-menu-open) {
    display: flex !important;
}

/* Sprint M5 / E4 — overflow solo donde hace falta (no * global). */
.buentheme-header-wrapper,
.buentheme-header-wrapper .buentheme-menu-block,
.buentheme-header-wrapper .wp-block-navigation,
.buentheme-header-wrapper .wp-block-navigation__container,
.buentheme-header-wrapper .wp-block-navigation-item,
.buentheme-header-wrapper .buentheme-mega-menu,
.buentheme-header-wrapper .buentheme-mega-menu__list,
.buentheme-header-wrapper .buentheme-row-container,
.buentheme-header-wrapper .buentheme-row-inner-wrapper {
    overflow: visible;
}

/* Restaurar scroll en overlay móvil abierto */
.wp-block-navigation__responsive-container.is-menu-open,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.wp-block-navigation-overlay.is-menu-open {
    overflow: auto !important;
}

/* ==========================================================================
   PERSONALIZACIÓN DE FONDO DE MENÚ DE SUPERPOSICIÓN (OVERLAY) Y GLASSMORPHISM
   ========================================================================== */

/* Configurar transiciones para efectos y animaciones de superposición */
.wp-block-navigation__responsive-container,
.wp-block-navigation-overlay {
    transition: transform var(--buentheme-overlay-anim-duration, 0.28s) cubic-bezier(0.16, 1, 0.3, 1), 
                opacity var(--buentheme-overlay-anim-duration, 0.28s) ease-in-out,
                backdrop-filter var(--buentheme-overlay-anim-duration, 0.28s) ease-in-out !important;
}

/* Fondo por defecto del modal abierto — sólido (nunca heredar transparente del header) */
.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open,
.wp-block-navigation.has-modal-open .wp-block-navigation__responsive-container,
.wp-block-navigation .wp-block-navigation-overlay.is-menu-open {
    background-color: var(--buentheme-overlay-bg-color, var(--wp--preset--color--bg-2, #fff)) !important;
    backdrop-filter: blur(var(--buentheme-overlay-blur, 0px)) !important;
    -webkit-backdrop-filter: blur(var(--buentheme-overlay-blur, 0px)) !important;
    color: var(--wp--preset--color--text-1, #1e293b);
}

/* Fondo para el menú de superposición en cabeceras transparentes cuando no hay variable de color explícita */
.buentheme-header-wrapper.is-style-transparent-header .wp-block-navigation__responsive-container.is-menu-open:not([style*="--buentheme-overlay-bg-color"]),
.buentheme-header-wrapper.is-style-transparent-header .wp-block-navigation-overlay.is-menu-open:not([style*="--buentheme-overlay-bg-color"]) {
    background-color: var(--buentheme-header-trans-bg-solid, var(--wp--preset--color--bg-2)) !important;
}

/* Fondo para el menú de superposición en cabeceras pegajosas (sticky) cuando no hay variable de color explícita */
.buentheme-header-wrapper.is-sticky-active .wp-block-navigation__responsive-container.is-menu-open:not([style*="--buentheme-overlay-bg-color"]),
.buentheme-header-wrapper.is-sticky-active .wp-block-navigation-overlay.is-menu-open:not([style*="--buentheme-overlay-bg-color"]) {
    background-color: var(--buentheme-header-sticky-bg-solid, var(--wp--preset--color--bg-2)) !important;
}

/* --- CLASES DE ANIMACIÓN PARA SUPERPOSICIÓN MÓVIL --- */
/* Solo en contenedores MODAL (hidden-by-default) y CERRADOS.
   Nunca en el menú de escritorio always-shown (rompe layout y “parece sin estilos”). */
.wp-block-navigation__responsive-container.hidden-by-default.buentheme-overlay-anim-slide-right:not(.is-menu-open),
.wp-block-navigation-overlay.hidden-by-default.buentheme-overlay-anim-slide-right:not(.is-menu-open) {
    transform: translateX(100%);
    opacity: 0;
}
.wp-block-navigation__responsive-container.hidden-by-default.buentheme-overlay-anim-slide-left:not(.is-menu-open),
.wp-block-navigation-overlay.hidden-by-default.buentheme-overlay-anim-slide-left:not(.is-menu-open) {
    transform: translateX(-100%);
    opacity: 0;
}
.wp-block-navigation__responsive-container.hidden-by-default.buentheme-overlay-anim-fade:not(.is-menu-open),
.wp-block-navigation-overlay.hidden-by-default.buentheme-overlay-anim-fade:not(.is-menu-open) {
    opacity: 0;
}
.wp-block-navigation__responsive-container.hidden-by-default.buentheme-overlay-anim-scale:not(.is-menu-open),
.wp-block-navigation-overlay.hidden-by-default.buentheme-overlay-anim-scale:not(.is-menu-open) {
    transform: scale(0.92);
    opacity: 0;
}

/* --- REESTABLECER ESTADOS EN ESCRITORIO (MIN-WIDTH) PARA CADA BREAKPOINT --- */

/* Reset para Breakpoint: 600px */
@media (min-width: 600px) {
    .wp-block-navigation.has-breakpoint-600 .wp-block-navigation__responsive-container {
        transform: none !important;
        opacity: 1 !important;
    }
}

/* Reset para Breakpoint: 768px */
@media (min-width: 768px) {
    .wp-block-navigation.has-breakpoint-768 .wp-block-navigation__responsive-container {
        transform: none !important;
        opacity: 1 !important;
    }
}

/* Reset para Breakpoint por defecto de WordPress: 782px (bloques sin clase de breakpoint) */
@media (min-width: 782px) {
    .wp-block-navigation:not([class*="has-breakpoint-"]) .wp-block-navigation__responsive-container {
        transform: none !important;
        opacity: 1 !important;
    }
}

/* Reset para Breakpoint: 992px */
@media (min-width: 992px) {
    .wp-block-navigation.has-breakpoint-992 .wp-block-navigation__responsive-container {
        transform: none !important;
        opacity: 1 !important;
    }
}

/* Reset para Breakpoint: 1024px */
@media (min-width: 1024px) {
    .wp-block-navigation.has-breakpoint-1024 .wp-block-navigation__responsive-container {
        transform: none !important;
        opacity: 1 !important;
    }
}

/* Reset para Breakpoint: 1200px */
@media (min-width: 1200px) {
    .wp-block-navigation.has-breakpoint-1200 .wp-block-navigation__responsive-container {
        transform: none !important;
        opacity: 1 !important;
    }
}

/* Reset para Breakpoint: nunca (has-breakpoint-never) - Se aplica siempre */
.wp-block-navigation.has-breakpoint-never .wp-block-navigation__responsive-container {
    transform: none !important;
    opacity: 1 !important;
}

/* Breakpoint always: animación solo en modal cerrado (hidden-by-default) */
.wp-block-navigation.has-breakpoint-always .wp-block-navigation__responsive-container.hidden-by-default.buentheme-overlay-anim-slide-right:not(.is-menu-open),
.wp-block-navigation.has-breakpoint-always .wp-block-navigation-overlay.hidden-by-default.buentheme-overlay-anim-slide-right:not(.is-menu-open) {
    transform: translateX(100%);
    opacity: 0;
}
.wp-block-navigation.has-breakpoint-always .wp-block-navigation__responsive-container.hidden-by-default.buentheme-overlay-anim-slide-left:not(.is-menu-open),
.wp-block-navigation.has-breakpoint-always .wp-block-navigation-overlay.hidden-by-default.buentheme-overlay-anim-slide-left:not(.is-menu-open) {
    transform: translateX(-100%);
    opacity: 0;
}
.wp-block-navigation.has-breakpoint-always .wp-block-navigation__responsive-container.hidden-by-default.buentheme-overlay-anim-fade:not(.is-menu-open),
.wp-block-navigation.has-breakpoint-always .wp-block-navigation-overlay.hidden-by-default.buentheme-overlay-anim-fade:not(.is-menu-open) {
    opacity: 0;
}
.wp-block-navigation.has-breakpoint-always .wp-block-navigation__responsive-container.hidden-by-default.buentheme-overlay-anim-scale:not(.is-menu-open),
.wp-block-navigation.has-breakpoint-always .wp-block-navigation-overlay.hidden-by-default.buentheme-overlay-anim-scale:not(.is-menu-open) {
    transform: scale(0.92);
    opacity: 0;
}

/*
 * ESTADO ABIERTO — modal a pantalla completa.
 * Importante: no depende de .buentheme-menu-block padre.
 * Liberamos containing-block del header (transform/filter) vía body.buentheme-nav-open.
 */
.wp-block-navigation__responsive-container.is-menu-open,
.wp-block-navigation.has-modal-open .wp-block-navigation__responsive-container,
.wp-block-navigation-overlay.is-menu-open {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    width: 100vw !important;
    height: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 100000 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    opacity: 1 !important;
    box-sizing: border-box !important;
    overflow: hidden !important; /* el scroll va al panel/dialog */
}

/* Admin bar: no tapar la barra de WP */
.admin-bar .wp-block-navigation__responsive-container.is-menu-open,
.admin-bar .wp-block-navigation.has-modal-open .wp-block-navigation__responsive-container,
.admin-bar .wp-block-navigation-overlay.is-menu-open {
    top: 32px !important;
    height: calc(100vh - 32px) !important;
    height: calc(100dvh - 32px) !important;
}
@media screen and (max-width: 782px) {
    .admin-bar .wp-block-navigation__responsive-container.is-menu-open,
    .admin-bar .wp-block-navigation.has-modal-open .wp-block-navigation__responsive-container,
    .admin-bar .wp-block-navigation-overlay.is-menu-open {
        top: 46px !important;
        height: calc(100vh - 46px) !important;
        height: calc(100dvh - 46px) !important;
    }
}

/*
 * Liberar containing block del header mientras el menú está abierto.
 * Solo el wrapper (y wrappers de layout intermedios), NUNCA * (rompe logo/menú).
 * transform / filter / backdrop-filter en ancestros atrapan position:fixed.
 */
html.buentheme-nav-open .buentheme-header-wrapper,
body.buentheme-nav-open .buentheme-header-wrapper,
body.buentheme-nav-open .buentheme-header-wrapper.has-hide-on-scroll,
body.buentheme-nav-open .buentheme-header-wrapper.is-header-hidden,
body.buentheme-nav-open .buentheme-header-wrapper.has-header-blur,
body.buentheme-nav-open .buentheme-header-wrapper.is-position-sticky,
body.buentheme-nav-open .buentheme-header-wrapper.is-style-transparent-header,
body.buentheme-nav-open .buentheme-header-wrapper.is-header-fixed-active,
body.buentheme-nav-open .buentheme-header-wrapper > .wp-block-group,
body.buentheme-nav-open .buentheme-header-wrapper .buentheme-row-container,
body.buentheme-nav-open .buentheme-header-wrapper .buentheme-row-inner-wrapper {
    transform: none !important;
    will-change: auto !important;
    filter: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    perspective: none !important;
    contain: none !important;
}

/* --- ALTERNANCIA RESPONSIVA DE MENÚS (ESCRITORIO VS MÓVIL ALTERNATIVO) --- */
/* Sprint M4: unificado vía data-mobile-bp en .buentheme-menu-pair (default 782). */
.buentheme-menu-wrapper-mobile {
    display: none !important;
}
.buentheme-menu-wrapper-desktop {
    display: block !important;
}

.buentheme-menu-pair {
    display: contents; /* los wrappers siguen siendo hijos lógicos */
}

/* Por defecto / data-mobile-bp="782" */
@media (max-width: 781px) {
    .buentheme-menu-pair[data-mobile-bp="782"] .buentheme-menu-wrapper-desktop,
    .buentheme-menu-pair:not([data-mobile-bp]) .buentheme-menu-wrapper-desktop {
        display: none !important;
    }
    .buentheme-menu-pair[data-mobile-bp="782"] .buentheme-menu-wrapper-mobile,
    .buentheme-menu-pair:not([data-mobile-bp]) .buentheme-menu-wrapper-mobile {
        display: block !important;
    }
}
@media (max-width: 599px) {
    .buentheme-menu-pair[data-mobile-bp="600"] .buentheme-menu-wrapper-desktop { display: none !important; }
    .buentheme-menu-pair[data-mobile-bp="600"] .buentheme-menu-wrapper-mobile { display: block !important; }
}
@media (max-width: 767px) {
    .buentheme-menu-pair[data-mobile-bp="768"] .buentheme-menu-wrapper-desktop { display: none !important; }
    .buentheme-menu-pair[data-mobile-bp="768"] .buentheme-menu-wrapper-mobile { display: block !important; }
}
@media (max-width: 991px) {
    .buentheme-menu-pair[data-mobile-bp="992"] .buentheme-menu-wrapper-desktop { display: none !important; }
    .buentheme-menu-pair[data-mobile-bp="992"] .buentheme-menu-wrapper-mobile { display: block !important; }
}
@media (max-width: 1023px) {
    .buentheme-menu-pair[data-mobile-bp="1024"] .buentheme-menu-wrapper-desktop { display: none !important; }
    .buentheme-menu-pair[data-mobile-bp="1024"] .buentheme-menu-wrapper-mobile { display: block !important; }
}
@media (max-width: 1199px) {
    .buentheme-menu-pair[data-mobile-bp="1200"] .buentheme-menu-wrapper-desktop { display: none !important; }
    .buentheme-menu-pair[data-mobile-bp="1200"] .buentheme-menu-wrapper-mobile { display: block !important; }
}

/* Fallback legacy :has() si no hay pair (contenido antiguo) */
@media (max-width: 781px) {
    .buentheme-menu-wrapper-desktop:not(.buentheme-menu-pair .buentheme-menu-wrapper-desktop) {
        /* no-op: solo wrappers sueltos con has-breakpoint */
    }
}
.buentheme-menu-wrapper-desktop:has(.has-breakpoint-always) {
    display: none !important;
}
.buentheme-menu-wrapper-desktop:has(.has-breakpoint-always) + .buentheme-menu-wrapper-mobile {
    display: block !important;
}

/* ==========================================================================
   Sprint M4 — Off-canvas premium (drawer / fullscreen / top)
   ========================================================================== */

/* Body scroll lock */
html.buentheme-nav-open,
body.buentheme-nav-open {
    overflow: hidden !important;
}
body.buentheme-nav-open {
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}

/* Chrome del drawer (logo + iconos nativos WC) — en overlay abierto ocupa 100%.
   En escritorio cerrado el media query de arriba usa display:contents + width:auto. */
.buentheme-drawer-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--wp--preset--color--bg-3, #e2e8f0);
    width: 100%;
    box-sizing: border-box;
}
.wp-block-navigation__responsive-container.is-menu-open .buentheme-drawer-chrome {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    border-bottom: 1px solid var(--wp--preset--color--bg-3, #e2e8f0) !important;
    padding: 4px 4px 16px !important;
    margin-bottom: 8px !important;
}
.buentheme-drawer-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
}
.buentheme-drawer-brand__logo .custom-logo-link,
.buentheme-drawer-brand__logo a {
    position: relative !important;
    display: block !important;
    align-items: initial;
    line-height: 0;
    max-width: 100%;
    width: fit-content;
    height: auto;
    min-height: 0;
}
/* Solo default en flujo; duales absolute (ver bloque dual logo arriba) */
.buentheme-drawer-brand__logo .custom-logo-link img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-drawer-brand__logo img:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled),
.buentheme-drawer-brand__logo .custom-logo:not(.buentheme-logo-transparent):not(.buentheme-logo-scrolled) {
    display: block !important;
    /* Default suave; si hay --buentheme-header-logo-width gana la regla .has-logo-width */
    max-height: var(--buentheme-header-logo-max-height, 80px);
    max-width: min(100%, var(--buentheme-header-logo-width, 160px));
    width: var(--buentheme-header-logo-width, auto);
    height: auto !important;
    object-fit: contain !important;
    /* No transform:scale — no reduce la caja de layout y “infla” la fila */
    transform: none !important;
    transform-origin: left center;
    margin: 0 !important;
    padding: 0 !important;
}
.buentheme-drawer-brand__title {
    font-weight: 700;
    font-size: 1.05rem;
    color: inherit;
    text-decoration: none;
}

/* Acciones nativas: mini-cart + customer-account
 *
 * El mini-cart se inyecta con render_block() desde el gestor de menús (no como
 * bloque en el template). Los estilos de WooCommerce a veces no llegan a la
 * página (combine/UCSS LiteSpeed o encolado tardío) y el SVG queda sin tamaño
 * ni fill fiable: al hover se ve el recuadro del botón vacío. Forzamos color,
 * fill y dimensiones aquí para que el icono sea siempre visible.
 */
.buentheme-drawer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex: 0 0 auto;
    margin-left: auto;
}
.buentheme-drawer-actions .wp-block-woocommerce-mini-cart,
.buentheme-drawer-actions .wp-block-woocommerce-customer-account,
.buentheme-drawer-actions .wc-block-mini-cart,
.buentheme-drawer-actions .wc-block-customer-account {
    display: inline-flex !important;
    align-items: center;
    margin: 0 !important;
}
.buentheme-drawer-actions .wc-block-mini-cart__button,
.buentheme-bar-actions .wc-block-mini-cart__button,
.wc-block-mini-cart .wc-block-mini-cart__button,
.buentheme-drawer-actions .wc-block-customer-account__account-icon,
.buentheme-drawer-actions .wc-block-customer-account a,
.buentheme-drawer-actions a.buentheme-drawer-action--account-fallback,
.buentheme-drawer-actions a.buentheme-drawer-action--cart-fallback {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    min-width: 40px;
    padding: 0.35rem !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 8px;
    text-decoration: none !important;
    /* Header fg (si hay) → color de menú → color heredado del chrome */
    color: var(--buentheme-header-fg, var(--bt-menu-fg, inherit)) !important;
    font-size: 16px;
    line-height: 1;
    /* Invitados / Delay JS: el icono debe ser siempre clickeable */
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 6 !important;
}
.buentheme-drawer-actions .wc-block-mini-cart__button:hover,
.buentheme-bar-actions .wc-block-mini-cart__button:hover,
.wc-block-mini-cart .wc-block-mini-cart__button:hover,
.wp-block-woocommerce-mini-cart .wc-block-mini-cart__button:hover,
.wc-block-mini-cart__button:hover,
.buentheme-drawer-actions .wc-block-customer-account a:hover,
.buentheme-drawer-actions a.buentheme-drawer-action--account-fallback:hover,
.buentheme-drawer-actions a.buentheme-drawer-action--cart-fallback:hover {
    background: var(--wp--preset--color--bg-3, rgba(15, 23, 42, 0.08)) !important;
}

/* Transiciones e interactividad en hover para botón, icono y badge */
.wc-block-mini-cart__button {
    transition: background-color 0.2s ease, transform 0.2s ease !important;
}
.wc-block-mini-cart__badge {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, filter 0.2s ease !important;
}
.wc-block-mini-cart__button:hover .wc-block-mini-cart__badge,
.wc-block-mini-cart__badge:hover {
    transform: scale(1.15) !important;
    filter: brightness(1.1);
}
.wc-block-mini-cart__button:hover .wc-block-mini-cart__icon {
    transform: scale(1.06);
    transition: transform 0.2s ease;
}
/*
 * Contenedor del icono + badge: ancla de posición.
 * Debe medir solo el icono (24×24) para que top/right del badge
 * queden siempre en la esquina superior derecha, con o sin CSS de WC.
 */
.buentheme-drawer-actions .wc-block-mini-cart__quantity-badge,
.buentheme-bar-actions .wc-block-mini-cart__quantity-badge,
.wc-block-mini-cart .wc-block-mini-cart__quantity-badge {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    flex: 0 0 24px !important;
    line-height: 0 !important;
    overflow: visible !important;
}

/*
 * Badge del mini-cart (contador).
 *
 * WC usa left:100% + margin-left:-44% + translateY(-50%) → el punto de anclaje
 * cambia según si el CSS de WC carga (reload) o solo el nuestro (AJAX).
 * Anclamos con top/right fijos al contenedor del icono (esquina sup. derecha).
 *
 * Colores: paleta del tema (accent-1 / text-3).
 * Override: --buentheme-mini-cart-badge-bg / --buentheme-mini-cart-badge-fg.
 */
.buentheme-drawer-actions .wc-block-mini-cart__badge,
.buentheme-bar-actions .wc-block-mini-cart__badge,
.wc-block-mini-cart .wc-block-mini-cart__badge {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    /* Esquina superior derecha del icono (anclaje estable vs left%/translate de WC) */
    top: -5px !important;
    right: -7px !important;
    left: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    transform: none !important;
    z-index: 2 !important;
    min-width: 1.15rem !important;
    width: auto !important;
    height: 1.15rem !important;
    padding: 0 0.28rem !important;
    border-radius: 999px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    /* Paleta del tema (misma lógica que botones accent) */
    background-color: var(
        --buentheme-mini-cart-badge-bg,
        var(--wp--preset--color--accent-1, hsl(220, 90%, 56%))
    ) !important;
    color: var(
        --buentheme-mini-cart-badge-fg,
        var(--wp--preset--color--text-3, #ffffff)
    ) !important;
}

/* Sin ítems: no círculo vacío (ni texto ni pastilla) */
.buentheme-drawer-actions .wc-block-mini-cart__badge[hidden],
.buentheme-bar-actions .wc-block-mini-cart__badge[hidden],
.wc-block-mini-cart .wc-block-mini-cart__badge[hidden],
.buentheme-drawer-actions .wc-block-mini-cart__badge:empty,
.buentheme-bar-actions .wc-block-mini-cart__badge:empty,
.wc-block-mini-cart .wc-block-mini-cart__badge:empty {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    min-width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/*
 * Carrito / checkout / pedido recibido: ocultar badge por completo.
 * Excluir explícitamente tienda/catálogo/ficha por si el body arrastra clases raras.
 */
body.woocommerce-cart:not(.woocommerce-shop):not(.post-type-archive-product):not(.single-product) .wc-block-mini-cart__badge,
body.woocommerce-checkout:not(.woocommerce-shop):not(.single-product) .wc-block-mini-cart__badge,
body.woocommerce-order-received .wc-block-mini-cart__badge,
body.woocommerce-cart:not(.woocommerce-shop):not(.post-type-archive-product):not(.single-product) .buentheme-drawer-actions .wc-block-mini-cart__badge,
body.woocommerce-checkout:not(.woocommerce-shop):not(.single-product) .buentheme-drawer-actions .wc-block-mini-cart__badge,
body.woocommerce-order-received .buentheme-drawer-actions .wc-block-mini-cart__badge,
body.woocommerce-cart:not(.woocommerce-shop):not(.post-type-archive-product):not(.single-product) .buentheme-bar-actions .wc-block-mini-cart__badge,
body.woocommerce-checkout:not(.woocommerce-shop):not(.single-product) .buentheme-bar-actions .wc-block-mini-cart__badge,
body.woocommerce-order-received .buentheme-bar-actions .wc-block-mini-cart__badge {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    min-width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* Tienda / catálogo / ficha: el badge debe poder mostrarse (anula ocultados residuales) */
body.woocommerce-shop .wc-block-mini-cart__badge:not([hidden]):not(:empty),
body.post-type-archive-product .wc-block-mini-cart__badge:not([hidden]):not(:empty),
body.tax-product_cat .wc-block-mini-cart__badge:not([hidden]):not(:empty),
body.tax-product_tag .wc-block-mini-cart__badge:not([hidden]):not(:empty),
body.single-product .wc-block-mini-cart__badge:not([hidden]):not(:empty),
body.buentheme-wc-catalog .wc-block-mini-cart__badge:not([hidden]):not(:empty) {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    min-width: 1.15rem !important;
    height: 1.15rem !important;
    padding: 0 0.28rem !important;
    overflow: visible !important;
}

/*
 * Variables del drawer mini-cart (WC).
 * NO tocar left/transform del panel: WC anima con left:100% + translateX.
 * Forzar transform:translateX(0) o right:0 rompía la animación (overshoot).
 */
.wc-block-components-drawer__screen-overlay,
[data-wp-key="wc-mini-cart-overlay"],
.wc-block-mini-cart__drawer {
    --drawer-width: 480px;
    --neg-drawer-width: -480px;
}

/* Icono del carrito: tamaño + fill aunque falte mini-cart.css de WC */
.buentheme-drawer-actions .wc-block-mini-cart__icon,
.buentheme-bar-actions .wc-block-mini-cart__icon {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    margin: 0 !important;
    flex: 0 0 auto;
    color: inherit !important;
    fill: currentColor !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.buentheme-drawer-actions .wc-block-mini-cart__icon *,
.buentheme-bar-actions .wc-block-mini-cart__icon * {
    fill: currentColor !important;
    stroke: none;
}
/* Icono de cuenta (SVG nativo WC) */
.buentheme-drawer-actions .wc-block-customer-account svg,
.buentheme-drawer-actions .wc-block-customer-account__account-icon svg,
.buentheme-bar-actions .wc-block-customer-account svg,
.buentheme-bar-actions .wc-block-customer-account__account-icon svg {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    color: inherit !important;
    fill: currentColor !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.buentheme-drawer-actions .wc-block-customer-account svg *,
.buentheme-drawer-actions .wc-block-customer-account__account-icon svg *,
.buentheme-bar-actions .wc-block-customer-account svg *,
.buentheme-bar-actions .wc-block-customer-account__account-icon svg * {
    fill: currentColor !important;
}
/* Header con color de primer plano: mismos iconos que la hamburguesa */
.buentheme-header-wrapper.has-header-fg-default .buentheme-drawer-actions .wc-block-mini-cart__button,
.buentheme-header-wrapper.has-header-fg-scrolled .buentheme-drawer-actions .wc-block-mini-cart__button,
.buentheme-header-wrapper.has-header-fg-default .buentheme-drawer-actions .wc-block-customer-account a,
.buentheme-header-wrapper.has-header-fg-scrolled .buentheme-drawer-actions .wc-block-customer-account a,
.buentheme-header-wrapper.has-header-fg-default .buentheme-drawer-actions a.buentheme-drawer-action--account-fallback,
.buentheme-header-wrapper.has-header-fg-scrolled .buentheme-drawer-actions a.buentheme-drawer-action--account-fallback,
.buentheme-header-wrapper.has-header-fg-default .buentheme-drawer-actions a.buentheme-drawer-action--cart-fallback,
.buentheme-header-wrapper.has-header-fg-scrolled .buentheme-drawer-actions a.buentheme-drawer-action--cart-fallback {
    color: var(--buentheme-header-fg, inherit) !important;
}
.buentheme-header-wrapper.has-header-fg-default .buentheme-drawer-actions .wc-block-mini-cart__icon,
.buentheme-header-wrapper.has-header-fg-scrolled .buentheme-drawer-actions .wc-block-mini-cart__icon,
.buentheme-header-wrapper.has-header-fg-default .buentheme-drawer-actions .wc-block-customer-account svg,
.buentheme-header-wrapper.has-header-fg-scrolled .buentheme-drawer-actions .wc-block-customer-account svg {
    color: var(--buentheme-header-fg, inherit) !important;
    fill: var(--buentheme-header-fg, currentColor) !important;
}
.buentheme-drawer-actions .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
    line-height: 1;
}

/* Evitar que el flex horizontal del menú afecte a los iconos del chrome */
.buentheme-drawer-chrome,
.buentheme-drawer-actions {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
}

/* Drawer: panel lateral con ancho variable */
.wp-block-navigation__responsive-container.buentheme-overlay-mode-drawer.is-menu-open,
.wp-block-navigation-overlay.buentheme-overlay-mode-drawer.is-menu-open {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    align-items: stretch !important;
    justify-content: flex-end !important; /* panel a la derecha por defecto */
}
.wp-block-navigation__responsive-container.buentheme-overlay-mode-drawer.is-menu-open .wp-block-navigation__responsive-close,
.wp-block-navigation__responsive-container.buentheme-overlay-mode-drawer.is-menu-open .wp-block-navigation__responsive-dialog {
    width: min(var(--buentheme-overlay-width, 85%), 420px) !important;
    max-width: 100% !important;
    height: 100% !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    background-color: var(--buentheme-overlay-bg-color, var(--wp--preset--color--bg-2, #fff)) !important;
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}
.wp-block-navigation__responsive-container.buentheme-overlay-mode-drawer.is-menu-open .wp-block-navigation__responsive-container-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 1.25rem 1.25rem 2rem !important;
    overflow: auto !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    background-color: transparent !important;
    box-shadow: none !important;
}
/* Si no hay .responsive-close wrapper (estructura WP variable), el content es el panel */
.wp-block-navigation__responsive-container.buentheme-overlay-mode-drawer.is-menu-open > .wp-block-navigation__responsive-container-content {
    width: min(var(--buentheme-overlay-width, 85%), 420px) !important;
    margin-left: auto !important;
    background-color: var(--buentheme-overlay-bg-color, var(--wp--preset--color--bg-2, #fff)) !important;
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
}
/* Drawer desde la izquierda cuando anim es slide-left */
.wp-block-navigation__responsive-container.buentheme-overlay-mode-drawer.buentheme-overlay-anim-slide-left.is-menu-open {
    justify-content: flex-start !important;
}
.wp-block-navigation__responsive-container.buentheme-overlay-mode-drawer.buentheme-overlay-anim-slide-left.is-menu-open .wp-block-navigation__responsive-close,
.wp-block-navigation__responsive-container.buentheme-overlay-mode-drawer.buentheme-overlay-anim-slide-left.is-menu-open .wp-block-navigation__responsive-dialog,
.wp-block-navigation__responsive-container.buentheme-overlay-mode-drawer.buentheme-overlay-anim-slide-left.is-menu-open > .wp-block-navigation__responsive-container-content {
    margin-left: 0 !important;
    margin-right: auto !important;
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.18);
}

/* Fullscreen */
.wp-block-navigation__responsive-container.buentheme-overlay-mode-fullscreen.is-menu-open,
.wp-block-navigation-overlay.buentheme-overlay-mode-fullscreen.is-menu-open {
    background-color: var(--buentheme-overlay-bg-color, var(--wp--preset--color--bg-2, #fff)) !important;
}
.wp-block-navigation__responsive-container.buentheme-overlay-mode-fullscreen.is-menu-open .wp-block-navigation__responsive-dialog,
.wp-block-navigation__responsive-container.buentheme-overlay-mode-fullscreen.is-menu-open .wp-block-navigation__responsive-container-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    padding: 1.5rem !important;
    overflow: auto !important;
}

/* Panel top */
.wp-block-navigation__responsive-container.buentheme-overlay-mode-top.is-menu-open {
    align-items: flex-start !important;
    background: rgba(15, 23, 42, 0.4) !important;
}
.wp-block-navigation__responsive-container.buentheme-overlay-mode-top.is-menu-open .wp-block-navigation__responsive-dialog,
.wp-block-navigation__responsive-container.buentheme-overlay-mode-top.is-menu-open .wp-block-navigation__responsive-container-content {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: min(85vh, 720px) !important;
    margin: 0 !important;
    border-radius: 0 0 16px 16px;
    background-color: var(--buentheme-overlay-bg-color, var(--wp--preset--color--bg-2, #fff)) !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
    padding: 1.25rem 1.5rem 1.75rem !important;
    overflow: auto !important;
}
.wp-block-navigation__responsive-container.buentheme-overlay-mode-top.buentheme-overlay-anim-slide-right,
.wp-block-navigation__responsive-container.buentheme-overlay-mode-top.buentheme-overlay-anim-slide-left {
    transform: translateY(-100%);
    opacity: 0;
}
.wp-block-navigation__responsive-container.buentheme-overlay-mode-top.is-menu-open {
    transform: translateY(0) scale(1) !important;
    opacity: 1 !important;
}

/* Accordion submenús en overlay móvil */
.buentheme-overlay-accordion .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-container,
.buentheme-overlay-accordion .buentheme-mega-menu-item.has-mega-panel > .buentheme-mega-panel {
    display: none !important;
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0.35rem 0 0.35rem 0.75rem !important;
    background: transparent !important;
}
.buentheme-overlay-accordion .wp-block-navigation-item.has-child.is-acc-open > .wp-block-navigation__submenu-container,
.buentheme-overlay-accordion .buentheme-mega-menu-item.has-mega-panel.is-acc-open > .buentheme-mega-panel {
    display: block !important;
}
.buentheme-overlay-accordion .wp-block-navigation-item.has-child > a,
.buentheme-overlay-accordion .wp-block-navigation-item.has-child > button {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.buentheme-overlay-accordion .wp-block-navigation-item.has-child > a::after,
.buentheme-overlay-accordion .buentheme-mega-menu-item.has-mega-panel > a::after {
    content: "";
    width: 0.45em;
    height: 0.45em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    opacity: 0.7;
    flex-shrink: 0;
    margin-left: 0.5rem;
}
.buentheme-overlay-accordion .wp-block-navigation-item.has-child.is-acc-open > a::after,
.buentheme-overlay-accordion .buentheme-mega-menu-item.has-mega-panel.is-acc-open > a::after {
    transform: rotate(-135deg);
}

/* Hamburguesa → X */
.buentheme-hamburger {
    position: relative;
}
.buentheme-hamburger-bars {
    display: none;
    width: var(--buentheme-hamburger-icon-size, 24px);
    height: var(--buentheme-hamburger-icon-size, 24px);
    position: relative;
}
.buentheme-hamburger-bars span {
    position: absolute;
    left: 15%;
    right: 15%;
    height: var(--buentheme-hamburger-line-thickness, 2px);
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}
.buentheme-hamburger-bars span:nth-child(1) { top: 28%; }
.buentheme-hamburger-bars span:nth-child(2) { top: 48%; }
.buentheme-hamburger-bars span:nth-child(3) { top: 68%; }

/* Si hay barras CSS, ocultar SVG nativo opcionalmente cuando open */
.buentheme-hamburger.is-open .buentheme-hamburger-bars,
.buentheme-hamburger:not(.is-open) .buentheme-hamburger-bars {
    display: inline-block;
}
.buentheme-hamburger.is-open svg {
    opacity: 0;
    position: absolute;
    width: 0 !important;
    height: 0 !important;
}
.buentheme-hamburger:not(.is-open) svg {
    /* mantener SVG cerrado si se prefiere; barras también visibles para transición uniforme */
}
.buentheme-hamburger .buentheme-hamburger-bars {
    display: inline-block;
}
.buentheme-hamburger:not(.is-open) svg {
    display: none;
}
.buentheme-hamburger.is-open .buentheme-hamburger-bars span:nth-child(1) {
    top: 48%;
    transform: rotate(45deg);
}
.buentheme-hamburger.is-open .buentheme-hamburger-bars span:nth-child(2) {
    opacity: 0;
}
.buentheme-hamburger.is-open .buentheme-hamburger-bars span:nth-child(3) {
    top: 48%;
    transform: rotate(-45deg);
}

.buentheme-lazy-mobile-slot:empty {
    min-height: 0;
}

/* ==========================================================================
   Sprint M5 — Badges, iconos, active trail, drawer actions
   ========================================================================== */

.buentheme-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.35em;
    vertical-align: middle;
    font-size: 1.1em;
    line-height: 1;
}
.buentheme-nav-icon.dashicons {
    width: 1.1em;
    height: 1.1em;
    font-size: 1.1em;
}
.buentheme-nav-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 0.4em;
    padding: 0.1em 0.45em;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
}
.buentheme-nav-badge--accent {
    background: color-mix(in srgb, var(--wp--preset--color--accent-1, #3b82f6) 18%, transparent);
    color: var(--wp--preset--color--accent-1, #2563eb);
}
.buentheme-nav-badge--success {
    background: #dcfce7;
    color: #15803d;
}
.buentheme-nav-badge--warning {
    background: #fef3c7;
    color: #b45309;
}
.buentheme-nav-badge--danger {
    background: #fee2e2;
    color: #b91c1c;
}
.buentheme-nav-badge--neutral {
    background: #f1f5f9;
    color: #475569;
}

/* Active trail */
.buentheme-menu-block .wp-block-navigation-item.current-menu-item > a,
.buentheme-menu-block .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content,
.buentheme-menu-block a.current-menu-item,
.buentheme-mega-menu-item.current-menu-item > a {
    color: var(--bt-menu-fg-active, var(--wp--preset--color--accent-1, #3b82f6));
    font-weight: 600;
}
.buentheme-menu-block .wp-block-navigation-item.current-menu-ancestor > a {
    color: var(--bt-menu-fg-active, var(--wp--preset--color--accent-1, #3b82f6));
}

/* Legacy text buttons (por si quedan en caché vieja) — ocultar en favor de bloques nativos */
.buentheme-drawer-action:not(.wp-block-woocommerce-mini-cart):not(.wp-block-woocommerce-customer-account) {
    /* se mantiene por compat; preferir bloques WC */
}

/* ==========================================================================
   PERSONALIZACIÓN DE ICONO HAMBURGUESA (FSE)
   ========================================================================== */

/* Botón de apertura (hamburguesa) */
.wp-block-navigation .wp-block-navigation__responsive-container-open {
    color: var(--buentheme-hamburger-color) !important;
    background-color: var(--buentheme-hamburger-bg) !important;
    padding: var(--buentheme-hamburger-padding) !important;
    border-radius: 4px !important;
    transition: all 0.25s ease-in-out;
}

/* Forzar que el SVG herede el color del texto si se ha especificado y aplicar tamaño */
.wp-block-navigation .wp-block-navigation__responsive-container-open svg {
    fill: currentColor !important;
    width: var(--buentheme-hamburger-icon-size, 24px) !important;
    height: var(--buentheme-hamburger-icon-size, 24px) !important;
    transition: width 0.25s ease, height 0.25s ease;
}

/* Modificar las líneas (rects) del SVG del menú */
.wp-block-navigation .wp-block-navigation__responsive-container-open svg rect {
    width: var(--buentheme-hamburger-line-width, 16px) !important;
    x: calc(12px - (var(--buentheme-hamburger-line-width, 16px) / 2)) !important;
    height: var(--buentheme-hamburger-line-thickness, 1.5px) !important;
    transition: width 0.25s ease, x 0.25s ease, height 0.25s ease;
}

/* ============================================================================
   MEJORAS DE UI PARA WOOCOMMERCE
   ============================================================================ */

/* Avisos nativos (store-notices + clásicos) */
.wp-block-woocommerce-store-notices,
.wc-block-store-notices,
.woocommerce-notices-wrapper,
.buentheme-wc-notices {
	display: block;
	width: 100%;
	margin: 0 0 1rem;
	box-sizing: border-box;
}
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wc-block-components-notice-banner {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	border-radius: 10px;
	padding: 0.85rem 1rem;
}
.woocommerce-message,
.wc-block-components-notice-banner.is-success {
	border-left: 4px solid var(--wp--preset--color--accent-1, #16a34a);
	background: color-mix(in srgb, var(--wp--preset--color--accent-1, #16a34a) 10%, #fff);
	color: inherit;
}
.woocommerce-error,
.wc-block-components-notice-banner.is-error {
	border-left: 4px solid #dc2626;
	background: color-mix(in srgb, #dc2626 10%, #fff);
}
.woocommerce-info,
.wc-block-components-notice-banner.is-info {
	border-left: 4px solid var(--wp--preset--color--accent-1, #3b82f6);
	background: color-mix(in srgb, var(--wp--preset--color--accent-1, #3b82f6) 10%, #fff);
}

/* Toast de feedback al añadir (no sustituye store-notices) */
.buentheme-cart-toast {
	position: fixed;
	z-index: 100050;
	max-width: min(360px, calc(100vw - 1.5rem));
	pointer-events: none;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	box-sizing: border-box;
}
.buentheme-cart-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}
.buentheme-cart-toast--top-right {
	top: max(1rem, env(safe-area-inset-top, 0px));
	right: max(1rem, env(safe-area-inset-right, 0px));
}
.buentheme-cart-toast--top-center {
	top: max(1rem, env(safe-area-inset-top, 0px));
	left: 50%;
	transform: translate(-50%, 8px);
}
.buentheme-cart-toast--top-center.is-visible {
	transform: translate(-50%, 0);
}
.buentheme-cart-toast--bottom-right {
	bottom: max(1rem, env(safe-area-inset-bottom, 0px));
	right: max(1rem, env(safe-area-inset-right, 0px));
}
.buentheme-cart-toast--bottom-center {
	bottom: max(1rem, env(safe-area-inset-bottom, 0px));
	left: 50%;
	transform: translate(-50%, 8px);
}
.buentheme-cart-toast--bottom-center.is-visible {
	transform: translate(-50%, 0);
}
/* Móvil: barra inferior casi full-width (JS añade .buentheme-cart-toast--mobile) */
.buentheme-cart-toast.buentheme-cart-toast--mobile {
	left: 0.75rem;
	right: 0.75rem;
	bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
	top: auto;
	max-width: none;
	width: auto;
	transform: translateY(12px);
}
.buentheme-cart-toast.buentheme-cart-toast--mobile.is-visible {
	transform: translateY(0);
}
/* Por si el media query CSS se aplica sin clase JS (CSS de respaldo) */
@media (max-width: 599px) {
	.buentheme-cart-toast.buentheme-cart-toast--bottom-center,
	.buentheme-cart-toast.buentheme-cart-toast--top-right,
	.buentheme-cart-toast.buentheme-cart-toast--top-center,
	.buentheme-cart-toast.buentheme-cart-toast--bottom-right {
		left: 0.75rem;
		right: 0.75rem;
		top: auto;
		bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
		max-width: none;
		width: auto;
		transform: translateY(12px);
	}
	.buentheme-cart-toast.buentheme-cart-toast--bottom-center.is-visible,
	.buentheme-cart-toast.buentheme-cart-toast--top-right.is-visible,
	.buentheme-cart-toast.buentheme-cart-toast--top-center.is-visible,
	.buentheme-cart-toast.buentheme-cart-toast--bottom-right.is-visible {
		transform: translateY(0);
	}
	.buentheme-cart-toast__inner {
		padding: 0.95rem 1rem;
		border-radius: 14px;
		align-items: center;
		/* Zona táctil cómoda */
		min-height: 52px;
	}
	.buentheme-cart-toast__msg {
		font-size: 0.95rem;
	}
	.buentheme-cart-toast__link {
		font-size: 0.9rem;
		padding: 0.15rem 0;
		/* Área de toque mayor */
		min-height: 44px;
		display: inline-flex;
		align-items: center;
	}
	.buentheme-cart-toast__close {
		min-width: 44px;
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		font-size: 1.4rem;
	}
}
.buentheme-cart-toast__inner {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	padding: 0.85rem 0.9rem;
	border-radius: 12px;
	background: var(--wp--preset--color--bg-2, #fff);
	color: var(--wp--preset--color--fg-1, #0f172a);
	border: 1px solid var(--wp--preset--color--bg-3, rgba(15, 23, 42, 0.1));
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.16);
}
.buentheme-cart-toast__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 999px;
	flex: 0 0 auto;
	color: #fff;
	background: var(--wp--preset--color--accent-1, #16a34a);
}
.buentheme-cart-toast__body {
	flex: 1 1 auto;
	min-width: 0;
}
.buentheme-cart-toast__msg {
	margin: 0;
	font-size: 0.925rem;
	font-weight: 600;
	line-height: 1.35;
}
.buentheme-cart-toast__link {
	display: inline-block;
	margin-top: 0.25rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--wp--preset--color--accent-1, #3b82f6);
	text-decoration: none;
}
.buentheme-cart-toast__link:hover {
	text-decoration: underline;
}
.buentheme-cart-toast__close {
	appearance: none;
	border: 0;
	background: transparent;
	color: inherit;
	opacity: 0.55;
	cursor: pointer;
	font-size: 1.25rem;
	line-height: 1;
	padding: 0 0.15rem;
	flex: 0 0 auto;
}
.buentheme-cart-toast__close:hover {
	opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
	.buentheme-cart-toast {
		transition: none;
	}
}

/* --- Catálogo de Productos (Archive Product) --- */

body.buentheme-wc-catalog .wp-block-group.buentheme-product-card,
.buentheme-product-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease !important;
    position: relative;
}

body.buentheme-wc-catalog .wp-block-group.buentheme-product-card,
body.buentheme-wc-catalog li.wc-block-product {
    overflow: visible;
    height: 100%;
    min-height: 100%;
    max-height: none;
}

body.buentheme-wc-catalog .wp-block-group.buentheme-product-card:not(.buentheme-card-preset-overlay) {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
}

body.buentheme-wc-catalog li.wc-block-product .wp-block-post-title,
body.buentheme-wc-catalog li.wc-block-product .buentheme-product-card__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    min-height: 4.35em;
    max-height: 4.35em;
    line-height: 1.45;
    margin-top: 0.875rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    word-break: normal;
}

body.buentheme-wc-catalog li.wc-block-product .wp-block-post-title a {
    display: block;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
}

body.buentheme-wc-catalog .buentheme-product-card__price,
body.buentheme-wc-catalog .buentheme-price-single-line {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    align-content: flex-start;
    column-gap: 0.25em;
    gap: 0;
    margin-top: 0.5rem;
    min-height: 1.5rem;
    line-height: 1.25;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: keep-all;
    overflow-wrap: normal;
    max-width: 100%;
}

body.buentheme-wc-catalog .buentheme-product-card__price .price,
body.buentheme-wc-catalog .buentheme-price-single-line .price {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: baseline;
    column-gap: 0.25em;
    gap: 0;
    white-space: nowrap;
    margin: 0;
    width: auto;
    max-width: 100%;
}

body.buentheme-wc-catalog .buentheme-product-card__price del,
body.buentheme-wc-catalog .buentheme-product-card__price ins,
body.buentheme-wc-catalog .buentheme-price-single-line del,
body.buentheme-wc-catalog .buentheme-price-single-line ins,
body.buentheme-wc-catalog .buentheme-product-card__price .woocommerce-Price-amount,
body.buentheme-wc-catalog .buentheme-price-single-line .woocommerce-Price-amount,
body.buentheme-wc-catalog .buentheme-product-card__price .wc-block-formatted-money-amount,
body.buentheme-wc-catalog .buentheme-price-single-line .wc-block-formatted-money-amount,
body.buentheme-wc-catalog .buentheme-product-card__price bdi,
body.buentheme-wc-catalog .buentheme-price-single-line bdi,
body.buentheme-wc-catalog .buentheme-product-card__price .woocommerce-Price-currencySymbol,
body.buentheme-wc-catalog .buentheme-price-single-line .woocommerce-Price-currencySymbol,
body.buentheme-wc-catalog .buentheme-product-card__price .wc-block-components-product-price__value,
body.buentheme-wc-catalog .buentheme-price-single-line .wc-block-components-product-price__value {
    display: inline;
    white-space: nowrap;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    vertical-align: baseline;
}

body.buentheme-wc-catalog .buentheme-product-card__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 0.875rem;
}

body.buentheme-wc-catalog .buentheme-product-card__actions .button,
body.buentheme-wc-catalog .buentheme-product-card__actions a,
body.buentheme-wc-catalog .buentheme-product-card__actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

body.buentheme-wc-catalog li.wc-block-product .wp-block-woocommerce-product-price,
body.buentheme-wc-catalog li.wc-block-product .wc-block-components-product-price {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    visibility: visible;
    opacity: 1;
    height: auto;
    max-height: none;
    overflow: hidden;
    position: static;
    clip: auto;
    clip-path: none;
    margin-top: 0;
    white-space: nowrap;
}

body.buentheme-wc-catalog li.wc-block-product .wp-block-woocommerce-product-button,
body.buentheme-wc-catalog li.wc-block-product .wc-block-components-product-button {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    visibility: visible;
    opacity: 1;
    height: auto;
    max-height: none;
    overflow: hidden;
    position: static;
    clip: auto;
    clip-path: none;
    margin-top: 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

body.buentheme-wc-catalog .wp-block-woocommerce-product-collection,
body.buentheme-wc-catalog .buentheme-wc-catalog-root.wp-block-woocommerce-product-collection {
    display: block;
}

body.buentheme-wc-catalog .wp-block-query-pagination,
body.buentheme-wc-catalog .buentheme-wc-catalog-root .wp-block-query-pagination {
    width: 100%;
    clear: both;
    margin-top: 2rem;
    justify-content: flex-end;
}

body.buentheme-wc-catalog .wp-block-group.buentheme-product-card:not(.buentheme-card-preset-overlay) {
    gap: 0;
    justify-content: flex-start;
    padding: 1rem;
    border-radius: 10px;
}

body.buentheme-wc-catalog .buentheme-product-card__media,
body.buentheme-wc-catalog li.wc-block-product .wp-block-woocommerce-product-image,
body.buentheme-wc-catalog li.wc-block-product .wc-block-components-product-image {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
}

body.buentheme-wc-catalog li.wc-block-product {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body.buentheme-wc-catalog .wc-block-product-template.is-flex-container,
body.buentheme-wc-catalog .wc-block-product-template__responsive {
    display: grid !important;
    align-items: stretch !important;
    gap: 1.75rem !important;
}

body.buentheme-wc-catalog .wc-block-product-template.is-flex-container > li,
body.buentheme-wc-catalog .wc-block-product-template__responsive > li {
    width: 100% !important;
    max-width: 100% !important;
}

body.buentheme-wc-catalog .wc-block-components-product-button__button--placeholder {
    display: none !important;
}

/* Efecto de segunda imagen en hover */
.buentheme-image-hover-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background-color: #f7f7f7;
}

.buentheme-image-hover-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.buentheme-hover-image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: 2;
    pointer-events: none;
}

.buentheme-image-hover-wrapper:hover .buentheme-hover-image {
    opacity: 1;
}

.buentheme-image-hover-wrapper:hover img:not(.buentheme-hover-image) {
    transform: scale(1.08);
}

/* Estilos de botones de producto en catálogo (WC 10.9 usa <button>, versiones anteriores <a>) */
.buentheme-product-card .wp-block-woocommerce-product-button,
.buentheme-product-card .wc-block-components-product-button,
.buentheme-product-card .buentheme-product-card__actions {
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.buentheme-product-card .wp-block-woocommerce-product-button .wp-block-button,
.buentheme-product-card .wc-block-components-product-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    text-align: center;
    overflow: hidden;
    box-sizing: border-box;
}

/*
 * Etiqueta «Añadir al carrito»: debe caber dentro del botón en tablet/móvil
 * (grillas de 2 cols). Máx. ~2 líneas, tipografía fluida, sin desborde.
 */
.buentheme-product-card .wp-block-woocommerce-product-button a,
.buentheme-product-card .wp-block-woocommerce-product-button button,
.buentheme-product-card .wc-block-components-product-button__button,
.buentheme-product-card .buentheme-product-card__actions .button,
.buentheme-product-card .add_to_cart_button,
.buentheme-product-related .wp-block-woocommerce-product-button a,
.buentheme-product-related .wp-block-woocommerce-product-button button,
.buentheme-product-related .add_to_cart_button,
.buentheme-wc-query-loop-sync .wp-block-woocommerce-product-button a,
.buentheme-wc-query-loop-sync .wp-block-woocommerce-product-button button,
.buentheme-wc-query-loop-sync .add_to_cart_button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-content: center !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    text-align: center !important;
    padding: 0.55rem 0.7rem !important;
    min-height: 2.5rem !important;
    max-height: 3.4rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.01em !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    hyphens: auto !important;
    border-radius: 6px !important;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease !important;
    cursor: pointer;
    pointer-events: auto;
}

.buentheme-product-card .wp-block-woocommerce-product-button a:hover,
.buentheme-product-card .wp-block-woocommerce-product-button button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 1079px) {
    .buentheme-product-card .wp-block-woocommerce-product-button a,
    .buentheme-product-card .wp-block-woocommerce-product-button button,
    .buentheme-product-card .wc-block-components-product-button__button,
    .buentheme-product-card .buentheme-product-card__actions .button,
    .buentheme-product-card .add_to_cart_button,
    .buentheme-product-related .wp-block-woocommerce-product-button a,
    .buentheme-product-related .wp-block-woocommerce-product-button button,
    .buentheme-product-related .add_to_cart_button,
    .buentheme-wc-query-loop-sync .wp-block-woocommerce-product-button a,
    .buentheme-wc-query-loop-sync .wp-block-woocommerce-product-button button,
    .buentheme-wc-query-loop-sync .add_to_cart_button {
        font-size: clamp(0.68rem, 2.7vw, 0.8125rem) !important;
        line-height: 1.15 !important;
        padding: 0.45rem 0.4rem !important;
        min-height: 2.35rem !important;
        max-height: 3.1rem !important;
    }
}

@media (max-width: 480px) {
    .buentheme-product-card .wp-block-woocommerce-product-button a,
    .buentheme-product-card .wp-block-woocommerce-product-button button,
    .buentheme-product-card .wc-block-components-product-button__button,
    .buentheme-product-card .buentheme-product-card__actions .button,
    .buentheme-product-card .add_to_cart_button,
    .buentheme-product-related .wp-block-woocommerce-product-button a,
    .buentheme-product-related .wp-block-woocommerce-product-button button,
    .buentheme-product-related .add_to_cart_button,
    .buentheme-wc-query-loop-sync .wp-block-woocommerce-product-button a,
    .buentheme-wc-query-loop-sync .wp-block-woocommerce-product-button button,
    .buentheme-wc-query-loop-sync .add_to_cart_button {
        font-size: clamp(0.65rem, 3.1vw, 0.75rem) !important;
        padding: 0.4rem 0.35rem !important;
        min-height: 2.25rem !important;
        max-height: 2.95rem !important;
    }
}

/* --- Fase 3: Filtros AJAX del catálogo --- */

.buentheme-wc-catalog-filters {
    margin: 0 0 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--wp--preset--color--bg-3, #e2e8f0);
}

.buentheme-wc-catalog-filters__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.buentheme-wc-catalog-filters__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.buentheme-wc-filter-chip {
    appearance: none;
    background: var(--wp--preset--color--bg-2, #fff);
    border: 1px solid var(--wp--preset--color--bg-3, #e2e8f0);
    border-radius: 999px;
    color: #334155;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.buentheme-wc-filter-chip:hover,
.buentheme-wc-filter-chip.is-active {
    background: var(--wp--preset--color--accent-1, #2563eb);
    border-color: var(--wp--preset--color--accent-1, #2563eb);
    color: #fff;
}

.buentheme-wc-catalog-filters__sort select {
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    min-width: 180px;
    padding: 8px 12px;
}

.buentheme-wc-catalog-filters__count {
    color: #64748b;
    font-size: 13px;
    margin: 12px 0 0;
}

.buentheme-wc-product-grid.is-loading,
.buentheme-wc-query-loop-sync.is-loading {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Badges unificados (Buenclick Suite): oferta arriba-izquierda, suscripción arriba-derecha */
.buentheme-wc-catalog-root .wp-block-woocommerce-product-image,
.buentheme-wc-catalog-root .wc-block-components-product-image,
.buentheme-wc-catalog-root .buentheme-product-card__media {
    position: relative;
}

.buentheme-wc-catalog-root .buenclick-product-badge--sale,
body.buentheme-wc-catalog .buenclick-product-badge--sale {
    z-index: 4;
}

.buentheme-wc-catalog-root .buenclick-product-badges--top-left,
body.buentheme-wc-catalog .buenclick-product-badges--top-left {
    left: 12px;
    right: auto;
    top: 12px;
}

.buentheme-wc-catalog-root .buenclick-product-badges--top-right,
body.buentheme-wc-catalog .buenclick-product-badges--top-right {
    left: auto;
    right: 12px;
    top: 12px;
}

/* Legacy WC sale badge — oculto cuando Suite gestiona la oferta */
.buenclick-badges-sale-managed .wc-block-components-product-sale-badge,
.buenclick-badges-sale-managed span.onsale,
.buentheme-wc-catalog-root .wc-block-components-product-sale-badge,
body.buentheme-wc-catalog span.onsale {
    display: none !important;
}

/* --- Fase 3: Quick View --- */

.buentheme-quick-view-trigger {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 12;
    appearance: none;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    color: #1e293b;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    padding: 8px 12px;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.buentheme-product-card:hover .buentheme-quick-view-trigger,
.buentheme-query-card:hover .buentheme-quick-view-trigger,
.wc-block-product:hover .buentheme-quick-view-trigger,
.buentheme-related-product:hover .buentheme-quick-view-trigger,
.buentheme-product-related li:hover .buentheme-quick-view-trigger {
    opacity: 1;
    transform: translateY(0);
}

/* Media clickeable hacia el producto (también con Vista rápida activa) */
.buentheme-product-card__media-link,
.wp-block-woocommerce-product-image > a,
.wc-block-components-product-image > a,
.buentheme-card-top-media > a {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
    line-height: 0;
    cursor: pointer;
}

.buentheme-product-card__media-link img,
.wp-block-woocommerce-product-image > a img,
.wc-block-components-product-image > a img,
.buentheme-card-top-media > a img {
    width: 100%;
    height: auto;
    display: block;
}

/* Área de imagen: position para el botón QV (hermano del enlace, z-index alto) */
.buentheme-product-card__media,
.wp-block-woocommerce-product-image,
.wc-block-components-product-image,
.buentheme-card-top-media,
.buentheme-product-related .buentheme-product-card__media,
.buentheme-product-related .wp-block-woocommerce-product-image,
.buentheme-product-related .wc-block-components-product-image {
    position: relative !important;
}

/* QV siempre por encima del enlace de la imagen */
.buentheme-product-card__media .buentheme-quick-view-trigger,
.wp-block-woocommerce-product-image .buentheme-quick-view-trigger,
.wc-block-components-product-image .buentheme-quick-view-trigger,
.buentheme-card-top-media .buentheme-quick-view-trigger {
    z-index: 12;
    pointer-events: auto;
}

.buentheme-quick-view {
    inset: 0;
    position: fixed;
    z-index: 100000;
    display: none;
}

.buentheme-quick-view.is-open {
    display: block;
}

.buentheme-quick-view__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}

.buentheme-quick-view__panel {
    position: relative;
    z-index: 1;
    width: min(920px, calc(100% - 32px));
    max-height: calc(100vh - 48px);
    margin: 24px auto;
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    padding: 24px;
}

.buentheme-quick-view__close {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.buentheme-quick-view__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.buentheme-quick-view__image {
    width: 100%;
    border-radius: 10px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.buentheme-quick-view__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.buentheme-quick-view__thumb {
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    width: 56px;
    height: 56px;
}

.buentheme-quick-view__thumb.is-active {
    border-color: var(--wp--preset--color--accent-1, #2563eb);
}

.buentheme-quick-view__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.buentheme-quick-view__title {
    font-size: 1.5rem;
    margin: 0 0 12px;
}

.buentheme-quick-view__price {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.buentheme-quick-view__excerpt {
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 20px;
}

.buentheme-quick-view__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.buentheme-quick-view__link {
    color: var(--wp--preset--color--accent-1, #2563eb);
    font-weight: 600;
    text-decoration: none;
}

body.buentheme-quick-view-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .buentheme-quick-view__grid {
        grid-template-columns: 1fr;
    }

    .buentheme-quick-view-trigger {
        opacity: 1;
        transform: none;
    }
}

/* Grid y presets de tarjeta: CSS dinámico vía inc/woocommerce/appearance.php */

.buentheme-wc-hover-off .buentheme-hover-image,
.buentheme-wc-hover-off .buentheme-image-hover-wrapper:hover .buentheme-hover-image {
    display: none !important;
    opacity: 0 !important;
}

.buentheme-wc-hover-off .buentheme-image-hover-wrapper:hover img:not(.buentheme-hover-image) {
    transform: none;
}

/* --- Producto Individual (Single Product) --- */

/* Alinear ficha con el ancho de la cabecera (content-size del tema/plantilla). */
.buentheme-single-product-main {
    box-sizing: border-box;
}
/* max-width + padding L/R: ver bloque «Refuerzo ficha de producto» más arriba */

.buentheme-single-product-main .buentheme-product-gallery-column .woocommerce-product-gallery,
.buentheme-single-product-main .buentheme-product-gallery-column .wp-block-woocommerce-product-image-gallery {
    width: 100%;
}

.buentheme-single-product-main .buentheme-product-gallery-column .woocommerce-product-gallery__wrapper,
.buentheme-single-product-main .buentheme-product-gallery-column .flex-viewport {
    border-radius: 12px;
    overflow: hidden;
}

.buentheme-single-product-main .buentheme-product-gallery-column img {
    transition: transform 0.5s ease;
    border-radius: 12px;
}

.buentheme-single-product-main .buentheme-product-gallery-column .woocommerce-product-gallery__image img:hover {
    transform: scale(1.02);
}

.buentheme-single-product-main .buentheme-product-gallery-column .flex-control-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.buentheme-single-product-main .buentheme-product-gallery-column .flex-control-thumbs li {
    width: 72px;
    margin: 0;
}

.buentheme-single-product-main .buentheme-product-gallery-column .flex-control-thumbs li img {
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.72;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.buentheme-single-product-main .buentheme-product-gallery-column .flex-control-thumbs li img.flex-active,
.buentheme-single-product-main .buentheme-product-gallery-column .flex-control-thumbs li img:hover {
    opacity: 1;
    border-color: var(--wp--preset--color--accent-1, #2563eb);
}

/* Modos de galería (Fase 2) */
.buentheme-wc-gallery-slider .buentheme-product-gallery-column .flex-control-thumbs,
.buentheme-gallery-layout-slider .flex-control-thumbs {
    display: none !important;
}

/*
 * Pre-init / sin flexslider (LiteSpeed delay JS para visitantes, adblock, etc.):
 * solo la primera imagen visible en modos slider. Evita el “stack” vertical
 * de todas las fotos de la galería antes de que corra jQuery/flexslider.
 * Cuando flexslider o nuestro fallback marcan .flexslider / .buentheme-gallery-manual,
 * se revierten a display controlado por el slider.
 */
body.buentheme-wc-gallery-slider .woocommerce-product-gallery:not(.flexslider):not(.buentheme-gallery-manual) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(:first-child),
body.buentheme-wc-gallery-slider-thumbs .woocommerce-product-gallery:not(.flexslider):not(.buentheme-gallery-manual) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(:first-child),
.buentheme-gallery-layout-slider:not(.flexslider):not(.buentheme-gallery-manual) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(:first-child) {
    display: none !important;
}

/*
 * Fallback manual sin animación (1 imagen o prefers-reduced-motion):
 * solo la activa visible.
 */
.buentheme-gallery-manual:not(.buentheme-gallery-animated) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(.is-bt-active),
.woocommerce-product-gallery.buentheme-gallery-manual:not(.buentheme-gallery-animated) .woocommerce-product-gallery__image:not(.is-bt-active) {
    display: none !important;
}
.buentheme-gallery-manual:not(.buentheme-gallery-animated) .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image.is-bt-active,
.woocommerce-product-gallery.buentheme-gallery-manual:not(.buentheme-gallery-animated) .woocommerce-product-gallery__image.is-bt-active {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    opacity: 1 !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
}

/*
 * Si flexslider ya envolvió el DOM (.flex-viewport + transform/width), el modo
 * manual debe anular residuos peligrosos o la galería queda vacía/colapsada.
 */
.buentheme-gallery-manual .flex-viewport {
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
}
.buentheme-gallery-manual:not(.buentheme-gallery-animated) .woocommerce-product-gallery__wrapper {
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    transition-duration: 0s !important;
    margin: 0 !important;
}
.buentheme-gallery-manual .flex-direction-nav,
.buentheme-gallery-manual .flex-control-nav:not(.flex-control-thumbs) {
    display: none !important;
}

/*
 * Carrusel manual con slide horizontal.
 * Anchos del track/slides y transform en px los pone el JS (evita contenedores
 * vacíos por % mal calculado + lazy-load + residuos flexslider).
 */
.buentheme-gallery-manual.buentheme-gallery-animated,
.buentheme-gallery-manual.buentheme-gallery-animated .flex-viewport {
    overflow: hidden !important;
    width: 100%;
    max-width: 100%;
}
.buentheme-gallery-manual.buentheme-gallery-animated .woocommerce-product-gallery__wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    /* width total (n * slideWidth) lo define JS en px — no forzar 100% */
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    will-change: transform;
    box-sizing: border-box !important;
}
.buentheme-gallery-manual.buentheme-gallery-animated .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image,
.buentheme-gallery-manual.buentheme-gallery-animated .woocommerce-product-gallery__image {
    display: block !important;
    flex-shrink: 0 !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    box-sizing: border-box !important;
    /* width/flex-basis los define JS en px; fallback por si el JS aún no corrió */
    min-width: 0;
}
.buentheme-gallery-manual.buentheme-gallery-animated .woocommerce-product-gallery__image > a {
    display: block !important;
    width: 100% !important;
    opacity: 1 !important;
    visibility: visible !important;
}
.buentheme-gallery-manual.buentheme-gallery-animated .woocommerce-product-gallery__image img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto;
}
/* Zoom de WC deja un .zoomImg absoluto que a veces tapa o deja hueco vacío */
.buentheme-gallery-manual.buentheme-gallery-animated .woocommerce-product-gallery__image img.zoomImg {
    display: none !important;
}
@media (prefers-reduced-motion: reduce) {
    .buentheme-gallery-manual.buentheme-gallery-animated .woocommerce-product-gallery__wrapper {
        transition-duration: 0s !important;
    }
}

/* Contenedor estable aunque no haya viewport de flexslider */
body.buentheme-wc-gallery-slider .woocommerce-product-gallery,
body.buentheme-wc-gallery-slider-thumbs .woocommerce-product-gallery,
.buentheme-gallery-layout-slider {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}
body.buentheme-wc-gallery-slider .woocommerce-product-gallery__wrapper,
body.buentheme-wc-gallery-slider-thumbs .woocommerce-product-gallery__wrapper,
.buentheme-gallery-layout-slider .woocommerce-product-gallery__wrapper {
    max-width: 100%;
}
body.buentheme-wc-gallery-slider .woocommerce-product-gallery__image,
body.buentheme-wc-gallery-slider-thumbs .woocommerce-product-gallery__image,
.buentheme-gallery-layout-slider .woocommerce-product-gallery__image {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
body.buentheme-wc-gallery-slider .woocommerce-product-gallery__image img,
body.buentheme-wc-gallery-slider-thumbs .woocommerce-product-gallery__image img,
.buentheme-gallery-layout-slider .woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

/* Slider sin miniaturas — flechas + puntos */
.buentheme-gallery-layout-slider,
.buentheme-wc-gallery-slider .woocommerce-product-gallery {
    position: relative;
}

.buentheme-gallery-slider-controls {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.buentheme-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.14);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.buentheme-gallery-nav:hover {
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.2);
    transform: translateY(-50%) scale(1.04);
}

.buentheme-gallery-nav:active {
    transform: translateY(-50%) scale(0.98);
}

.buentheme-gallery-nav--prev {
    left: 12px;
}

.buentheme-gallery-nav--next {
    right: 12px;
}

.buentheme-gallery-slider-dots {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 6;
    display: flex;
    gap: 8px;
    align-items: center;
    pointer-events: auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(4px);
}

.buentheme-gallery-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
}

.buentheme-gallery-dot.is-active {
    width: 20px;
    background: #fff;
}

.buentheme-gallery-dot:hover {
    background: #fff;
}

/* Viewport estable para el slider */
.buentheme-wc-gallery-slider .woocommerce-product-gallery .flex-viewport,
.buentheme-gallery-layout-slider .flex-viewport {
    border-radius: 12px;
    overflow: hidden;
}

.buentheme-wc-gallery-slider .woocommerce-product-gallery,
.buentheme-gallery-layout-slider {
    outline: none;
}

/* --- Estilos del resumen (dashboard: alineación / formulario) --- */
body.buentheme-wc-product-text-left .buentheme-product-summary-column {
    text-align: left;
    align-items: flex-start;
}
body.buentheme-wc-product-text-center .buentheme-product-summary-column {
    text-align: center;
    align-items: center;
}
body.buentheme-wc-product-text-right .buentheme-product-summary-column {
    text-align: right;
    align-items: flex-end;
}

body.buentheme-wc-product-text-center .buentheme-product-summary-column form.cart,
body.buentheme-wc-product-text-right .buentheme-product-summary-column form.cart {
    justify-content: inherit;
}
body.buentheme-wc-product-text-center .buentheme-product-summary-column form.cart {
    justify-content: center;
}
body.buentheme-wc-product-text-right .buentheme-product-summary-column form.cart {
    justify-content: flex-end;
}

body.buentheme-wc-product-text-center .buentheme-product-summary-column .price,
body.buentheme-wc-product-text-right .buentheme-product-summary-column .price {
    display: inline-block;
}

/* Vertical align del resumen vs galería (columnas en escritorio) */
@media (min-width: 782px) {
    body.buentheme-wc-product-valign-start .buentheme-single-product-main > .wp-block-columns {
        align-items: flex-start !important;
    }
    body.buentheme-wc-product-valign-center .buentheme-single-product-main > .wp-block-columns {
        align-items: center !important;
    }
    body.buentheme-wc-product-valign-end .buentheme-single-product-main > .wp-block-columns {
        align-items: flex-end !important;
    }
}

body.buentheme-wc-product-valign-start .buentheme-product-summary-column {
    justify-content: flex-start;
}
body.buentheme-wc-product-valign-center .buentheme-product-summary-column {
    justify-content: center;
}
body.buentheme-wc-product-valign-end .buentheme-product-summary-column {
    justify-content: flex-end;
}

/* Formulario de compra: en línea vs apilado */
body.buentheme-wc-product-form-stacked .buentheme-product-summary-column form.cart {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}
body.buentheme-wc-product-form-stacked .buentheme-product-summary-column form.cart .quantity,
body.buentheme-wc-product-form-stacked .buentheme-product-summary-column form.cart .buentheme-quantity-stepper {
    width: 100%;
    max-width: 160px;
}
body.buentheme-wc-product-form-stacked.buentheme-wc-product-text-center .buentheme-product-summary-column form.cart .quantity,
body.buentheme-wc-product-form-stacked.buentheme-wc-product-text-center .buentheme-product-summary-column form.cart .buentheme-quantity-stepper {
    margin-left: auto;
    margin-right: auto;
}
body.buentheme-wc-product-form-stacked.buentheme-wc-product-text-right .buentheme-product-summary-column form.cart .quantity,
body.buentheme-wc-product-form-stacked.buentheme-wc-product-text-right .buentheme-product-summary-column form.cart .buentheme-quantity-stepper {
    margin-left: auto;
}
body.buentheme-wc-product-form-stacked .buentheme-product-summary-column form.cart .single_add_to_cart_button,
body.buentheme-wc-product-form-stacked .buentheme-product-summary-column form.cart button.single_add_to_cart_button {
    width: 100%;
    justify-content: center;
}

/* Resumen más limpio */
.buentheme-product-summary-column .wp-block-post-title,
.buentheme-product-summary-column .product_title {
    margin-top: 0;
    margin-bottom: 0.5rem;
    line-height: 1.25;
}
.buentheme-product-summary-column .price {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}
.buentheme-product-summary-column .woocommerce-product-details__short-description,
.buentheme-product-summary-column .wp-block-post-excerpt {
    margin-bottom: 1.25rem;
    color: var(--wp--preset--color--text-2, #64748b);
    line-height: 1.6;
}

/*
 * Grid / stacked: aplicar por body class (no esperar .buentheme-gallery-layout-ready).
 * Con delay de JS (LiteSpeed invitados) el markup clásico de flexslider apilaría
 * o dejaría floats rotos; estos selectores funcionan solo con CSS.
 */
body.buentheme-wc-gallery-grid .buentheme-product-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__wrapper,
.buentheme-gallery-layout-grid .woocommerce-product-gallery__wrapper {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100% !important;
    transform: none !important;
}

body.buentheme-wc-gallery-grid .buentheme-product-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__image,
.buentheme-gallery-layout-grid .woocommerce-product-gallery__image {
    display: block !important;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

body.buentheme-wc-gallery-stacked .buentheme-product-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__wrapper,
.buentheme-gallery-layout-stacked .woocommerce-product-gallery__wrapper {
    display: flex !important;
    flex-direction: column;
    gap: 16px;
    width: 100% !important;
    transform: none !important;
}

body.buentheme-wc-gallery-stacked .buentheme-product-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__image,
.buentheme-gallery-layout-stacked .woocommerce-product-gallery__image {
    display: block !important;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

body.buentheme-wc-gallery-grid .buentheme-product-gallery-column .woocommerce-product-gallery .flex-control-thumbs,
body.buentheme-wc-gallery-stacked .buentheme-product-gallery-column .woocommerce-product-gallery .flex-control-thumbs,
.buentheme-gallery-layout-grid .flex-control-thumbs,
.buentheme-gallery-layout-stacked .flex-control-thumbs {
    display: none !important;
}

@media (max-width: 640px) {
    body.buentheme-wc-gallery-grid .buentheme-product-gallery-column .woocommerce-product-gallery .woocommerce-product-gallery__wrapper,
    .buentheme-gallery-layout-grid .woocommerce-product-gallery__wrapper {
        grid-template-columns: 1fr;
    }
}

.buentheme-product-summary-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    min-width: 0;
}

/* Stepper de Cantidad (+/-) */
.buentheme-quantity-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    height: 42px;
    box-sizing: border-box;
}

.buentheme-quantity-stepper .qty-btn {
    background: #f7fafc;
    border: none;
    width: 36px;
    height: 100%;
    font-size: 18px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    padding: 0;
}

.buentheme-quantity-stepper .qty-btn:hover {
    background-color: #edf2f7;
    color: #1a202c;
}

.buentheme-quantity-stepper .qty-btn:active {
    background-color: #e2e8f0;
}

/* Esconder spinners por defecto en input de cantidad */
.buentheme-quantity-stepper input[type="number"].qty {
    width: 44px;
    height: 100%;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    background: #fff;
    margin: 0;
    padding: 0;
    -moz-appearance: textfield;
}

.buentheme-quantity-stepper input[type="number"].qty::-webkit-outer-spin-button,
.buentheme-quantity-stepper input[type="number"].qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Formularios de Variaciones y Añadir al Carrito */
.buentheme-product-summary-column form.cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.buentheme-product-summary-column form.cart .quantity {
    margin: 0 !important;
}

.buentheme-product-summary-column .single_add_to_cart_button {
    min-height: 42px;
    height: auto;
    padding: 0.55rem 1.25rem !important;
    font-weight: 600;
    line-height: 1.2;
    white-space: normal;
    overflow: hidden;
    text-align: center;
    box-sizing: border-box;
    max-width: 100%;
    border-radius: 6px !important;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease !important;
}

.buentheme-product-summary-column .single_add_to_cart_button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 781px) {
    .buentheme-product-summary-column form.cart {
        max-width: 100%;
    }

    .buentheme-product-summary-column .single_add_to_cart_button {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        max-width: 100%;
        font-size: clamp(0.75rem, 2.8vw, 0.9rem);
        padding: 0.55rem 0.85rem !important;
    }
}

/* Pestañas de producto */
.buentheme-product-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
    padding: 0;
    border-bottom: 1px solid #e2e8f0;
}

.buentheme-product-tab-btn {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 -1px;
    padding: 12px 18px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.buentheme-product-tab-btn:hover,
.buentheme-product-tab-btn.is-active {
    color: #1e293b;
    border-bottom-color: var(--wp--preset--color--accent-1, #2563eb);
}

/* Placeholder de pestañas solo visible en editor (el front rellena con PHP) */
body:not(.block-editor-page) .buentheme-tab-placeholder {
	display: none !important;
}

/*
 * Productos relacionados (ficha)
 * Evitar el CSS clásico de WC (ul.products li.product { float; width:22% })
 * que dejaba las tarjetas como franjas verticales con el texto letra a letra.
 */
.buentheme-product-related {
	display: block !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	align-items: stretch !important;
	width: 100% !important;
	max-width: 100%;
	box-sizing: border-box;
	clear: both;
	margin-top: var(--wp--preset--spacing--60, 4rem);
}

.buentheme-product-related > .buentheme-related-heading,
.buentheme-product-related > h2 {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	flex: none !important;
	margin-bottom: var(--wp--preset--spacing--30, 1.5rem) !important;
	writing-mode: horizontal-tb !important;
	text-orientation: mixed !important;
}

/*
 * Grid de relacionados (sin clase .products de WC).
 * Aspecto de tarjeta: lo gobierna buentheme-wc-appearance-css
 * (mismos selectores que catálogo / Query Loop Premium).
 * Aquí solo layout del grid + defensa anti-float de WC.
 */
.buentheme-product-related .buentheme-related-products-grid,
.buentheme-product-related .buentheme-wc-related-sync,
.buentheme-product-related .buentheme-wc-related-products,
.buentheme-product-related .wp-block-woocommerce-product-collection,
.buentheme-product-related ul.wc-block-product-template,
.buentheme-product-related ul.wp-block-woocommerce-product-template,
.buentheme-product-related .wc-block-product-template,
.buentheme-product-related .wp-block-woocommerce-product-template,
.woocommerce .buentheme-product-related ul.products,
.woocommerce-page .buentheme-product-related ul.products {
	display: grid !important;
	grid-template-columns: repeat(var(--buentheme-wc-cols-m, 2), minmax(0, 1fr)) !important;
	gap: 1.75rem !important;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	clear: both !important;
	flex: none !important;
	min-width: 0 !important;
	box-sizing: border-box !important;
	align-items: stretch !important;
}

.buentheme-product-related .buentheme-related-products-grid > li,
.buentheme-product-related .buentheme-related-product,
.buentheme-product-related li.wc-block-product,
.buentheme-product-related ul.wc-block-product-template > li,
.buentheme-product-related ul.wp-block-woocommerce-product-template > li,
.woocommerce .buentheme-product-related ul.products li.product,
.woocommerce-page .buentheme-product-related ul.products li.product {
	display: flex !important;
	flex-direction: column !important;
	float: none !important;
	clear: none !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	position: relative !important;
	box-sizing: border-box !important;
	height: 100% !important;
	min-height: 100% !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
}

/* Overlay en ficha: overflow visible para hover del botón */
.buentheme-product-related .buentheme-product-card.buentheme-card-preset-overlay,
.buentheme-product-related .wp-block-group.buentheme-product-card.buentheme-card-preset-overlay {
	overflow: visible !important;
}

@media (min-width: 600px) and (max-width: 1079px) {
	.buentheme-product-related .buentheme-related-products-grid,
	.buentheme-product-related .buentheme-wc-related-sync,
	.buentheme-product-related ul.wc-block-product-template,
	.buentheme-product-related ul.wp-block-woocommerce-product-template,
	.woocommerce .buentheme-product-related ul.products {
		grid-template-columns: repeat(var(--buentheme-wc-cols-t, 2), minmax(0, 1fr)) !important;
	}
}

@media (min-width: 1080px) {
	.buentheme-product-related .buentheme-related-products-grid,
	.buentheme-product-related .buentheme-wc-related-sync,
	.buentheme-product-related ul.wc-block-product-template,
	.buentheme-product-related ul.wp-block-woocommerce-product-template,
	.woocommerce .buentheme-product-related ul.products {
		grid-template-columns: repeat(var(--buentheme-wc-cols-d, var(--buentheme-related-cols, 3)), minmax(0, 1fr)) !important;
	}
}

.buentheme-product-tab-panel[hidden] {
    display: none !important;
}

.buentheme-product-tab-panel.is-active {
    display: block;
}

.buentheme-product-flat-description > h2 {
    margin-bottom: 1.25rem;
}

.buentheme-product-reviews-panel .comment-respond {
    margin-top: 1.5rem;
}

/* Swatches de variaciones */
.buentheme-variation-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.buentheme-swatch {
    appearance: none;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    color: #334155;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    min-height: 36px;
    min-width: 36px;
    padding: 6px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.buentheme-swatch:hover {
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.buentheme-swatch.is-selected {
    border-color: var(--wp--preset--color--accent-1, #2563eb);
    box-shadow: 0 0 0 1px var(--wp--preset--color--accent-1, #2563eb);
}

.buentheme-swatch.is-color-swatch {
    border-radius: 50%;
    height: 36px;
    min-width: 36px;
    padding: 0;
    width: 36px;
}

.buentheme-swatch-color {
    background: var(--buentheme-swatch-color, #cbd5e0);
    border-radius: 50%;
    display: block;
    height: 100%;
    width: 100%;
}

.buentheme-swatch-select-hidden {
    clip: rect(0, 0, 0, 0) !important;
    height: 1px !important;
    overflow: hidden !important;
    position: absolute !important;
    white-space: nowrap !important;
    width: 1px !important;
}

.variations tr .value {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Selectores de variación más limpios */
.variations select {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background-color: #fff;
    font-size: 14px;
    color: #2d3748;
    min-width: 150px;
    outline: none;
    transition: border-color 0.2s ease;
}

.variations select:focus {
    border-color: var(--wp--preset--color--accent-1, #2563eb);
}

.variations td.label {
    padding-right: 15px;
    font-weight: 600;
    color: #4a5568;
    vertical-align: middle;
}

/* --- Sticky Buy Bar --- */

.buentheme-sticky-buy-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    /* Por debajo de BuenChat (999999) e ir-arriba (1000100); full-width en el suelo */
    z-index: 100000;
    padding: 12px 24px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

.buentheme-sticky-buy-bar.is-visible {
    transform: translateY(0);
    pointer-events: auto;
}

body.buentheme-sticky-bar-active {
    scroll-padding-bottom: calc(var(--buentheme-sticky-bar-height, 80px) + 8px);
}

.buentheme-sticky-buy-bar .sticky-buy-btn.disabled,
.buentheme-sticky-buy-bar .sticky-buy-btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.sticky-buy-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.sticky-buy-product {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sticky-buy-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.sticky-buy-info {
    display: flex;
    flex-direction: column;
}

.sticky-buy-title {
    font-weight: 600;
    font-size: 14px;
    color: #1a202c;
}

.sticky-buy-price {
    font-size: 13px;
    color: #4a5568;
    font-weight: 500;
}

.sticky-buy-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sticky-buy-btn {
    min-height: 42px;
    height: auto;
    padding: 0.5rem 1rem !important;
    font-weight: 600;
    border-radius: 6px !important;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
    white-space: normal;
    overflow: hidden;
    text-align: center;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

/* Responsividad para móviles */
@media (max-width: 640px) {
    .buentheme-sticky-buy-bar {
        padding: 10px 16px;
    }
    
    .sticky-buy-content {
        gap: 10px;
    }

    .sticky-buy-product {
        display: none;
    }

    .sticky-buy-actions {
        width: 100%;
        justify-content: space-between;
        min-width: 0;
    }

    .sticky-buy-actions .buentheme-quantity-stepper {
        flex: 0 0 auto;
        max-width: 120px;
    }

    .sticky-buy-btn {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        text-align: center;
        font-size: clamp(0.72rem, 3vw, 0.875rem);
        padding: 0.5rem 0.55rem !important;
        white-space: normal;
        overflow: hidden;
        max-height: 3rem;
        line-height: 1.15;
    }
}




/* ==========================================================================
   Secciones (gestor de secciones — placements)
   ========================================================================== */
/*
 * Las secciones se inyectan a menudo FUERA de main constrained (p. ej. after_header
 * o antes/después del bloque main). Sin layout constrained, el contenido iba a
 * 100% del viewport y no respetaba el content-size del tema.
 *
 * Solución: el wrapper .buentheme-section lleva is-layout-constrained (PHP) y aquí
 * reforzamos max-width de hijos + padding de borde como el resto de plantillas.
 */
.buentheme-section {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	clear: both;
}

/* Hijos directos (no full/wide/float): acotados al content-size del tema */
.buentheme-section.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull):not(.alignwide)),
.buentheme-section > :where(
	.buentheme-row:not(.alignfull):not(.alignwide):not(.has-custom-content-width),
	.buentheme-row-container:not(.alignfull):not(.alignwide):not(.has-custom-content-width),
	.wp-block-group:not(.alignfull):not(.alignwide),
	.wp-block-columns:not(.alignfull):not(.alignwide),
	.wp-block-heading:not(.alignfull):not(.alignwide),
	.wp-block-paragraph:not(.alignfull),
	.wp-block-image:not(.alignfull):not(.alignwide)
) {
	max-width: var(--wp--style--global--content-size, 1290px) !important;
	width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
	box-sizing: border-box !important;
}

/*
 * Padding lateral de secciones inyectadas:
 * - Páginas normales → content_padding (--buentheme-global-padding).
 * - Contextos WC → template_padding (--buentheme-template-edge-padding).
 * Antes usaba siempre template_padding y la home heredaba el aire de WC/pie.
 */
.buentheme-section.is-layout-constrained > :where(:not(.alignfull)) {
	padding-left: var(--buentheme-global-padding, 0px);
	padding-right: var(--buentheme-global-padding, 0px);
	box-sizing: border-box;
}

body.buentheme-wc-catalog .buentheme-section.is-layout-constrained > :where(:not(.alignfull)),
body.woocommerce-shop .buentheme-section.is-layout-constrained > :where(:not(.alignfull)),
body.post-type-archive-product .buentheme-section.is-layout-constrained > :where(:not(.alignfull)),
body.tax-product_cat .buentheme-section.is-layout-constrained > :where(:not(.alignfull)),
body.tax-product_tag .buentheme-section.is-layout-constrained > :where(:not(.alignfull)),
body.tax-product_brand .buentheme-section.is-layout-constrained > :where(:not(.alignfull)),
body.single-product .buentheme-section.is-layout-constrained > :where(:not(.alignfull)),
body.buentheme-wc-single-product .buentheme-section.is-layout-constrained > :where(:not(.alignfull)),
body.woocommerce-cart .buentheme-section.is-layout-constrained > :where(:not(.alignfull)),
body.woocommerce-checkout .buentheme-section.is-layout-constrained > :where(:not(.alignfull)),
body.woocommerce-order-received .buentheme-section.is-layout-constrained > :where(:not(.alignfull)),
body.search-results.woocommerce .buentheme-section.is-layout-constrained > :where(:not(.alignfull)) {
	padding-left: var(--buentheme-template-edge-padding, 15px);
	padding-right: var(--buentheme-template-edge-padding, 15px);
}

/* alignwide → wide-size del tema */
.buentheme-section.is-layout-constrained > .alignwide,
.buentheme-section > .alignwide {
	max-width: var(--wp--style--global--wide-size, var(--wp--style--global--content-size, 1290px)) !important;
	width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
	box-sizing: border-box !important;
}

/* alignfull / filas full-bleed: edge-to-edge (el INNER con has-inherit-width se acota solo) */
.buentheme-section.is-layout-constrained > .alignfull,
.buentheme-section > .alignfull,
.buentheme-section > .buentheme-row.alignfull,
.buentheme-section > .buentheme-row-container.alignfull {
	max-width: 100% !important;
	width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding-left: 0;
	padding-right: 0;
}

/* Diseño estrecho del dashboard */
body.buentheme-layout-narrow .buentheme-section.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull):not(.alignwide)) {
	max-width: var(--buentheme-narrow-width, 720px) !important;
}

/* Filas con «Heredar ancho del tema» dentro de la sección */
.buentheme-section .buentheme-row-inner-wrapper.has-inherit-width,
.buentheme-section .buentheme-row__inner.has-inherit-width {
	max-width: var(--wp--style--global--content-size, 1290px) !important;
	width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
	box-sizing: border-box !important;
}

body.buentheme-layout-narrow .buentheme-section .buentheme-row-inner-wrapper.has-inherit-width,
body.buentheme-layout-narrow .buentheme-section .buentheme-row__inner.has-inherit-width {
	max-width: var(--buentheme-narrow-width, 720px) !important;
}

.buentheme-section > .buentheme-row,
.buentheme-section > .buentheme-row-container {
	width: 100%;
}

/* Secciones de reemplazo WC: sin márgenes fantasma del bloque original */
.buentheme-section--replace {
	margin-top: 0;
	margin-bottom: 0;
}
