/**
 * Header WP — paridad visual con ReinoShellV2 (/dev/app).
 * Sticky + fondo translúcido; el contenido scrollea por debajo.
 * Oculta header.header del theme Juan.
 */

/* Ocultar chrome WP nativo */
body.reino-kit-app-header header.header {
  display: none !important;
}

/*
 * El theme reservaba espacio para header.header fixed (~67px).
 * Con nuestro sticky ese padding genera el hueco verde inicial.
 */
body.reino-kit-app-header {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body.reino-kit-app-header .login-page,
body.reino-kit-app-header section.login-page,
body.reino-kit-app-header section.recover-password,
body.reino-kit-app-header section.register-page,
body.reino-kit-app-header main,
body.reino-kit-app-header .site-main {
  padding-top: 0 !important;
}

/* Mi cuenta: aire bajo el sticky (checkout/carrito ya tienen 1.5rem). */
body.reino-kit-app-header .account-page,
body.reino-kit-app-header section.account-page {
  padding-top: 1.5rem !important;
}

/* Checkout / carrito: aire bajo el sticky (el theme usaba 4rem; sin eso el notice queda pegado) */
body.reino-kit-app-header section.checkout-page,
body.reino-kit-app-header section.cart-page {
  padding-top: 1.5rem !important;
  padding-bottom: 3rem !important;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Mobile — checkout / carrito / mi cuenta (editar perfil) a casi ancho completo */
@media (max-width: 767px) {
  body.reino-kit-app-header section.checkout-page,
  body.reino-kit-app-header section.cart-page {
    padding-left: 10px;
    padding-right: 10px;
  }

  body.reino-kit-app-header .account-page,
  body.reino-kit-app-header section.account-page {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  /* Theme .c-wrap = 50px laterales; sin esto el pergamino queda ~66px del borde.
     Solo el wrap de la página (no el del header). */
  body.woocommerce-checkout section.checkout-page > .c-wrap,
  body.woocommerce-cart section.cart-page > .c-wrap,
  body.woocommerce-account section.account-page > .c-wrap,
  body.woocommerce-account .account-page > .c-wrap {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

.reino-kit-site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  overflow: visible;
  margin: 0;
  border-bottom: 1px solid rgba(197, 160, 89, 0.18);
  background-color: rgba(15, 42, 34, 0.84);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-family: "Source Sans 3", system-ui, -apple-system, sans-serif;
  color: #e8d4a8;
}

.reino-kit-site-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

@media (min-width: 640px) {
  .reino-kit-site-header__top {
    padding: 1rem;
  }
}

.reino-kit-site-header__brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
  flex-shrink: 0;
  padding: 0.1rem 0.35rem 0.15rem;
  text-decoration: none;
  color: #ffffff;
  border-radius: 0.35rem;
  transition: color 200ms ease, text-shadow 200ms ease;
  -webkit-tap-highlight-color: transparent;
}

.reino-kit-site-header__brand:hover,
.reino-kit-site-header__brand:focus-visible {
  color: #fff5e2;
  text-shadow: 0 0 16px rgba(255, 245, 226, 0.32);
}

/* Corona (417×243): fijamos ancho y dejamos que el ratio del <img> dé el alto. */
.reino-kit-site-header__mark {
  display: block;
  width: 3.1rem;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  transition: filter 200ms ease, opacity 200ms ease, transform 200ms ease;
}

@media (min-width: 640px) {
  .reino-kit-site-header__mark {
    width: 3.8rem;
  }
}

.reino-kit-site-header__brand:hover .reino-kit-site-header__mark,
.reino-kit-site-header__brand:focus-visible .reino-kit-site-header__mark {
  opacity: 1;
  filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 245, 226, 0.55));
  transform: scale(1.03);
}

.reino-kit-site-header__home-label {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
  /* letter-spacing deja aire sólo a la derecha: compensamos para centrar óptico */
  text-indent: 0.16em;
}

@media (min-width: 640px) {
  .reino-kit-site-header__home-label {
    font-size: 0.68rem;
  }
}

.reino-kit-site-header__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(197, 160, 89, 0.32);
  background: rgba(197, 160, 89, 0.08);
  color: #e8d4a8;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

@media (min-width: 640px) {
  .reino-kit-site-header__cta {
    font-size: 0.75rem;
    padding: 0.45rem 1.1rem;
  }
}

.reino-kit-site-header__cta:hover,
.reino-kit-site-header__cta:focus-visible {
  background: rgba(197, 160, 89, 0.16);
  border-color: rgba(197, 160, 89, 0.5);
  color: #fff5e2;
}

/* —— Acciones derecha: cofre + perfil/CTA + burger —— */
.reino-kit-site-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
  flex-shrink: 0;
}

