/**
 * header.css — Estilos del Header para XETA 3D STUDIO.
 *
 * Características:
 *  - Dark mode nativo de alto contraste y legibilidad técnica.
 *  - Alusión y profundidad 3D (coordenadas, perspectiva, biseles táctiles).
 *  - Microanimaciones aceleradas por GPU (transform, opacity).
 *  - Shrink-on-scroll responsivo y fluido mediante CSS custom property (--header-scroll).
 *  - Menú drawer mobile con efecto glassmorphism y entrada escalonada.
 *
 * @package Astra Child - Xeta 3D Studio
 */

:root {
  --header-scroll: 0;
  --header-max-w: 1360px;
  --header-h-default: 82px;
  --header-h-shrink: 68px;
}

/* ==========================================================================
   Contenedor Principal del Header
   ========================================================================== */
.xeta-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  width: 100%;
  font-family: var(--font-text, "Poppins", sans-serif);
  padding: calc(14px - (var(--header-scroll) * 6px)) 0;
  transition: padding 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none; /* Permite clicks fuera del shell */
}

.xeta-header a,
.xeta-header button {
  pointer-events: auto;
  text-decoration: none !important;
  color: inherit;
}

.xeta-header a,
.xeta-header a:visited,
.xeta-nav-link,
.xeta-nav-link__text {
  color: var(--on-surface-variant, #c5c6ce) !important;
  text-decoration: none !important;
}

.xeta-header a:hover,
.xeta-header a:focus-visible,
.xeta-nav-link:hover,
.xeta-nav-link:hover .xeta-nav-link__text {
  color: #ffffff !important;
}

.xeta-cta-btn,
.xeta-cta-btn:visited,
.xeta-cta-btn * {
  color: #ffffff !important;
  text-decoration: none !important;
}

/* Shell contenedor con adaptación fluida (shrink pill en scroll) */
.xeta-header__shell {
  width: calc(100% - (var(--header-scroll) * 32px));
  max-width: var(--header-max-w);
  margin: 0 auto;
  padding: 0 1rem;
  transition:
    width 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    max-width 0.25s;
}

@media (max-width: 768px) {
  .xeta-header {
    padding: 8px 0;
  }
  .xeta-header__shell {
    width: 100%;
    padding: 0 0.75rem;
  }
}

/* Caja de vidrio / Cápsula del header */
.xeta-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: calc(var(--header-h-default) - (var(--header-scroll) * 14px));
  padding: 0 1.5rem;
  background-color: rgba(
    18,
    19,
    22,
    calc(0.72 + (var(--header-scroll) * 0.23))
  );
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid
    rgba(255, 255, 255, calc(0.08 + (var(--header-scroll) * 0.04)));
  border-radius: calc(14px + (var(--header-scroll) * 10px));
  box-shadow:
    0 8px 32px -4px rgba(0, 0, 0, calc(0.3 + (var(--header-scroll) * 0.35))),
    0 0 20px -5px rgba(255, 102, 0, calc(var(--header-scroll) * 0.12));
  transition:
    height 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .xeta-header__inner {
    height: 62px;
    padding: 0 1rem;
    border-radius: 12px;
  }
}

/* ==========================================================================
   1. Brand & Logo con Viewport 3D
   ========================================================================== */
.xeta-header__brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.xeta-header__logo-link {
  display: inline-flex;
  align-items: center;
  position: relative;
  perspective: 700px;
  outline: none;
}

.xeta-logo-3d-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.xeta-header__logo-img {
  display: block;
  width: auto;
  height: calc(54px - (var(--header-scroll) * 8px));
  max-height: 56px;
  object-fit: contain;
  transition:
    height 0.25s ease,
    filter 0.3s ease;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

@media (max-width: 768px) {
  .xeta-header__logo-img {
    height: 40px;
    max-height: 42px;
  }
}

.xeta-mobile-drawer__logo {
  height: 42px;
  width: auto;
  object-fit: contain;
}

/* Halo de luz 3D detrás del logo al interactuar */
.xeta-logo-glow {
  position: absolute;
  inset: -10px -15px;
  background: radial-gradient(
    circle,
    rgba(255, 102, 0, 0.35) 0%,
    transparent 70%
  );
  opacity: 0;
  transform: translateZ(-10px);
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.xeta-header__logo-link:hover .xeta-logo-glow,
.xeta-header__logo-link:focus-visible .xeta-logo-glow {
  opacity: 1;
}

/* ==========================================================================
   2. Navegación Desktop
   ========================================================================== */
.xeta-header__nav {
  display: none;
}

@media (min-width: 992px) {
  .xeta-header__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
  }
}

.xeta-nav-list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 992px) and (max-width: 1260px) {
  .xeta-nav-list {
    gap: 0.15rem;
  }
  .xeta-nav-link {
    padding: 0.45rem 0.6rem !important;
    font-size: 0.82rem !important;
  }
  .xeta-cta-btn__surface {
    padding: 0.55rem 0.9rem !important;
    font-size: 0.82rem !important;
  }
}

