/* =========================================================
   RESPONSIVE
========================================================= */


/* =========================================================
   DESKTOP (Se mantiene oculto el menú móvil por defecto)
========================================================= */
.mobile-header {
  display: none;
}

/* =========================================================
   MOBILE (Se activa estrictamente por debajo de 768px)
========================================================= */
@media (max-width: 768px) {

  /* Ocultamos por completo el header de escritorio */
  .site-header {
    display: none !important;
  }

  /* Contenedor principal del Header Móvil */
  .mobile-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100vw;
    height: 74px;
    padding: 0 16px;
    box-sizing: border-box;
    display: flex !important; /* Forzamos el flex en responsive */
    align-items: center;
    background: #F2F1EC;
    z-index: 9999;
  }

  /* Ajuste específico si el usuario está logueado en WordPress (Barra negra arriba) */
  .admin-bar .mobile-header {
    top: 46px; /* Empuja el header hacia abajo en pantallas móviles */
  }

  .mobile-header__inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }

  .mobile-header__brand {
    width: 180px;
    flex-shrink: 0;
  }

  .mobile-header__brand img {
    display: block;
    width: 100%;
    height: auto;
  }

  /* =========================================================
     BOTÓN HAMBURGUESA (Estructura fija corregida)
  ========================================================= */
  .mobile-header__toggle {
    width: 30px;
    height: 24px;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between; 
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 10000; /* Asegura que se pinte por encima de todo */
  }

  .mobile-header__toggle span {
    display: block;
    width: 100%;
    height: 3px;                  
    background-color: #121212 !important;   
    border-radius: 2px;           
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
  }

  /* Animación a "X" cuando está activo (.is-active) */
  .mobile-header__toggle.is-active span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
  }

  .mobile-header__toggle.is-active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-header__toggle.is-active span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
  }

  /* =========================================================
     DESPLEGABLE DEL MENÚ RESPONSIVE
  ========================================================= */
  .mobile-header__menu {
    display: none;
    position: absolute;
    top: 74px;          /* Cae justo debajo del header gris */
    left: 0;
    right: 0;           /* Bloquea el ancho para que no rompa la pantalla */
    box-sizing: border-box;
    padding: 20px 20px 40px;
    background: #F5F3EF;
    z-index: 9998;
    max-width: 100vw;
  }

  .mobile-header__menu.is-active {
    display: block;
  }

  .mobile-header__nav {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .mobile-header__nav a {
    font-size: 18px;
    line-height: 1.2;
    color: #000;
    text-decoration: none;
  }

  .mobile-header__langs {
    display: flex;
    gap: 14px;
    margin-top: 40px;
  }

  .mobile-header__langs a {
    font-size: 14px;
    color: #000;
    text-decoration: none;
  }
}

/* Candado global fuera de la media query para evitar desbordes laterales */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* =========================================================
   FOOTER MOBILE
========================================================= */
@media (max-width: 768px) {

  .site-footer {
    background: #3C1E1E;
  }

  /* =========================
     BLOQUE SUPERIOR
  ========================= */

  .footer-main {
    background: #3C1E1E;
    padding: 20px 17px 80px;
  }

  .footer-main__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-contact {
    width: 100%;
    max-width: 400px;
  }

  .footer-contact p {
    margin: 0;

    font-family: var(--font-serif);
    font-size: 32px;
    line-height: 40px;
    font-weight: 350;

    color: #DBDBDB;
  }

  .footer-linkedin {
    margin-top: 170px;

    font-family: var(--font-sans);
    font-size: 10px;
    line-height: 1;

    text-transform: uppercase;
    text-decoration: none;

    color: #DBDBDB;
  }

  /* =========================
     BLOQUE INFERIOR
  ========================= */

 .footer-bottom {
    height: auto !important;

    background: #291515;

    padding: 14px 17px 32px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-bottom p {
    margin: 0;

    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1;

    color: #DBDBDB;
  }

  .footer-bottom__nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .footer-bottom__nav a {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1;

    text-decoration: none;

    color: #DBDBDB;
  }
}

@media (max-width: 768px) {

  body {
    background: #291515;
  }

  .mobile-home,
  .site-footer {
    background: #291515;
  }

  .footer-main {
    background: #3C1E1E;
  }

  .footer-bottom {
    background: #291515;
  }
}