/* =========================================================
   RD HEADER FLOATING - REDESIGN 2026
========================================================= */
.rd-header {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 999999;
  width: calc(100% - 100px);
  max-width: 100%;
  height: 60px;
  display:flex;
  margin: 0;
  color: var(--rd-text);
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(229, 229, 226, .82);
  border-radius: var(--rd-radius);
  box-shadow: 0 10px 36px rgba(17, 17, 17, .075);
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition:
    top .25s ease,
    background-color .25s ease,
    box-shadow .25s ease;
}

.rd-header.is-scrolled {
  top: 10px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 12px 40px rgba(17, 17, 17, .10);
}

.rd-header .rd-topbar {
  position: absolute;
  top: 7px;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

.rd-header .header-cabecera-text {
  margin: 0;
  padding: 0;
  color: var(--rd-text-muted);
  font-size: 8px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 1.5px;
  white-space: nowrap;
}

.rd-header .rd-header__inner {
  position: relative;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 140px;
  align-items: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0px 24px 0;
  box-sizing: border-box;
  background: transparent;
  border: 0;
}

.rd-header .rd-header__logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  width: auto;
  height: 50px;
  margin: 0;
  padding: 0;
}

.rd-header .rd-header__logo img {
  display: block;
  width: 68px;
  max-width: 68px;
  height: 42px;
  margin: 0;
  object-fit: contain;
}

.rd-header .rd-header__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: clamp(18px, 1.65vw, 34px);
  width: auto;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.rd-header .rd-header__nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  margin: 0;
  padding: 0;
  color: var(--rd-text);
  background: transparent;
  border: 0;
  font-family: var(--rd-font-title);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .45px;
  text-decoration: none;
  text-transform: uppercase;
  transition: color .2s ease;
}

.rd-header .rd-header__nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 0;
  height: 2px;
  background: var(--rd-accent);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width .2s ease;
}

.rd-header .rd-header__nav a:hover,
.rd-header .rd-header__nav a:focus-visible,
.rd-header .rd-header__nav a[aria-current="page"] {
  color: var(--rd-text);
}

.rd-header .rd-header__nav a:hover::after,
.rd-header .rd-header__nav a:focus-visible::after,
.rd-header .rd-header__nav a[aria-current="page"]::after {
  width: 18px;
}

/* El menu responsive nunca debe participar en el layout desktop. */
.rd-header .rd-mobile-menu {
  display: none;
}

.rd-header .rd-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 3px;
  margin: 0;
  padding: 0;
}

.rd-header .rd-icon-btn,
.rd-header button.rd-icon-btn,
.rd-header .rd-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  color: var(--rd-text);
  background: transparent;
  border: 0;
  border-radius: var(--rd-radius-sm);
  box-shadow: none;
  transform: none;
}

.rd-header .rd-icon-btn:hover,
.rd-header .rd-icon-btn:focus-visible,
.rd-header .rd-menu-toggle:hover,
.rd-header .rd-menu-toggle:focus-visible {
  color: var(--rd-text);
  background: rgba(186, 181, 246, .18);
  transform: none;
}

.rd-header .rd-icon-btn img,
.rd-header .rd-account-btn img {
  display: block;
  width: 21px;
  height: 21px;
  object-fit: contain;
  filter: brightness(0);
  opacity: .88;
}

.rd-header .rd-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.rd-header .rd-menu-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--rd-text);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}

.rd-header .rd-menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.rd-header .rd-menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.rd-header .rd-menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* El shortcode mantiene su comportamiento; solo hereda el nuevo color. */
.rd-header .rd-cart-trigger,
.rd-header .rd-cart-trigger:hover,
.rd-header .rd-cart-trigger:focus {
  color: var(--rd-text);
}

.rd-header .rd-cart-count,
.rd-header .rd-cart-trigger__count {
  color: var(--rd-text);
  background: var(--rd-accent);
}

@media (max-width: 1280px) {
  .rd-header .rd-header__inner {
    grid-template-columns: 110px minmax(0, 1fr) 120px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .rd-header .rd-header__nav {
    gap: 17px;
  }

  .rd-header .rd-header__nav a {
    font-size: 10.5px;
  }
}

@media (max-width: 1100px) {
  .rd-header {
    top: 12px;
    height: 64px;
  }

  .rd-header .rd-header__inner {
    grid-template-columns: 1fr auto;
    padding: 6px 13px 0;
  }

  .rd-header .rd-header__nav {
    display: none;
  }

  .rd-header .rd-menu-toggle {
    display: inline-flex;
  }

  .rd-header .rd-header__logo img {
    width: 62px;
    max-width: 62px;
    height: 46px;
  }

  .rd-header .rd-mobile-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    padding: 10px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, .98);
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-radius);
    box-shadow: 0 20px 50px rgba(17, 17, 17, .12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.985);
    transform-origin: top center;
    pointer-events: none;
    overflow: hidden;
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
  }

  .rd-header .rd-mobile-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .rd-header .rd-mobile-menu__nav {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .rd-header .rd-mobile-menu__nav a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    box-sizing: border-box;
    color: var(--rd-text);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--rd-border);
    border-radius: var(--rd-radius-sm);
    text-decoration: none;
    opacity: 0;
    transform: translateY(-5px);
    transition:
      color .2s ease,
      background-color .2s ease,
      opacity .2s ease,
      transform .2s ease;
  }

  .rd-header .rd-mobile-menu.is-open .rd-mobile-menu__nav a {
    opacity: 1;
    transform: translateY(0);
  }

  .rd-header .rd-mobile-menu.is-open .rd-mobile-menu__nav a:nth-child(2) {
    transition-delay: .025s;
  }

  .rd-header .rd-mobile-menu.is-open .rd-mobile-menu__nav a:nth-child(3) {
    transition-delay: .05s;
  }

  .rd-header .rd-mobile-menu.is-open .rd-mobile-menu__nav a:nth-child(4) {
    transition-delay: .075s;
  }

  .rd-header .rd-mobile-menu.is-open .rd-mobile-menu__nav a:nth-child(5) {
    transition-delay: .1s;
  }

  .rd-header .rd-mobile-menu.is-open .rd-mobile-menu__nav a:nth-child(n+6) {
    transition-delay: .125s;
  }

  .rd-header .rd-mobile-menu__nav a:last-child {
    border-bottom: 0;
  }

  .rd-header .rd-mobile-menu__nav a:hover,
  .rd-header .rd-mobile-menu__nav a:focus-visible {
    color: var(--rd-text);
    background: rgba(186, 181, 246, .14);
  }

  .rd-header .rd-mobile-menu__nav a span {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .7px;
    text-transform: uppercase;
  }

  .rd-header .rd-mobile-menu__nav a::after {
    content: "\2192";
    margin-left: auto;
    color: var(--rd-accent-hover);
    font-size: 17px;
  }

  .rd-header .rd-mobile-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--rd-text);
    background: var(--rd-bg-soft);
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-radius-sm);
  }
}

