/* ── Reset y variables del Header ───────────────────────── */
:root {
    --hdr-dark:    #1A1A2E; /* Tinta */
    --hdr-magenta: #1090A0; /* Verde/teal del logo (antes magenta #1090A0) */
    --hdr-cian:    #00B3D6; /* Cian */
    --hdr-border:  #E2E8F0; /* Borde */
    --hdr-light:   #F7F7FA; /* Papel-gris */
    --hdr-shadow:  0 8px 24px rgba(26,26,46,0.08);
    --font-head:   "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body:   "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --transition:  all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radio-md:    12px; /* usado por .mega-panel (antes indefinido en el header) */
}

/* Barra CMYK superior: RETIRADA en todo el sitio (antes solo en la home). Se deja el markup en header.php
   por si se quiere recuperar; aquí se oculta. */
.barra-cmyk {
    height: 5px;
    display: none;
    grid-template-columns: repeat(4, 1fr);
}
.barra-cmyk span:nth-child(1) { background: var(--hdr-cian); }
.barra-cmyk span:nth-child(2) { background: var(--hdr-magenta); }
.barra-cmyk span:nth-child(3) { background: #FFC400; }
.barra-cmyk span:nth-child(4) { background: #101018; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 10000;
    background: #ffffff;
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
    font-family: var(--font-body);
    /* Sin hueco arriba/abajo ni línea bajo la cabecera (style.css le ponía padding 15px y borde);
       la home ya lo tenía así y ahora va igual en todas las páginas. */
    padding: 0;
    border-bottom: 0;
}
@media (max-width: 767px) { .site-header { padding: 0; } }

/* --- LEVEL 1: TOP BAR --- */
.hdr-top-bar {
    background-color: var(--hdr-light);
    border-bottom: 1px solid var(--hdr-border);
    height: 36px;
    display: flex;
    align-items: center;
    font-size: 13px;
    transition: height 0.3s ease, border-color 0.3s ease;
}
.hdr-top-bar-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 22px;
    color: var(--hdr-dark);
}
.hdr-top-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.phone-highlight {
    font-weight: 700;
    color: var(--hdr-magenta);
}
.hdr-top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hdr-top-right a {
    color: var(--hdr-dark);
    text-decoration: none;
    transition: var(--transition);
}
.hdr-top-right a:hover {
    color: var(--hdr-magenta);
}
.sep {
    color: var(--hdr-border);
    margin: 0 4px;
}

/* --- LEVEL 2: MAIN BAR --- */
.hdr-main-bar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--hdr-border);
    height: 80px;
    display: flex;
    align-items: center;
}
.hdr-main-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.hdr-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.hdr-logo__img {
    height: 64px;
    width: auto;
    object-fit: contain;
}
.hdr-logo__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
    white-space: nowrap;
}
.hdr-logo__l1 {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 19px;
    color: var(--hdr-dark);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.hdr-logo__l2 {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 12.5px;
    color: var(--hdr-magenta);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-top: 1px;
}
@media (max-width: 576px) {
    .hdr-logo__text { display: none; }
}
.hdr-search-box {
    flex: 1;
    max-width: 560px;
    margin: 0 auto;
}
.hdr-search-form {
    display: flex;
    width: 100%;
}
.hdr-search-input {
    flex: 1;
    width: 100%;
    padding: 13px 18px;
    border: 2px solid var(--hdr-dark);
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 15px;
    font-family: var(--font-body);
    color: var(--hdr-dark);
    background-color: #ffffff;
    transition: var(--transition);
}
.hdr-search-input:focus {
    outline: none;
    border-color: var(--hdr-magenta);
}
.hdr-search-btn {
    flex: none;
    border: none;
    background: var(--hdr-dark);
    color: #ffffff;
    padding: 0 20px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: var(--transition);
}
.hdr-search-btn:hover {
    background: var(--hdr-magenta);
}

.hdr-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}
.hdr-action-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--hdr-dark);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: 8px;
}
.hdr-action-link:hover {
    background-color: var(--hdr-light);
    color: var(--hdr-magenta);
}
.hdr-action-icon {
    font-size: 20px;
}
.hdr-cart-link {
    position: relative;
}
.hdr-cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: var(--hdr-magenta);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(25%, -25%);
    box-shadow: 0 2px 6px rgba(16,144,160,0.2);
}

/* --- LEVEL 3: NAV BAR --- */
.hdr-nav-bar {
    background-color: #ffffff;
    border-bottom: 0; /* la línea bajo el menú se retiró en todas las páginas (antes solo en la home) */
    height: 50px;
    display: flex;
    align-items: center;
}
.hdr-nav-bar-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    position: relative;
}
/* CTA 'Diseña ahora' anclado a la derecha (nav centrado, como la referencia) */
.hdr-nav-bar-inner .btn-cta-nav {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}
.hdr-nav-bar-inner .btn-cta-nav:hover {
    transform: translateY(-50%) translateY(-2px);
}
.hdr-nav {
    height: 100%;
}
.hdr-nav__list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    align-items: center;
}
.hdr-nav__item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}
.hdr-nav__link {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--hdr-dark);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}
.hdr-nav__link:hover,
.hdr-nav__item--open > .hdr-nav__link {
    color: var(--hdr-magenta);
    border-bottom-color: var(--hdr-magenta);
}
.hdr-nav__chevron {
    display: none; /* Sin flechitas, como la referencia */
}
.hdr-nav__item--open > .hdr-nav__link .hdr-nav__chevron {
    transform: rotate(180deg);
}