.reino-kit-site-header__cofre {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2.25rem;
  /* Más aire a los lados: el icono no debe pegarse al radio del borde. */
  padding: 0 0.75rem 0 0.7rem;
  border-radius: 9999px;
  border: 1px solid rgba(197, 160, 89, 0.32);
  background: rgba(197, 160, 89, 0.08);
  color: #e8d4a8;
  text-decoration: none;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.reino-kit-site-header__cofre:hover,
.reino-kit-site-header__cofre:focus-visible,
.reino-kit-site-header__cofre[aria-current="page"] {
  background: rgba(197, 160, 89, 0.16);
  border-color: rgba(197, 160, 89, 0.5);
  color: #fff5e2;
}

.reino-kit-site-header__cofre-icon {
  display: block;
  width: calc(1.7rem - 2px);
  height: calc(1.05rem - 2px);
  object-fit: contain;
  flex-shrink: 0;
}

.reino-kit-site-header__cofre-fallback {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reino-kit-site-header__cofre-count {
  min-width: 1.1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(232, 212, 168, 0.72);
  text-align: center;
}

.reino-kit-site-header__cofre.has-items .reino-kit-site-header__cofre-count {
  color: #f0d78a;
}

/* —— Perfil logueado (paridad ReinoShellV2) —— */
.reino-kit-site-header__profile {
  position: relative;
  z-index: 40;
  margin-left: 0;
  flex-shrink: 0;
}

.reino-kit-site-header__profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 14rem;
  height: 2.25rem;
  padding: 0 0.65rem 0 0.35rem;
  border-radius: 9999px;
  border: 1px solid rgba(197, 160, 89, 0.32);
  background: rgba(197, 160, 89, 0.08);
  color: #e8d4a8;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.reino-kit-site-header__profile-chip:hover,
.reino-kit-site-header__profile-chip:focus-visible,
.reino-kit-site-header__profile.is-open .reino-kit-site-header__profile-chip {
  background: rgba(197, 160, 89, 0.16);
  border-color: rgba(197, 160, 89, 0.5);
  color: #fff5e2;
}

.reino-kit-site-header__profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: #3f1418;
  color: #e8d4a8;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  overflow: hidden;
}

.reino-kit-site-header__profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reino-kit-site-header__profile-avatar--photo {
  background: transparent;
  color: transparent;
}

.reino-kit-site-header__profile-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reino-kit-site-header__profile-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 50;
  width: 13rem;
  overflow: hidden;
  border-radius: 0.65rem;
  border: 1px solid rgba(154, 122, 77, 0.45);
  background:
    linear-gradient(180deg, #fff8e8 0%, #f4e6c8 52%, #ecd6b0 100%);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 245, 226, 0.55);
}

.reino-kit-site-header__profile-menu[hidden] {
  display: none !important;
}

.reino-kit-site-header__profile-item {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  color: #3f1418;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.reino-kit-site-header__profile-item:hover,
.reino-kit-site-header__profile-item:focus-visible {
  background-color: rgba(199, 169, 127, 0.35);
  color: #6b2329;
}

.reino-kit-site-header__profile-item--accent {
  color: #6b2329;
  font-weight: 600;
}

.reino-kit-site-header__profile-item--danger {
  color: #6b2329;
}

.reino-kit-site-header__profile-item--danger:hover,
.reino-kit-site-header__profile-item--danger:focus-visible {
  background-color: rgba(138, 42, 48, 0.12);
}

.reino-kit-site-header__profile-divider {
  height: 1px;
  margin-inline: 0.75rem;
  background: rgba(154, 122, 77, 0.28);
}

.reino-kit-site-header__drawer-sep {
  height: 1px;
  margin: 0.5rem 0;
  background: rgba(197, 160, 89, 0.22);
  list-style: none;
}

.reino-kit-site-header__drawer-logout {
  color: #e8b4b0 !important;
}

.reino-kit-site-header__burger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 9999px;
  border: 1px solid rgba(197, 160, 89, 0.32);
  background: transparent;
  color: #e8d4a8;
  cursor: pointer;
  padding: 0;
}

.reino-kit-site-header__burger-lines {
  position: relative;
  display: block;
  width: 1rem;
  height: 0.75rem;
}

.reino-kit-site-header__burger-lines span {
  position: absolute;
  left: 0;
  display: block;
  width: 100%;
  height: 1.5px;
  background: currentColor;
}

.reino-kit-site-header__burger-lines span:nth-child(1) { top: 0; }
.reino-kit-site-header__burger-lines span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.reino-kit-site-header__burger-lines span:nth-child(3) { bottom: 0; }

.reino-kit-site-header__menubar {
  display: none;
  border-top: 1px solid rgba(197, 160, 89, 0.18);
  background-color: rgba(15, 42, 34, 0.68);
}

@media (min-width: 768px) {
  .reino-kit-site-header__burger {
    display: none;
  }

  .reino-kit-site-header__menubar {
    display: block;
  }
}

.reino-kit-site-header__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.55rem 1rem;
  list-style: none;
}

