@import "https://fonts.googleapis.com/css?family=Fira+Sans:300,400";
@import "https://fonts.googleapis.com/icon?family=Material+Icons";

a {
  color: #fff;
}

/* header (MODIFICADO EN LA RESPUESTA ANTERIOR) */
.header {
  background-color: #880000;
  box-shadow: 1px 1px 4px 0 rgba(0, 0, 0, 0.1);
  position: fixed;
  width: 100%;
  z-index: 1030; /* Z-index para el header, menor que los modales */
  top: 0;
  left: 0;
  height: auto;
  min-height: 60px;
}

/* Ajuste para el contenido principal (MODIFICADO EN LA RESPUESTA ANTERIOR) */
body {
  padding-top: 180px; /* Valor ajustado para dejar suficiente espacio al header */
  min-height: 100vh;
  position: relative;
}

.header ul {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: visible;
  background-color: #880000;
}

.header li a {
  display: block;
  padding: 20px 20px;
  text-decoration: none;
  white-space: nowrap;
}

.header li a:hover,
.header .menu-btn:hover {
  background-color: #880000;
  color: white;
}

.header .logo {
  display: flex;
  justify-content: center;
  align-items: center;
  float: left;
  font-size: 2em;
  padding: 5px 30px;
  text-decoration: none;
  width: 100%;
}

.logo img {
  width: 200px;
  height: auto;
}

/* menu */

.header .menu {
  clear: both;
  max-height: 0;
  transition: max-height 0.2s ease-out;
  overflow: visible;
}

/* menu icon */

.header .menu-icon {
  cursor: pointer;
  display: inline-block;
  float: right;
  padding: 28px 20px;
  position: relative;
  user-select: none;
}

.header .menu-icon .navicon {
  background: #333;
  display: block;
  height: 2px;
  position: relative;
  transition: background 0.2s ease-out;
  width: 18px;
}

.header .menu-icon .navicon:before,
.header .menu-icon .navicon:after {
  background: #333;
  content: "";
  display: block;
  height: 100%;
  position: absolute;
  transition: all 0.2s ease-out;
  width: 100%;
}

.header .menu-icon .navicon:before {
  top: 5px;
}

.header .menu-icon .navicon:after {
  top: -5px;
}

/* menu btn */

.header .menu-btn {
  display: none;
}

.header .menu-btn:checked ~ .menu {
  max-height: calc(100vh - 60px);
}

.header .menu-btn:checked ~ .menu-icon .navicon {
  background: transparent;
}

.header .menu-btn:checked ~ .menu-icon .navicon:before {
  transform: rotate(-45deg);
}

.header .menu-btn:checked ~ .menu-icon .navicon:after {
  transform: rotate(45deg);
}

.header .menu-btn:checked ~ .menu-icon:not(.steps) .navicon:before,
.header .menu-btn:checked ~ .menu-icon:not(.steps) .navicon:after {
  top: 0;
}

/* 48em = 768px */

@media (min-width: 48em) {
  .header li {
    float: left;
  }
  .header li a {
    padding: 20px 30px;
  }
  .header .menu {
    clear: none;
    float: right;
    max-height: none;
    overflow: visible;
  }
  .header .menu-icon {
    display: none;
  }
}

.active {
  border-bottom: 3px solid #880000 !important;
}

/* Estilos para submenús (MODIFICADO EN LA RESPUESTA ANTERIOR) */
.header .menu li {
  position: relative;
}

/* Estilo para la flecha de submenú */
.header .menu li.has-submenu > a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #880000;
  margin-left: 8px;
  transition: transform 0.3s ease;
  vertical-align: middle;
}

.header .menu li.has-submenu > a.open::after {
  transform: rotate(180deg);
}

.header .menu .submenu {
  display: none;
  position: absolute;
  background-color: #880000;
  min-width: 200px;
  box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
  z-index: 1020; /* Menor que el header, pero mayor que el contenido normal */
  border-radius: 4px;
  top: 100%;
  left: 0;
}

.header .menu li:hover .submenu {
  display: block;
}

.header .menu .submenu li {
  float: none;
  width: 100%;
}

.header .menu .submenu li a {
  padding: 12px 16px;
  display: block;
  text-align: left;
}

.header .menu .submenu li a:hover {
  background-color: #880000;
  color: white;
}

/* Ajuste para el menú móvil */
@media (max-width: 48em) {
  .header .menu {
    max-height: 0;
    overflow-y: auto;
    transition: max-height 0.3s ease-out;
  }

  .header .menu .submenu {
    position: static;
    box-shadow: none;
    width: 100%;
    display: none;
    background-color: #880000;
    border-left: 3px solid #880000;
  }
  
  .header .menu .submenu.show {
    display: block;
  }
  
  .header .menu .submenu li a {
    padding-left: 40px;
  }

  .header .menu-btn:checked ~ .menu {
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }

  /* Asegurar que el menú se cierre cuando no está activo */
  .header .menu:not(:checked) {
    max-height: 0;
  }

  /* Ajustar el comportamiento del botón del menú */
  .header .menu-btn:not(:checked) ~ .menu {
    max-height: 0;
  }
}

main, .container {
  position: relative;
  z-index: 1;
  margin-top: 20px;
}