/* =========================================================================
   HEADER
   ========================================================================= */
.rd-header {
    position: sticky;
    top: 0;
    z-index: var(--rd-header-z);
    background: var(--rd-color-bg);
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, .04);
    transition: box-shadow .25s ease;
}
.rd-header.is-scrolled {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

/* Forzar altura constante: ignorar cualquier "shrink on scroll" de
   plugins de optimización que puedan estar modificando el header.
   IMPORTANTE: NO incluimos .rd-header.is-scrolled en estos selectores porque
   tendría más especificidad que los media queries de móvil y rompería el grid */
.rd-header__inner {
    display: grid;
    align-items: center;
    height: var(--rd-header-height-desktop) !important;
    padding: 0 var(--rd-header-padding-x);
    max-width: 100%;
    grid-template-columns: 40fr 20fr 31fr 9fr;
    gap: 16px;
}

/* Logo NO debe cambiar de tamaño al hacer scroll */
.rd-header__logo {
    display: flex;
    justify-content: center;
    align-items: center;
}
.rd-header__logo-link {
    display: inline-flex;
    align-items: center;
    color: var(--rd-color-primary);
    line-height: 1;
}
.rd-header__logo-svg {
    display: block;
    height: 60px;
    width: auto;
}
.rd-header__logo img {
    max-width: 100%;
    height: auto;
    max-height: 80px;
    width: auto;
}

/* --- Menús (desktop) --- */
.rd-header__nav {
    display: flex;
    align-items: center;
}
.rd-header__nav--left   { justify-content: flex-end; }
.rd-header__nav--right  { justify-content: flex-start; }

.rd-header__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}
.rd-header__nav li { margin: 0; }

.rd-header__nav a {
    font-family: var(--rd-font-display);
    font-size: 18px;
    font-weight: 400;
    font-style: normal;
    text-decoration: none;
    padding: 8px 14px;
    display: inline-block;
    transition: color .2s ease;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--rd-color-primary);
    position: relative;
}

/* Hover y foco: solo cambio de color (sin rayita) */
.rd-header__nav a:hover,
.rd-header__nav a:focus {
    color: #000;
}

/* Activo: rayita debajo en granate, sin cambio de color de texto */
.rd-header__nav .current-menu-item > a,
.rd-header__nav .current-menu-ancestor > a,
.rd-header__nav .current-menu-parent > a,
.rd-header__nav .current_page_item > a {
    color: var(--rd-color-primary);
}
.rd-header__nav .current-menu-item > a::after,
.rd-header__nav .current-menu-ancestor > a::after,
.rd-header__nav .current-menu-parent > a::after,
.rd-header__nav .current_page_item > a::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 4px;
    height: 2px;
    background: var(--rd-color-primary);
    border-radius: 1px;
}

/* --- Acciones (cuenta + carrito) --- */
.rd-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.rd-header__action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--rd-color-primary);
    transition: color .2s ease;
    text-decoration: none;
    line-height: 1;
}
.rd-header__action-link:hover,
.rd-header__action-link:focus { color: #000; }

.rd-header__action-link svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* --- Carrito + badge --- */
.rd-header__cart {
    position: relative;
}
.rd-header__cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--rd-color-cart-badge);
    color: #fff;
    font-family: var(--rd-font-body);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.rd-header__cart-count[data-count="0"] { display: none; }

/* --- Hamburguesa (oculta en desktop) --- */
.rd-header__toggle,
.rd-header__toggle:hover,
.rd-header__toggle:focus {
    background: transparent;
    background-color: transparent;
}
.rd-header__toggle {
    display: none;
    border: 0;
    padding: 8px;
    cursor: pointer;
    color: var(--rd-color-primary);
    transition: color .2s ease;
}
.rd-header__toggle:hover,
.rd-header__toggle:focus { color: #000; }
.rd-header__toggle svg {
    width: 28px;
    height: 28px;
    display: block;
}

/* =========================================================================
   RESPONSIVE — Mobile/Tablet
   En <=1024px ocultamos los 2 menús laterales y mostramos hamburguesa.
   ========================================================================= */
@media (max-width: 1024px) {
    .rd-header__inner {
        height: var(--rd-header-height-mobile);
        grid-template-columns: 1fr 1fr 1fr;
        padding: 0 16px;
        align-items: center;
    }
    .rd-header__nav--left,
    .rd-header__nav--right { display: none; }

    .rd-header__toggle    { display: inline-flex; justify-self: start; align-self: center; }
    .rd-header__logo      { justify-self: center; align-self: center; }
    .rd-header__actions   { justify-self: end; align-self: center; }

    .rd-header__logo img       { max-height: 60px; }
    .rd-header__logo-svg       { height: 52px; }
}

/* --- Off-canvas menú móvil --- */
.rd-mobile-nav {
    position: fixed;
    inset: 0;
    background: var(--rd-color-bg);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .3s ease;
    padding: 80px 24px 24px;
    overflow-y: auto;
}
.rd-mobile-nav[aria-hidden="false"] { transform: translateX(0); }

.rd-mobile-nav__close,
.rd-mobile-nav__close:hover,
.rd-mobile-nav__close:focus {
    background: transparent;
    background-color: transparent;
}
.rd-mobile-nav__close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: 0;
    padding: 8px;
    cursor: pointer;
    color: var(--rd-color-primary);
    transition: color .2s ease;
}
.rd-mobile-nav__close:hover,
.rd-mobile-nav__close:focus { color: #000; }
.rd-mobile-nav__close svg { width: 28px; height: 28px; }

.rd-mobile-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.rd-mobile-nav li { border-bottom: 1px solid rgba(0,0,0,.06); }
.rd-mobile-nav a {
    display: block;
    padding: 18px 0;
    font-family: var(--rd-font-display);
    font-size: 22px;
    color: var(--rd-color-primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.rd-mobile-nav a:hover { color: #000; }

body.rd-mobile-nav-open { overflow: hidden; }
