:root {
  --primary-color: #f9532d;
}

/* Animación solo con text-shadow */
@keyframes glowPulse {

  0%,
  100% {
    text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color);
  }

  50% {
    text-shadow: 0 0 2px var(--primary-color);
  }
}

/* HEADER GENERAL */
header {
  margin: 0 !important;
  padding: 0 !important;
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: 0 4px 17px rgba(0, 0, 0, .1);
  display: flex;
  justify-content: center;
  height: 6em;
  width: 100%;
}

/* CONTENEDOR INTERNO DEL HEADER */
.header-inner {
  width: 100%;
  max-width: 1300px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
}

/* LOGO */
.logo {
  font-size: 1.5rem;
  font-weight: 800;
  opacity: 0;
  animation: leftSideAni 1s ease forwards;
  display: flex;
  align-items: center;
}

.logo img {
  border-radius: 50% !important;
  cursor: pointer;
}

.logo a {
  color: #244D61;
  text-decoration: none;
}

/* CENTRO: NAV LINKS */
.center {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* NAVBAR */
nav {
  width: auto;
  display: flex;
  background-color: transparent;
  overflow: hidden;
  animation: rightSideAni 1s ease forwards;
}

nav * {
  margin: auto;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* LINKS */
#navLINKS {
  display: flex;
  gap: 1rem;
}

.navlink {
  display: inline-block;
  padding: .3rem;
  text-decoration: none;
  font-size: 1.20rem;
  font-weight: 600;
  letter-spacing: .7px;
  border-radius: 36px;
  line-height: 2;
  transition: color 0.3s, text-shadow 0.3s;
  opacity: 0;
  animation: navani .3s ease forwards;
  animation-delay: calc(.15s * var(--navAni));
  cursor: pointer;
  color: #ec6142;
}

.navlink:hover {
  color: #f9532d;
  text-shadow: 0 0 2px var(--primary-color), 0 0 2px var(--primary-color);
}

.navlink.active {
  color: var(--primary-color);
}

/* "Contact me" con animación */
#contactHeader {
  color: var(--primary-color);
  animation: glowPulse 1.2s infinite;
  opacity: 1 !important;
  cursor: pointer;
  transition: color 0.3s, text-shadow 0.3s;
}

#contactHeader:hover {
  animation-play-state: paused;
  color: var(--primary-color);
  text-shadow: 0 0 8px var(--primary-color), 0 0 12px var(--primary-color);
}

/* SWITCH A LA DERECHA */
.right {
  margin-right: 30px;
  display: flex;
  align-items: center;
}

.toggleWrapper {
  display: flex;
  align-items: center;
}

/* BOTÓN MENÚ HAMBURGUESA */

.event-wrapper>.event-wrapper-inp {
  display: none;
}

.event-wrapper {
  font-weight: 500;
  color: white;
  background-color: var(--primary-color);
  padding: 3px 15px;
  border-radius: 10px;
  display: none !important;
  display: flex;
  align-items: center;
  height: 2.5rem;
  width: fit-content;
  position: relative;
  cursor: pointer;
  justify-content: space-between;
}

.arrow {
  height: 34%;
  aspect-ratio: 1;
  margin-block: auto;
  position: relative;
  display: flex;
  justify-content: center;
  transition: all 0.3s;
}

.arrow::after,
.arrow::before {
  content: "";
  position: absolute;
  background-color: white;
  height: 100%;
  width: 2.5px;
  border-radius: 500px;
  transform-origin: bottom;
}

.arrow::after {
  transform: rotate(35deg) translateX(-0.5px);
}

.arrow::before {
  transform: rotate(-35deg) translateX(0.5px);
}

.event-wrapper>.event-wrapper-inp:checked+.arrow {
  transform: rotateX(180deg);
}

.menu-container {
  background-color: white;
  color: var(--primary-color);
  border-radius: 10px;
  position: absolute;
  width: 150px;
  left: -100px;
  top: 130%;
  overflow: hidden;
  clip-path: inset(0% 0% 0% 0% round 10px);
  transition: all 0.4s;
}

