/* ==============================
   BASE
================================ */
.button-hamburger {
  width: 32px;
  height: 32px;
  padding: 2px;
  position: relative;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==============================
   ESTADOS
================================ */

/* Cerrado */
.button-hamburger[aria-expanded="false"] {
  background: none;
  color: var(--white);
}

/* Abierto */
.button-hamburger[aria-expanded="true"] {
  background: none;
  color: var(--white);
}

/* ==============================
   HOVER
================================ */

/* Hover cerrado */
.button-hamburger[aria-expanded="false"]:hover {
  color: var(--primary);
}

/* Hover abierto */
.button-hamburger[aria-expanded="true"]:hover {
  color: var(--secondary);
}

/* ==============================
   FOCUS
================================ */

/* Focus cerrado */
.button-hamburger[aria-expanded="false"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(225, 27, 34, 0.5);
  background: var(--secondary);
}

/* Focus abierto */
.button-hamburger[aria-expanded="true"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(225, 27, 34, 0.5);
  background: var(--primary);
}

/* ==============================
   DISABLED
================================ */
.button-hamburger:disabled {
  cursor: not-allowed;
  color: #777777;
}

/* ==============================
   ICONO
================================ */
.button-hamburger__line {
  position: absolute;
  left: 2px;
  right: 2px;
  height: 5px;
  background-color: currentColor;
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: center;
}

/* Posiciones hamburguesa */
.button-hamburger__line:nth-child(1) {
  top: 2px;
}

.button-hamburger__line:nth-child(2) {
  top: 16px;
  transform: translateY(-50%);
}

.button-hamburger__line:nth-child(3) {
  bottom: 2px;
}

/* ==============================
   ACTIVO → X PERFECTA
================================ */
.button-hamburger[aria-expanded="true"] .button-hamburger__line:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

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

.button-hamburger[aria-expanded="true"] .button-hamburger__line:nth-child(3) {
  bottom: auto;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}