/* Sustitución total: respaldos estructurales. El JS hace la detección fina. */
body.speh-force-replace > header:not(.speh-modern-header):not(#wpadminbar),
body.speh-force-replace #page > header:not(.speh-modern-header),
body.speh-force-replace .site > header:not(.speh-modern-header),
body.speh-force-replace #wrapper > header:not(.speh-modern-header) { display: none !important; }

[data-speh-hidden-legacy="true"] { display: none !important; }
.speh-modern-header,
.speh-modern-header * { box-sizing: border-box; }

.speh-modern-header {
    --speh-border: color-mix(in srgb, var(--speh-text) 12%, transparent);
    --speh-muted: color-mix(in srgb, var(--speh-text) 68%, transparent);
    position: relative;
    z-index: 9998;
    width: 100%;
    background: color-mix(in srgb, var(--speh-bg) 94%, white 6%);
    color: var(--speh-text);
    border-bottom: 1px solid var(--speh-border);
    box-shadow: 0 6px 28px rgba(24, 19, 16, .05);
    font-family: inherit;
}

.speh-modern-header.is-sticky { position: sticky; top: 0; }
body.admin-bar .speh-modern-header.is-sticky { top: 32px; }

.speh-shell { width: min(calc(100% - 30px), var(--speh-max)); margin-inline: auto; }
.speh-announcement { background: var(--speh-text); color: var(--speh-bg); font-size: 12px; letter-spacing: .055em; text-transform: uppercase; text-align: center; }
.speh-announcement .speh-shell { padding-block: 7px; }

.speh-header-row { min-height: 110px; display: grid; grid-template-columns: minmax(390px, auto) 1fr auto; align-items: center; gap: 18px; }
.speh-brand { min-width: 390px; overflow: visible; }
.speh-brand-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; overflow: visible; }
.speh-logo-image { display: block; width: var(--speh-logo-max, 420px) !important; max-width: var(--speh-logo-max, 420px) !important; height: auto !important; max-height: 104px !important; object-fit: contain; transform: scale(1.08); transform-origin: left center; }
.speh-wordmark { display: flex; flex-direction: column; line-height: .9; font-size: 15px; letter-spacing: -.02em; }
.speh-wordmark strong { font-size: 29px; font-weight: 800; color: var(--speh-accent); }

.speh-desktop-nav { justify-self: center; min-width: 0; }
.speh-menu { list-style: none; margin: 0; padding: 0; }
.speh-menu-desktop { display: flex; align-items: center; justify-content: center; gap: 1px; }
.speh-menu-desktop > li { position: relative; }
.speh-menu-desktop > li > a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--speh-text); text-decoration: none; font-size: 12.5px; font-weight: 700; letter-spacing: .01em; border-radius: 999px; transition: background .2s ease, color .2s ease, transform .2s ease; white-space: nowrap; }
.speh-menu-desktop > li > a:hover,
.speh-menu-desktop > li.current-menu-item > a,
.speh-menu-desktop > li.current-menu-ancestor > a { background: color-mix(in srgb, var(--speh-accent) 12%, transparent); color: var(--speh-accent); }

/* Limpieza específica del elemento Scrapbooking: elimina badges, descripciones y pseudo-elementos. */
.speh-menu-desktop > li.speh-scrapbooking-clean::before,
.speh-menu-desktop > li.speh-scrapbooking-clean::after,
.speh-menu-desktop > li.speh-scrapbooking-clean > a::before,
.speh-menu-desktop > li.speh-scrapbooking-clean > a::after { content: none !important; display: none !important; }
.speh-menu-desktop > li.speh-scrapbooking-clean > span,
.speh-menu-desktop > li.speh-scrapbooking-clean > small,
.speh-menu-desktop > li.speh-scrapbooking-clean > em,
.speh-menu-desktop > li.speh-scrapbooking-clean > div:not(.sub-menu),
.speh-menu-desktop > li.speh-scrapbooking-clean [class*="tooltip"],
.speh-menu-desktop > li.speh-scrapbooking-clean [class*="badge"],
.speh-menu-desktop > li.speh-scrapbooking-clean [class*="label"],
.speh-menu-desktop > li.speh-scrapbooking-clean [class*="description"],
.speh-menu-desktop > li.speh-scrapbooking-clean [class*="subtitle"] { display: none !important; }

.speh-menu-desktop .sub-menu { list-style: none; margin: 0; padding: 10px; min-width: 235px; position: absolute; left: 0; top: calc(100% + 8px); opacity: 0; visibility: hidden; transform: translateY(7px); background: #fff; border: 1px solid var(--speh-border); border-radius: 16px; box-shadow: 0 18px 45px rgba(30, 22, 17, .13); transition: opacity .18s ease, transform .18s ease, visibility .18s; }
.speh-menu-desktop li:hover > .sub-menu,
.speh-menu-desktop li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.speh-menu-desktop .sub-menu li { position: relative; }
.speh-menu-desktop .sub-menu a { display: block; padding: 10px 12px; color: var(--speh-text); text-decoration: none; border-radius: 10px; font-size: 14px; line-height: 1.25; }
.speh-menu-desktop .sub-menu a:hover { background: color-mix(in srgb, var(--speh-accent) 9%, transparent); color: var(--speh-accent); }
.speh-menu-desktop .sub-menu .sub-menu { left: calc(100% + 9px); top: -10px; }

.speh-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.speh-icon-button { appearance: none; border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; }
.speh-search-toggle { width: 42px; height: 42px; border: 1px solid var(--speh-border); border-radius: 50%; display: grid; place-items: center; transition: background .2s ease, border-color .2s ease; }
.speh-search-toggle:hover { background: #fff; border-color: color-mix(in srgb, var(--speh-accent) 35%, transparent); }
.speh-search-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.speh-cta, .speh-mobile-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 17px; border-radius: 999px; background: var(--speh-accent); color: white !important; text-decoration: none !important; font-weight: 800; font-size: 13px; box-shadow: 0 8px 22px color-mix(in srgb, var(--speh-accent) 25%, transparent); transition: transform .18s ease, box-shadow .18s ease; }
.speh-cta:hover, .speh-mobile-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 25px color-mix(in srgb, var(--speh-accent) 32%, transparent); }