body.rd-menu-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .rd-header,
  .rd-header *,
  .rd-header *::before,
  .rd-header *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

@media (max-width: 1023px) {
  .rd-header {
    width: calc(100% - 50px);
  }
}

@media (max-width: 767px) {
  .rd-header,
  .rd-header.is-scrolled {
    top: 8px;
    width: calc(100% - 30px);
    height: 58px;
  }

  .rd-header .rd-header__inner {
    padding: 0px 8px 0 13px;
  }

  .rd-header .rd-topbar {
    display: none;
  }

  .rd-header .rd-header__logo img {
    width: 56px;
    max-width: 56px;
    height: 43px;
  }

  .rd-header .rd-icon-btn,
  .rd-header button.rd-icon-btn,
  .rd-header .rd-menu-toggle {
    width: 38px;
    min-width: 38px;
    height: 38px;
  }

  .rd-header .rd-icon-btn img,
  .rd-header .rd-account-btn img {
    width: 19px;
    height: 19px;
  }

  .rd-header .rd-mobile-menu {
    top: calc(100% + 8px);
  }
}

@media (max-width: 365px) {
  .rd-header .rd-account-btn {
    display: none;
  }
}

/* Compatibilidad con el antiguo override oscuro del header.
   Se mantiene al final para ganar su misma especificidad. */
html body .rd-header {
  background-color: rgba(255, 255, 255, .88) !important;
  background-image: none !important;
  border-color: rgba(229, 229, 226, .86) !important;
  border-radius: var(--rd-radius) !important;
  box-shadow: 0 12px 42px rgba(17, 17, 17, .10) !important;
  -webkit-backdrop-filter: saturate(135%) blur(18px) !important;
  backdrop-filter: saturate(135%) blur(18px) !important;
}

html body .rd-header.is-scrolled {
  background-color: rgba(255, 255, 255, .95) !important;
  box-shadow: 0 14px 44px rgba(17, 17, 17, .12) !important;
}

html body .rd-header .header-cabecera-text {
  color: var(--rd-text-muted) !important;
}

html body .rd-header .rd-header__nav a,
html body .rd-header .rd-icon-btn,
html body .rd-header button.rd-icon-btn,
html body .rd-header .rd-menu-toggle,
html body .rd-header .rd-cart-trigger {
  color: var(--rd-text) !important;
}

html body .rd-header .rd-header__nav a::after,
html body .rd-header .rd-cart-count,
html body .rd-header .rd-cart-trigger__count {
  background: var(--rd-accent) !important;
}

html body .rd-header .rd-header__nav a:hover,
html body .rd-header .rd-header__nav a:focus-visible,
html body .rd-header .rd-header__nav a[aria-current="page"] {
  color: var(--rd-text) !important;
}

html body .rd-header .rd-icon-btn:hover,
html body .rd-header .rd-icon-btn:focus-visible,
html body .rd-header .rd-menu-toggle:hover,
html body .rd-header .rd-menu-toggle:focus-visible {
  background: rgba(186, 181, 246, .18) !important;
}

html body .rd-header .rd-icon-btn img,
html body .rd-header .rd-account-btn img {
  filter: brightness(0) !important;
}

html body .rd-header .rd-menu-toggle span {
  background: var(--rd-text) !important;
}

@media (max-width: 1100px) {
  html body .rd-header .rd-mobile-menu {
    background-color: rgba(255, 255, 255, .94) !important;
    background-image: none !important;
    border-color: var(--rd-border) !important;
    box-shadow: 0 20px 50px rgba(17, 17, 17, .12) !important;
    -webkit-backdrop-filter: saturate(135%) blur(18px) !important;
    backdrop-filter: saturate(135%) blur(18px) !important;
  }

  html body .rd-header .rd-mobile-menu__nav a {
    color: var(--rd-text) !important;
    border-bottom-color: var(--rd-border) !important;
  }

  html body .rd-header .rd-mobile-menu__nav a:hover,
  html body .rd-header .rd-mobile-menu__nav a:focus-visible {
    color: var(--rd-text) !important;
    background: rgba(186, 181, 246, .14) !important;
  }

  html body .rd-header .rd-mobile-menu__nav a::after {
    color: var(--rd-accent-hover) !important;
  }
}
