* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', Arial Black, Arial, sans-serif;
  font-weight: 900;
}

body {
  background: url('img/fondos/fondo.png') no-repeat center center fixed;
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

/* Marco exterior */
.frame {
  background: #c9c9bd;
  border: 4px solid #000;
  opacity: 0.97;
  padding: 20px;
  animation: slideInFrame 1.2s linear;
}

@keyframes slideInFrame {
  from {
    opacity: 0;
    transform: translateX(-100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Caja principal */
.box {
  display: flex;
  width: 800px;
  height: 405px;
  background: #000;
  border: 6px solid #9e9e6a;
}

/* Imagen izquierda */
.image {
  width: 45%;
  background: #000 center/cover no-repeat;
  transition: background-image 0.6s ease-in-out, transform 0.3s ease;
}

.image.loading {
  opacity: 0.95;
}

.image:hover {
  transform: scale(1.02);
}

/* Franja idiomas */
.languages {
  width: 22%;
  background: #000;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.languages ul {
  list-style: none;
}

/* Idiomas */
.languages li {
  font-size: 18px;
  padding: 6px 18px;
  cursor: pointer;
  color: #ffffff; /* SIEMPRE BLANCO */
  transition: background 0.3s ease, transform 0.3s ease;
}

.languages li:hover {
  transform: scale(1.05);
}

/* Idioma activo = fondo completo */
.languages li.active {
  background: #7c7b47; /* MISMO COLOR DEL PANEL DE PAÍSES */
}

/* Logo */
.logo {
  padding: 0 18px;
}

.logo img {
  max-width: 120px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo img:hover {
  transform: rotate(5deg);
  opacity: 0.9;
}

/* Panel países (fondo siempre visible) */
.countries {
  width: 33%;
  background: linear-gradient(45deg, #7c7b47, #9e9e6a, #bdbd8b, #7c7b47);
  background-size: 400% 400%;
  animation: gradientShift 3s ease infinite;
  padding: 25px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-20px);
  transition: max-height 0.6s ease, opacity 0.6s ease, transform 0.6s ease;
}

/* Lista países oculta al inicio */
.countries ul {
  list-style: none;
}

/* Lista visible */
.countries.show {
  max-height: 300px;
  opacity: 1;
  transform: translateY(0);
}

/* Texto países (color CN correcto) */
.countries li {
  font-size: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  color: #000000; /* verde grisáceo apagado */
  transition: color 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateX(-20px);
  animation: slideInItem 0.6s ease forwards;
}

.countries li:nth-child(1) { animation-delay: 0.1s; }
.countries li:nth-child(2) { animation-delay: 0.2s; }
.countries li:nth-child(3) { animation-delay: 0.3s; }
.countries li:nth-child(4) { animation-delay: 0.4s; }
.countries li:nth-child(5) { animation-delay: 0.5s; }
.countries li:nth-child(6) { animation-delay: 0.6s; }
.countries li:nth-child(7) { animation-delay: 0.7s; }
.countries li:nth-child(8) { animation-delay: 0.8s; }

@keyframes slideInItem {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Media queries para responsividad */

/* Tablets */
@media (max-width: 768px) {
  body {
    min-height: 100vh;
    height: auto;
  }

  .wrapper {
    display: flex;
    flex-direction: column;
  }

  .frame {
    padding: 10px;
    margin: 10px auto;
  }

  .box {
    flex-direction: column;
    width: 90vw;
    height: auto;
    max-width: 600px;
  }

  .image {
    width: 100%;
    height: 250px;
  }

  .languages {
    width: 100%;
    padding: 20px 0;
    order: 2;
  }

  .languages li {
    font-size: 16px;
    padding: 8px 15px;
    border-radius: 4px;
  }

  .logo img {
    max-width: 100px;
  }

  .countries {
    width: 100%;
    padding: 20px;
    order: 3;
  }

  .countries li {
    font-size: 14px;
  }

  .copyright {
    order: 4;
    font-size: 12px;
    margin-top: 15px;
  }
}

/* Móviles */
@media (max-width: 480px) {
  body {
    min-height: 100vh;
    height: auto;
    padding-bottom: 10px;
  }

  .wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 10px 0 0 0;
  }

  .frame {
    padding: 8px;
    margin: 10px auto;
    width: 100%;
  }

  .box {
    width: 95vw;
    border: 4px solid #9e9e6a;
    flex-direction: column;
  }

  .image {
    height: 200px;
    width: 100%;
  }

  .languages {
    width: 100%;
    padding: 15px 0;
    order: 2;
  }

  .languages li {
    font-size: 14px;
    padding: 10px 15px;
    margin: 2px 0;
    border-radius: 4px;
  }

  .languages li:active {
    transform: scale(1.05);
    background: #7c7b47;
  }

  .logo img {
    max-width: 85px;
  }

  .countries {
    width: 100%;
    padding: 15px;
    order: 3;
    margin-top: 10px;
  }

  .countries li {
    font-size: 14px;
    padding: 8px 12px;
    margin-bottom: 8px;
    color: #ffffff;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
  }

  .countries li:active {
    transform: translateX(5px);
    background: rgba(124,123,71,0.6);
  }

  .countries.show {
    max-height: 600px;
  }

  .copyright {
    order: 4;
    font-size: 11px;
    margin-top: 15px;
    padding: 10px;
    line-height: 1.4;
  }
}

/* Mostrar países con animación */
.countries.show li {
  opacity: 1;
  transform: translateX(0);
}
.countries.show li:nth-child(1) { animation-delay: 0.1s; }
.countries.show li:nth-child(2) { animation-delay: 0.2s;  }
.countries.show li:nth-child(3) { animation-delay: 0.3s;  }
.countries.show li:nth-child(4) { animation-delay: 0.4s;  }
.countries.show li:nth-child(5) { animation-delay: 0.5s;  }
.countries.show li:nth-child(6) { animation-delay: 0.6s;  }
.countries.show li:nth-child(7) { animation-delay: 0.7s;  }     

.copyright {
  position: relative;
  text-align: center;
  font-size: 12px;
  color: #5a0606;
  margin-top: 20px;
  padding: 10px;
}