.menu-list {
  --delay: 0.4s;
  --trdelay: 0.15s;
  padding: 8px 10px;
  border-radius: inherit;
  transition: background-color 0.2s 0s;
  position: relative;
  transform: translateY(30px);
  opacity: 0;
}

.menu-list::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  height: 1px;
  background-color: rgba(0, 0, 0, 0.3);
  width: 95%;
}

.menu-list:hover {
  background-color: rgb(223, 223, 223);
}

.event-wrapper-inp:checked~.menu-container {
  clip-path: inset(10% 50% 90% 50% round 10px);
}

.event-wrapper-inp:not(:checked)~.menu-container .menu-list {
  transform: translateY(0);
  opacity: 1;
}

.event-wrapper-inp:not(:checked)~.menu-container .menu-list:nth-child(1) {
  transition:
    transform 0.4s var(--delay),
    opacity 0.4s var(--delay);
}

.event-wrapper-inp:not(:checked)~.menu-container .menu-list:nth-child(2) {
  transition:
    transform 0.4s calc(var(--delay) + (var(--trdelay) * 1)),
    opacity 0.4s calc(var(--delay) + (var(--trdelay) * 1));
}

.event-wrapper-inp:not(:checked)~.menu-container .menu-list:nth-child(3) {
  transition:
    transform 0.4s calc(var(--delay) + (var(--trdelay) * 2)),
    opacity 0.4s calc(var(--delay) + (var(--trdelay) * 2));
}

.event-wrapper-inp:not(:checked)~.menu-container .menu-list:nth-child(4) {
  transition:
    transform 0.4s calc(var(--delay) + (var(--trdelay) * 3)),
    opacity 0.4s calc(var(--delay) + (var(--trdelay) * 3));
}

.bar-event-wrapper-inp {
  -webkit-appearance: none;
  display: none;
  visibility: hidden;
}

.bar {
  display: flex;
  height: 50%;
  width: 20px;
  flex-direction: column;
  gap: 3px;
}

.bar-list {
  --transform: -25%;
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 50px;
  background-color: white;
  transition: all 0.4s;
  position: relative;
}

.event-wrapper-inp:not(:checked)~.bar>.top {
  transform-origin: top right;
  transform: translateY(var(--transform)) rotate(-45deg);
}

.event-wrapper-inp:not(:checked)~.bar>.middle {
  transform: translateX(-50%);
  opacity: 0;
}

.event-wrapper-inp:not(:checked)~.bar>.bottom {
  transform-origin: bottom right;
  transform: translateY(calc(var(--transform) * -1)) rotate(45deg);
}


/* ANIMACIONES DE ENTRADA */
@keyframes leftSideAni {
  from {
    transform: translateX(-100px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes rightSideAni {
  from {
    transform: translateX(100px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes navani {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* DARK MODE OPCIONAL */
body.dark-mode,
header.dark-mode,
nav.dark-mode {
  background-color: #1e2329;
  color: white;
}

/* ===== RESPONSIVE HEADER ===== */
@media (max-width: 992px) {

  /* Mostrar botón hamburguesa */
  .event-wrapper {
    display: flex !important;
  }

  /* Ajuste del header interno */
  .header-inner {
    justify-content: space-between;
  }

  /* Menú oculto por defecto */
  #navLINKS {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 6em;
    /* debajo del header */
    right: 0;
    background: white;
    align-items: flex-start;
    width: 70%;
    max-width: 300px;
    padding: 1rem;
    box-shadow: 0 4px 17px rgba(0, 0, 0, .1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 200;
  }

  /* Cuando se abre */
  #navLINKS.open {
    transform: translateX(0);
  }

  /* Links en móvil */
  .navlink {
    padding: 0.8rem 0;
    font-size: 1.2rem;
    width: 100%;
    text-align: left;
  }

  /* Evitar que el centro se expanda en móvil */
  .center {
    flex-grow: unset;
  }
}