/* ========================================
   Nuevo Header - Tenerife Wine Experience
   ======================================== */

/* Variables */
:root {
  --twe-header-height: 100px;
  --twe-header-height-mobile: 80px;
  --twe-text-color: #ffffff;
  --twe-text-scroll: #ffffff;
  --twe-text-hover: #ffcc00;
  --twe-font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --twe-transition: all 0.4s ease;
}

/* Header Principal - Transparente inicialmente */
.twe-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: transparent;
  font-family: var(--twe-font-family);
  transition: var(--twe-transition);
}

.twe-header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--twe-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Espaciador */
.twe-header-spacer {
  height: var(--twe-header-height);
}

/* Logo */
.twe-logo {
  flex-shrink: 0;
}

.twe-logo a {
  display: block;
  text-decoration: none;
}

.twe-logo-img {
  height: 60px;
  width: auto;
  display: block;
  transition: var(--twe-transition);
  max-height: 70px;
}

.twe-logo-img:hover {
  opacity: 0.8;
}

/* Navegación Desktop */
.twe-nav-desktop {
  display: block;
}

.twe-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.twe-menu-item {
  position: relative;
}

.twe-menu-link {
  display: block;
  padding: 10px 15px;
  color: var(--twe-text-color);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: var(--twe-transition);
  border-radius: 3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.twe-menu-link:hover,
.twe-menu-link:focus {
  color: var(--twe-text-hover);
}

/* Estado activo */
.twe-menu-item.current .twe-menu-link,
.twe-menu-link[href="index.html"]:hover {
  color: var(--twe-text-hover);
}

/* Botón Menú Móvil */
.twe-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.twe-menu-bar {
  width: 100%;
  height: 3px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: var(--twe-transition);
  transform-origin: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Animación hamburguesa a X */
.twe-menu-toggle.active .twe-menu-bar:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}

.twe-menu-toggle.active .twe-menu-bar:nth-child(2) {
  opacity: 0;
}

.twe-menu-toggle.active .twe-menu-bar:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

/* Navegación Móvil */
.twe-nav-mobile {
  display: none;
  position: fixed;
  top: var(--twe-header-height-mobile);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 999;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.twe-nav-mobile.active {
  display: block;
  opacity: 1;
  visibility: visible;
}

.twe-menu-mobile {
  list-style: none;
  margin: 0;
  padding: 20px;
}

.twe-menu-item-mobile {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.twe-menu-link-mobile {
  display: block;
  padding: 18px 15px;
  color: #ffffff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: var(--twe-transition);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.twe-menu-link-mobile:hover,
.twe-menu-link-mobile:focus {
  color: var(--twe-text-hover);
  background-color: rgba(255, 255, 255, 0.1);
  padding-left: 25px;
}

/* ========================================
   Responsive - Móvil
   ======================================== */

@media screen and (max-width: 1024px) {
  .twe-nav-desktop {
    display: none;
  }

  .twe-menu-toggle {
    display: flex;
  }

  .twe-header-container {
    height: var(--twe-header-height-mobile);
  }

  .twe-header-spacer {
    height: var(--twe-header-height-mobile);
  }

  .twe-nav-mobile {
    top: var(--twe-header-height-mobile);
  }

  .twe-logo-img {
    height: 55px;
    max-height: 60px;
  }
}

@media screen and (max-width: 480px) {
  .twe-header-container {
    padding: 0 15px;
  }

  .twe-logo-img {
    height: 50px;
    max-height: 55px;
  }

  .twe-menu-link-mobile {
    font-size: 14px;
    padding: 15px 10px;
  }
}

/* ========================================
   Estilo al hacer scroll (clase .scrolled)
   ======================================== */

.twe-header.scrolled {
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
}

.twe-header.scrolled .twe-menu-bar {
  box-shadow: none;
}

/* ========================================
   Scroll suave para anclas
   ======================================== */

html {
  scroll-behavior: smooth;
}

/* Offset para anclas considerando header fijo */
[id] {
  scroll-margin-top: calc(var(--twe-header-height) + 20px);
}

@media screen and (max-width: 1024px) {
  [id] {
    scroll-margin-top: calc(var(--twe-header-height-mobile) + 15px);
  }
}