.xeta-nav-item {
  position: relative;
}

.xeta-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap !important;
  color: var(--on-surface-variant, #c5c6ce) !important;
  text-decoration: none !important;
  border-radius: 8px;
  transition:
    color 0.25s ease,
    transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform: translateZ(0);
}

.xeta-nav-link__text {
  position: relative;
  z-index: 2;
  letter-spacing: -0.01em;
  white-space: nowrap !important;
}

/* Badges ocultos por requerimiento */
.xeta-nav-badge {
  display: none !important;
}

/* Indicador de eje 3D / cota en hover */
.xeta-nav-indicator {
  position: absolute;
  bottom: 0.15rem;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff6600, #68dcf7);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255, 102, 0, 0.7);
  transform: translateX(-50%) translateZ(4px);
  opacity: 0;
  transition:
    width 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.25s ease;
}

/* Hover & Focus en Links */
.xeta-nav-link:hover,
.xeta-nav-link:focus-visible {
  color: #ffffff !important;
  transform: translateY(-2px) translateZ(8px);
}

.xeta-nav-link:hover .xeta-nav-indicator,
.xeta-nav-link:focus-visible .xeta-nav-indicator {
  width: 75%;
  opacity: 1;
}

.xeta-nav-link:hover .xeta-nav-badge {
  transform: translateY(-1px) scale(1.05);
  border-color: rgba(104, 220, 247, 0.6);
}

/* ==========================================================================
   3. Acciones (Carrito, CTA 3D, Burger)
   ========================================================================== */
.xeta-header__actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

/* Botón de Carrito */
.xeta-header__action-btn {
  position: relative;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0 !important;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--on-surface, #e2e2e8) !important;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
  box-sizing: border-box;
}

.xeta-header__action-btn .xeta-btn-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
}

.xeta-header__action-btn svg {
  display: block !important;
  margin: auto !important;
  vertical-align: middle !important;
}

.xeta-header__action-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 102, 0, 0.35);
  color: #ffffff !important;
  transform: translateY(-1.5px);
}

/* Badge de Carrito */
.xeta-cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: none;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--inverse-primary, #ff6600);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 10px rgba(255, 102, 0, 0.6);
}

.xeta-cart-badge.is-visible {
  display: inline-block;
}

/* ==========================================================================
   Botón CTA 3D Táctil ("Cotizar 3D")
   ========================================================================== */
.xeta-cta-btn {
  position: relative;
  display: inline-block;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
}

@media (max-width: 580px) {
  .xeta-header__actions .xeta-cta-btn {
    display: none; /* En mobile pequeño se prioriza en el drawer */
  }
}

/* Capa de profundidad 3D (extrusión) */
.xeta-cta-btn__depth {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: #993d00;
  transform: translateY(3px);
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1);
}

/* Superficie superior del botón */
.xeta-cta-btn__surface {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff7a1f 0%, #ff5500 100%);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    0 4px 14px rgba(255, 102, 0, 0.35);
  transform: translateY(0);
  transition:
    transform 0.15s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.15s ease,
    background 0.2s ease;
}