.btn-cta-nav {
    background-color: var(--hdr-magenta);
    color: #ffffff !important;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(16,144,160,0.15);
    border: none;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    z-index: 1;
}
.btn-cta-nav::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60px;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-20deg);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    pointer-events: none;
}
.btn-cta-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(16,144,160,0.3);
    background-color: #f70075 !important;
}
.btn-cta-nav:hover::after {
    left: 200%;
}

/* --- MEGA MENU PANEL --- */
.mega-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: max-content;
    background: #ffffff;
    border: 1px solid var(--hdr-border);
    border-top: none;
    border-radius: 0 0 var(--radio-md) var(--radio-md);
    box-shadow: var(--hdr-shadow);
    z-index: 10010;
    animation: megaSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.mega-panel--center {
    left: 50% !important;
    transform: translateX(-50%) !important;
}
/* Panel ancho centrado en la BARRA, no en su propio enlace.
   El <li> deja de ser el marco de referencia (position: static) y pasa a serlo
   .hdr-nav-bar-inner, que ya es relative; así el panel queda centrado en la página
   en vez de colgar del borde izquierdo de «Ropa Personalizada». */
.hdr-nav__item--mega-ancho {
    position: static;
}
.hdr-nav__item--mega-ancho > .mega-panel {
    left: 50%;
    transform: translateX(-50%);
}
.mega-panel--right {
    left: auto !important;
    right: 0 !important;
}
@keyframes megaSlideIn {
    from { opacity: 0; margin-top: -5px; }
    to { opacity: 1; margin-top: 0; }
}
.hdr-nav__item--open > .mega-panel {
    display: block;
}
.mega-panel__inner {
    display: grid;
    gap: 0;
    margin: 0 auto;
    padding: 30px 40px;
    max-width: 1400px;
    width: 92%;
    box-sizing: border-box;
}
.mega-col {
    padding: 0 24px;
    box-sizing: border-box;
}
/* Separación entre los ejes del submenú (para quién · de qué es · cómo sienta):
   una línea fina en vez de un título, para no alargar el desplegable. */
.mega-panel li.mega-sep,
.mob-submenu li.mega-sep {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border, #e2e8f0);
}
.mega-col + .mega-col {
    border-left: 1px solid var(--hdr-border);
}
.mega-col__heading {
    font-family: var(--font-head);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--hdr-magenta);
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--hdr-border);
}
.mega-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mega-col ul a {
    display: block;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hdr-dark);
    text-decoration: none;
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
}
.mega-col ul a:hover {
    background-color: var(--hdr-light);
    color: var(--hdr-magenta);
    padding-left: 14px;
}

/* --- MOBILE HAMBURGER --- */
.hdr-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}
.hdr-burger:hover {
    background-color: var(--hdr-light);
}
.hdr-burger span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--hdr-dark);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease, width 0.2s ease;
}
.hdr-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hdr-burger.is-open span:nth-child(2) { opacity: 0; width: 0; }
.hdr-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- MOBILE DRAWER --- */
.mob-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26,26,46,0.5);
    z-index: 1099;
    backdrop-filter: blur(4px);
}
.mob-overlay.is-visible {
    display: block;
}
.mob-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(340px, 85vw);
    height: 100%;
    background: #ffffff;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 32px rgba(26,26,46,0.1);
}
.mob-drawer:not([hidden]) {
    transform: translateX(0);
}
.mob-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hdr-border);
    flex-shrink: 0;
}
.mob-drawer__close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--hdr-dark);
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}
.mob-drawer__close:hover {
    background-color: var(--hdr-light);
}
.mob-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}
.mob-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mob-item {
    border-bottom: 1px solid var(--hdr-border);
}
.mob-item__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px 20px;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--hdr-dark);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}
.mob-item__toggle:hover {
    background-color: var(--hdr-light);
    color: var(--hdr-magenta);
}
.mob-item__toggle[aria-expanded="true"] {
    color: var(--hdr-magenta);
}
.mob-item__icon {
    font-size: 20px;
    color: var(--hdr-magenta);
    transition: transform 0.25s ease;
    line-height: 1;
}
.mob-item__toggle[aria-expanded="true"] .mob-item__icon {
    transform: rotate(45deg);
}
.mob-submenu {
    list-style: none;
    margin: 0;
    padding: 0 0 10px 0;
    background-color: var(--hdr-light);
}
.mob-submenu[hidden] {
    display: none;
}
.mob-submenu li a {
    display: block;
    padding: 10px 20px 10px 30px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hdr-dark);
    text-decoration: none;
    transition: var(--transition);
}
.mob-submenu li a:hover {
    color: var(--hdr-magenta);
    background-color: rgba(16,144,160,0.03);
}
.mob-drawer__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--hdr-border);
    flex-shrink: 0;
}
.mob-cta {
    display: flex;
    justify-content: center;
    width: auto;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 15px;
}

/* --- SCROLLED STATE --- */
.site-header.is-scrolled .hdr-top-bar {
    height: 0;
    border-bottom-color: transparent;
    overflow: hidden;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 991px) {
    .hdr-top-bar { display: none; }
    .hdr-nav-bar { display: none; }
    .hdr-search-box { display: none; } /* Hide search in main header, drawer search is used */
    .hdr-burger { display: flex; }
    .hdr-action-text { display: none; } /* Hide labels on mobile */
    .hdr-action-link { padding: 8px; }
    .hdr-main-bar { height: 68px; }
    .hdr-logo__img { height: 40px; }
}
