/* ============================================
   PUNTELEC S.A. - HEADER AZUL OSCURO
   ============================================ */

/* ==================== HEADER PRINCIPAL ==================== */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--color-primary-dark);
  border-bottom: 2px solid var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 9999;
}

.header__nav {
  width: 100%;
  position: relative;
  z-index: 10000;
}

.header__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--spacing-lg);
  position: relative;
  z-index: 10001;
  background-color: var(--color-primary-dark);
}

@media (min-width: 992px) {
  .header__content {
    height: 80px;
  }
}

/* ==================== LOGO ==================== */
.header__logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header__logo-img {
  height: 45px;
  width: auto;
  transition: all 0.3s ease;
  filter: brightness(0) invert(1);
}

.header__logo a:hover .header__logo-img {
  filter: brightness(0) invert(1);
  transform: scale(1.05);
}

@media (min-width: 992px) {
  .header__logo-img {
    height: 55px;
  }
}

/* ==================== MENU DESKTOP ==================== */
.header__menu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

@media (min-width: 992px) {
  .header__menu {
    display: flex;
    align-items: center;
  }
}

.header__menu-item {
  position: relative;
}

.header__menu-link {
  display: block;
  padding: 28px 20px;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.header__menu-link:hover,
.header__menu-link.active {
  color: var(--color-accent);
  background-color: rgba(255, 140, 0, 0.1);
}

/* ==================== DROPDOWN MENU ==================== */
.header__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background-color: var(--color-primary-darker);
  border: 2px solid var(--color-primary);
  border-top: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  padding: 0;
}

.header__menu-item--dropdown:hover .header__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header__dropdown-item {
  position: relative;
}

.header__dropdown-link {
  display: block;
  padding: 12px 20px;
  color: var(--color-white);
  text-decoration: none;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  transition: all 0.3s ease;
  border-left: 0;
}

.header__dropdown-link:hover {
  background-color: rgba(255, 140, 0, 0.15);
  color: var(--color-accent);
}

/* Sub-dropdown */
.header__subdropdown {
  position: absolute;
  left: 100%;
  top: 0;
  min-width: 200px;
  background-color: var(--color-primary-darker);
  border: 2px solid var(--color-primary);
  border-left: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  padding: 0;
}

.header__dropdown-item--parent:hover .header__subdropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.header__subdropdown a {
  display: block;
  padding: 10px 20px;
  color: var(--color-white);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: all 0.3s ease;
  border-left: 0;
}

.header__subdropdown a:hover {
  background-color: rgba(255, 140, 0, 0.15);
  color: var(--color-accent);
}

/* ==================== HAMBURGER MENU ==================== */
.header__hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10002;
  position: relative;
}

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

.header__hamburger-line {
  width: 100%;
  height: 3px;
  background-color: var(--color-white);
  transition: all 0.3s ease;
}

.header__hamburger:hover .header__hamburger-line {
  background-color: var(--color-accent);
}

.header__hamburger[aria-expanded="true"] .header__hamburger-line {
  background-color: var(--color-accent);
}

.header__hamburger[aria-expanded="true"] .header__hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.header__hamburger[aria-expanded="true"] .header__hamburger-line:nth-child(2) {
  opacity: 0;
}

.header__hamburger[aria-expanded="true"] .header__hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* ==================== MOBILE MENU ==================== */
.header__mobile-menu {
  position: fixed;
  top: 70px;
  left: 0;
  width: 100%;
  height: calc(100vh - 70px);
  background-color: var(--color-primary-darker);
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-100%);
  transition: all 0.3s ease;
  z-index: 9998;
  -webkit-overflow-scrolling: touch;
}

.header__mobile-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

@media (min-width: 992px) {
  .header__mobile-menu {
    display: none;
  }
}

.header__mobile-list {
  list-style: none;
  margin: 0;
  padding: 0;
  padding-bottom: 60px;
}

.header__mobile-list > li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header__mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  color: var(--color-white);
  text-decoration: none;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s ease;
}

.header__mobile-link:hover,
.header__mobile-link.active {
  color: var(--color-accent);
  background-color: rgba(255, 140, 0, 0.1);
}

.header__mobile-arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  display: inline-block;
  margin-left: 8px;
  color: var(--color-white);
}

.header__mobile-toggle.active .header__mobile-arrow {
  transform: rotate(180deg);
  color: var(--color-accent);
}

/* ==================== MOBILE SUBMENU ==================== */
.header__mobile-submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  background-color: rgba(0, 0, 0, 0.3);
}

.header__mobile-dropdown.active .header__mobile-submenu {
  display: block;
}

.header__mobile-submenu li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header__mobile-submenu li:last-child {
  border-bottom: none;
}

.header__mobile-submenu a,
.header__mobile-sublink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 20px 12px 30px;
  color: var(--color-white);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: all 0.3s ease;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}

.header__mobile-submenu a:hover,
.header__mobile-sublink:hover {
  color: var(--color-accent);
  background-color: rgba(255, 140, 0, 0.1);
}

.header__mobile-subtoggle.active .header__mobile-arrow {
  transform: rotate(180deg);
  color: var(--color-accent);
}

/* ==================== MOBILE SUB-SUBMENU ==================== */
.header__mobile-subsubmenu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  background-color: rgba(0, 0, 0, 0.2);
}

.header__mobile-subdropdown.active .header__mobile-subsubmenu {
  display: block;
}

.header__mobile-subsubmenu li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header__mobile-subsubmenu li:last-child {
  border-bottom: none;
}

.header__mobile-subsubmenu a {
  padding: 10px 20px 10px 40px;
  font-size: var(--font-size-sm);
  color: var(--color-white);
}

.header__mobile-subsubmenu a:hover {
  color: var(--color-accent);
  background-color: rgba(255, 140, 0, 0.1);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 375px) {
  .header__logo-img {
    height: 40px;
  }

  .header__hamburger {
    width: 26px;
    height: 20px;
  }

  .header__content {
    height: var(--header-height);
  }

  .header__mobile-menu {
    top: 60px;
    height: calc(100vh - 60px);
  }
}