.speh-search-panel { border-top: 1px solid var(--speh-border); background: #fff; }
.speh-search-panel[hidden] { display: none; }
.speh-search-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 15px 0; }
.speh-search-form input { width: 100%; min-height: 48px; border: 1px solid var(--speh-border); border-radius: 14px; padding: 0 16px; font: inherit; color: var(--speh-text); background: #fff; outline: none; }
.speh-search-form input:focus { border-color: var(--speh-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--speh-accent) 13%, transparent); }
.speh-search-form button { border: 0; border-radius: 14px; padding: 0 22px; background: var(--speh-text); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }

.speh-mobile-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--speh-border); border-radius: 50%; place-items: center; }
.speh-mobile-toggle span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; margin: 2px 0; }
.speh-mobile-panel { position: fixed; inset: 0; z-index: 10001; pointer-events: none; visibility: hidden; }
.speh-mobile-panel.is-open { pointer-events: auto; visibility: visible; }
.speh-mobile-backdrop { position: absolute; inset: 0; background: rgba(25, 20, 18, .44); opacity: 0; transition: opacity .25s ease; }
.speh-mobile-panel.is-open .speh-mobile-backdrop { opacity: 1; }
.speh-mobile-drawer { position: absolute; top: 0; right: 0; width: min(90vw, 390px); height: 100%; overflow-y: auto; background: var(--speh-bg); padding: 18px; transform: translateX(105%); transition: transform .28s cubic-bezier(.2,.75,.2,1); box-shadow: -16px 0 45px rgba(20, 16, 14, .16); }
.speh-mobile-panel.is-open .speh-mobile-drawer { transform: translateX(0); }
.speh-mobile-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--speh-border); padding: 2px 0 15px; }
.speh-mobile-top strong { font-size: 18px; }
.speh-mobile-close { font-size: 32px; line-height: 1; width: 42px; height: 42px; border-radius: 50%; }
.speh-mobile-nav { padding: 12px 0 20px; }
.speh-menu-mobile li { position: relative; border-bottom: 1px solid var(--speh-border); }
.speh-menu-mobile a { display: block; color: var(--speh-text); text-decoration: none; padding: 14px 42px 14px 3px; font-size: 16px; font-weight: 750; line-height: 1.25; }
.speh-menu-mobile .sub-menu { display: none; list-style: none; margin: 0 0 8px 12px; padding: 0 0 0 12px; border-left: 2px solid color-mix(in srgb, var(--speh-accent) 20%, transparent); }
.speh-menu-mobile .sub-menu.is-open { display: block; }
.speh-menu-mobile .sub-menu li { border: 0; }
.speh-menu-mobile .sub-menu a { font-size: 14px; font-weight: 650; color: var(--speh-muted); padding-top: 9px; padding-bottom: 9px; }
.speh-submenu-toggle { position: absolute; right: 0; top: 7px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; font-size: 20px; line-height: 1; transition: transform .2s ease, background .2s ease; }
.speh-submenu-toggle:hover { background: color-mix(in srgb, var(--speh-accent) 10%, transparent); }
.speh-submenu-toggle[aria-expanded="true"] { transform: rotate(45deg); }
.speh-mobile-cta { width: 100%; margin-top: 8px; }
body.speh-menu-open { overflow: hidden; }

@media (max-width: 1050px) {
    .speh-shell { width: min(calc(100% - 28px), var(--speh-max)); }
    .speh-header-row { min-height: 70px; grid-template-columns: 1fr auto; gap: 12px; }
    .speh-desktop-nav { display: none; }
    .speh-mobile-toggle { display: grid; }
    .speh-brand { min-width: 0; }
    .speh-logo-image { width: 210px !important; max-width: 210px !important; max-height: 58px !important; transform: none; }
    .speh-actions .speh-cta { display: none; }
}

@media (max-width: 782px) {
    body.admin-bar .speh-modern-header.is-sticky { top: 46px; }
}

@media (max-width: 520px) {
    .speh-shell { width: min(calc(100% - 22px), var(--speh-max)); }
    .speh-header-row { min-height: 64px; }
    .speh-logo-image { width: 175px !important; max-width: 175px !important; max-height: 50px !important; transform: none; }
    .speh-wordmark { font-size: 12px; }
    .speh-wordmark strong { font-size: 24px; }
    .speh-search-form { grid-template-columns: 1fr; }
    .speh-search-form button { min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
    .speh-modern-header *, .speh-modern-header *::before, .speh-modern-header *::after { scroll-behavior: auto !important; transition: none !important; }
}