.reino-kit-site-header__nav a,
.reino-kit-site-header__nav .reino-kit-site-header__soon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 7px 0.65rem 5px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: #a89988;
  transition: color 200ms ease;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .reino-kit-site-header__nav a,
  .reino-kit-site-header__nav .reino-kit-site-header__soon {
    font-size: 0.75rem;
    padding: 9px 0.75rem 7px;
  }
}

.reino-kit-site-header__nav a:hover,
.reino-kit-site-header__nav a:focus-visible {
  color: #e8d4a8;
}

.reino-kit-site-header__sep {
  display: none;
  color: rgba(197, 160, 89, 0.35);
  font-size: 0.85rem;
  user-select: none;
}

@media (min-width: 640px) {
  .reino-kit-site-header__sep {
    display: inline;
  }
}

.reino-kit-site-header__soon {
  opacity: 0.9;
  cursor: default;
}

.reino-kit-site-header__soon-badge {
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(168, 153, 136, 0.75);
}

/* Drawer mobile */
.reino-kit-site-header__drawer {
  display: none;
  border-top: 1px solid rgba(197, 160, 89, 0.18);
  background-color: rgba(15, 42, 34, 0.97);
  padding: 0.75rem 1rem 1rem;
}

.reino-kit-site-header.is-drawer-open .reino-kit-site-header__drawer {
  display: block;
}

@media (min-width: 768px) {
  .reino-kit-site-header__drawer,
  .reino-kit-site-header.is-drawer-open .reino-kit-site-header__drawer {
    display: none !important;
  }
}

.reino-kit-site-header__drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.reino-kit-site-header__drawer-nav a,
.reino-kit-site-header__drawer-nav .reino-kit-site-header__soon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: #a89988;
}

.reino-kit-site-header__drawer-nav a:hover {
  color: #e8d4a8;
  background: rgba(197, 160, 89, 0.08);
}