.xeta-cta-icon {
  display: flex;
  align-items: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.xeta-cta-arrow {
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

/* Hover en botón 3D */
.xeta-cta-btn:hover .xeta-cta-btn__surface {
  transform: translateY(-1.5px);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    0 8px 24px rgba(255, 102, 0, 0.45);
}

.xeta-cta-btn:hover .xeta-cta-btn__depth {
  transform: translateY(4.5px);
}

.xeta-cta-btn:hover .xeta-cta-icon {
  transform: rotate(15deg) scale(1.1);
}

.xeta-cta-btn:hover .xeta-cta-arrow {
  transform: translateX(3px);
}

/* Pulsación activa (tactile press) */
.xeta-cta-btn:active .xeta-cta-btn__surface {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.3),
    0 2px 6px rgba(255, 102, 0, 0.3);
}

.xeta-cta-btn:active .xeta-cta-btn__depth {
  transform: translateY(3px);
}

/* ==========================================================================
   Botón Hamburguesa Mobile
   ========================================================================== */
.xeta-burger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--on-surface, #e2e2e8);
  cursor: pointer;
  outline: none;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

@media (min-width: 992px) {
  .xeta-burger-btn {
    display: none;
  }
}

.xeta-burger-box {
  position: relative;
  width: 20px;
  height: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.xeta-burger-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition:
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s ease,
    width 0.25s ease;
  transform-origin: center;
}

.xeta-burger-btn[aria-expanded="true"] .xeta-burger-line--1 {
  transform: translateY(6px) rotate(45deg);
  background-color: var(--inverse-primary, #ff6600);
}

.xeta-burger-btn[aria-expanded="true"] .xeta-burger-line--2 {
  opacity: 0;
  transform: scaleX(0);
}

.xeta-burger-btn[aria-expanded="true"] .xeta-burger-line--3 {
  transform: translateY(-6px) rotate(-45deg);
  background-color: var(--inverse-primary, #ff6600);
}

/* ==========================================================================
   4. Mobile Drawer Fullscreen / Panel
   ========================================================================== */
.xeta-mobile-drawer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000 !important;
  display: none !important;
  justify-content: flex-end;
}

.xeta-mobile-drawer.is-open {
  display: flex !important;
}

@media (min-width: 992px) {
  .xeta-mobile-drawer {
    display: none !important;
  }
}

/* Fondo oscuro translúcido */
.xeta-mobile-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.xeta-mobile-drawer.is-open .xeta-mobile-drawer__backdrop {
  opacity: 1;
}

/* Panel lateral deslizable */
.xeta-mobile-drawer__panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 100%;
  background: #16181c;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  padding: 1.5rem;
}

.xeta-mobile-drawer.is-open .xeta-mobile-drawer__panel {
  transform: translateX(0);
}

/* Cabecera del Drawer */
.xeta-mobile-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.xeta-mobile-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--on-surface, #e2e2e8);
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}

.xeta-mobile-drawer__close:hover {
  background: rgba(255, 102, 0, 0.2);
  color: #ff6600;
}

/* Cuerpo y enlaces con animación Staggered */
.xeta-mobile-drawer__body {
  flex: 1;
  padding: 1.5rem 0;
}

.xeta-mobile-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--outline, #8f909a);
  margin-bottom: 1rem;
}

.xeta-mobile-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.xeta-mobile-nav__item {
  opacity: 0;
  transform: translateX(20px);
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--stagger-index, 0) * 0.06s + 0.1s);
}

.xeta-mobile-drawer.is-open .xeta-mobile-nav__item {
  opacity: 1;
  transform: translateX(0);
}

.xeta-mobile-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  color: #e2e2e8;
  font-size: 1.05rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.xeta-mobile-nav__marker {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--inverse-primary, #ff6600);
  margin-right: 0.75rem;
}

.xeta-mobile-nav__title {
  flex: 1;
}

.xeta-mobile-nav__chevron {
  color: var(--outline, #8f909a);
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}

.xeta-mobile-nav__link:hover,
.xeta-mobile-nav__link:focus-visible {
  background: rgba(255, 102, 0, 0.08);
  border-color: rgba(255, 102, 0, 0.3);
  color: #ffffff;
}

.xeta-mobile-nav__link:hover .xeta-mobile-nav__chevron {
  transform: translateX(4px);
  color: var(--inverse-primary, #ff6600);
}

/* Pie del Drawer */
.xeta-mobile-drawer__footer {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.xeta-cta-btn--mobile {
  width: 100%;
}

.xeta-cta-btn--mobile .xeta-cta-btn__surface {
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
}

.xeta-mobile-social {
  display: flex;
  align-items: center;
  justify-content: center;
}

.xeta-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--outline, #8f909a);
  text-decoration: none;
  transition: color 0.2s;
}

.xeta-social-link:hover {
  color: var(--inverse-primary, #ff6600);
}

/* ==========================================================================
   Accesibilidad & Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .xeta-header,
  .xeta-header__shell,
  .xeta-header__inner,
  .xeta-logo-3d-wrapper,
  .xeta-nav-link,
  .xeta-nav-indicator,
  .xeta-cta-btn__surface,
  .xeta-cta-btn__depth,
  .xeta-mobile-drawer__panel,
  .xeta-mobile-nav__item {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}
