/* =====================
   VARIABLES ROOT
====================== */
:root {
  --primary: #234f9e;
  --primary-light: #3d5f9f;
  --primary-dark: #19376f;
  --secondary: #e23c1b;
  --secondary-light: #e2573c;
  --accent: #e74c3c;
  --light: #ecf0f1;
  --dark: #2c3e50;
  --gray: #95a5a6;
  --gray-light: #bdc3c7;
  --white: #fff;
  --black: #222;
  --background: #f5f5f5;
  --background-dark: #09152c;
  --text: #333;
  --text-dark: #ddd;
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.2);
  --transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
}

/* =====================
   RESET Y BASE
====================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: #000;
  color: var(--text);
}



/* =====================
   HEADER Y NAVEGACIÓN
====================== */
header {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: center;
  background-color: #000;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(255, 255, 255, 0.2);
}

.logo {
  grid-column: 1 / 3;
}

.logo img {
  height: 50px;
  width: auto;
}

.menu-principal {
  grid-column: 5 / 9;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.menu-principal a {
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  background-color: var(--primary);
  /* width: 20%;  <-- Eliminado para que el ancho sea automático */
  padding: 12px 32px; /* Más espacio a los lados */
  width: auto;
  box-sizing: border-box;
  display: inline-block;
  border-radius: 5px;
  text-align: center;
  transition: background-color 0.3s ease;
}

.menu-principal a:last-child {
  background-color: var(--secondary);
}

.menu-principal a:hover {
  background-color: #234e9eda;
}

.menu-principal a:last-child:hover {
  background-color: #e23c1be0;
}

.redes-sociales {
  grid-column: 11 / 13;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.redes-sociales a {
  background-color: white;
  border-radius: 50%;
  text-decoration: none;
}

.icono-red-social img {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.icono-red-social:hover img {
  transform: scale(1.2);
}

/* =====================
   HAMBURGUESA Y SIDEBAR NAV
====================== */
.btn-hamburguesa {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1002;
}

.btn-hamburguesa span {
  display: block;
  width: 28px;
  height: 4px;
  margin: 4px 0;
  background: var(--primary);
  border-radius: 2px;
  transition: 0.3s;
}

.sidebar-nav {
  display: none;
}

.sidebar-redes-sociales {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
  width: 100%;
}

.sidebar-redes-sociales .icono-red-social img {
  width: 32px;
  height: 32px;
}

.sidebar-nav.open~.btn-hamburguesa,
.btn-hamburguesa.hide {
  display: none !important;
}

/* =====================
   UTILIDADES DE IMAGEN
====================== */
.img-ancla-abajo {
  object-fit: cover !important;
  object-position: center bottom !important;
}

.carrusel-img {
  object-fit: cover;
  object-position: center center !important;
  border-radius: 10px;
}

.contenedor-imagen img:not(.img-ancla-abajo):not(.carrusel-img) {
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
}

/* =====================
   SECCIÓN TALLER
====================== */
.taller-inscripcion {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 50px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  min-height: 300px;
  flex-wrap: wrap;
  position: relative;
  overflow: visible;
}

.taller-inscripcion::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('/img/patron-taller.png') repeat;
  opacity: 0.1;
  z-index: 1;
}

.taller-inscripcion > * {
  position: relative;
  z-index: 2;
}

.taller-inscripcion .contenedor-texto {
  width: 55%;
  color: var(--white);
}

.taller-inscripcion .contenedor-texto h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 15px;
}

.taller-inscripcion .contenedor-texto p {
  font-size: 1.2rem;
  margin-bottom: 0;
  line-height: 1.6;
  opacity: 0.95;
}

.boton-taller {
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  color: var(--white);
  padding: 15px 35px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  text-decoration: none;
  display: inline-block;
  transition: var(--transition);
  box-shadow: 0 8px 25px rgba(238, 90, 36, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.boton-taller:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(238, 90, 36, 0.4);
  background: linear-gradient(45deg, #ee5a24, #ff6b6b);
}

.taller-inscripcion .contenedor-imagen {
  width: 40%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 40px;
  box-sizing: border-box;
}

/* Keyframes para animación de imagen del taller */
@keyframes flotar-taller {
  0% {
    transform: rotate(-2deg) scale(1);
  }
  25% {
    transform: rotate(2deg) scale(1.02);
  }
  50% {
    transform: rotate(-1deg) scale(0.98);
  }
  75% {
    transform: rotate(1deg) scale(1.01);
  }
  100% {
    transform: rotate(-2deg) scale(1);
  }
}

.imagen-taller {
  width: 100%;
  max-width: 350px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  transform: rotate(-2deg);
  animation: flotar-taller 4s ease-in-out infinite;
  transition: var(--transition);
}

.imagen-taller:hover {
  animation-play-state: paused;
  transform: rotate(0deg) scale(1.05);
}

.img-taller {
  width: 100%;
  height: auto;
  display: block;
  transition: var(--transition);
}

/* =====================
   SECCIÓN INTRODUCCIÓN
====================== */
.introduccion {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 50px;
  background-color: var(--black);
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}

.nosotros {
  background-color: var(--gray-light) !important;
}

.contenedor-texto {
  width: 45%;
  justify-content: center;
}

.contenedor-texto .fila {
  margin-bottom: 0px;
  justify-content: center;
  text-align: center;
  display: flex;
  margin: 10px;
  padding: 5px;
}

.contenedor-texto h2 {
  font-size: 5rem;
  color: var(--primary);
  margin-bottom: 0px;
}

.contenedor-texto p {
  font-size: 2rem;
  color: var(--white);
  line-height: 1;
}

.nosotros .contenedor-texto p {
  font-size: 1.2rem;
  color: var(--black);
  line-height: 1.5;
  text-align: justify;
}

.nosotros .contenedor-texto h2 {
  font-size: 3rem;
  color: var(--primary);
  margin: 0px;
  padding: 0px;
}

.contenedor-texto .boton {
  display: inline-block;
  width: 75%;
  padding: 10px 20px;
  background-color: var(--secondary);
  color: var(--white);
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  margin-top: 20px;
}

.contenedor-texto .boton:hover {
  background-color: var(--secondary-light);
}

.contenedor-imagen {
  width: 50%;
  background-size: cover;
  background-position: center;
  border-radius: 10px;
  overflow: hidden;
}

.contenedor-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
}

/* =====================
   CARRUSEL SLIDE HORIZONTAL
====================== */
.carrusel {
  position: relative;
  width: 100%;
  height: 540px;
  max-height: 75vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carrusel-imagenes {
  width: 100%;
  height: 100%;
  display: flex;
  transition: transform 0.7s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}

.carrusel-img {
  min-width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: var(--shadow-md);
  user-select: none;
  pointer-events: none;
}

/* =====================
   SECCIÓN LOGOS
====================== */
.logos {
  text-align: center;
  padding: 20px;
  background-color: var(--dark);
}

.contenedor-logos img {
  height: 80px;
  margin: 0 20px;
}

/* =====================
   SECCIÓN PROYECTOS Y CARTAS
====================== */
.proyectos {
  padding: 30px 10px;
  background-color: #c0c0c0;
  box-shadow: inset 5px 5px 10px rgba(0, 0, 0, 0.5);
}

.titulo-seccion {
  text-align: center;
  font-size: 3rem;
  color: var(--primary);
  margin: 10px;
}

.cartas {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  padding: 20px;
}

.carta {
  width: 40%;
  height: 300px;
  background-color: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  transition: 0.3s;
}

.carta .contenedor-imagen {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carta .contenedor-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carta .contenido {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.9);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.carta:hover .contenido {
  transform: translateY(0);
}

.carta .contenido h2 {
  font-size: 1.1rem;
  color: var(--primary);
  margin: 5px;
}

.carta .contenido p {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0;
}

.c-boton {
  justify-content: center;
  display: flex;
}

.c-boton a.boton {
  color: var(--white);
  text-decoration: none;
  font-size: 1rem;
  transition: background-color 0.3s ease;
  background-color: var(--secondary);
  width: 20%;
  padding: 10px 10px;
  border-radius: 5px;
  text-align: center;
}

.c-boton a.boton:hover {
  background-color: var(--secondary-light);
}

/* =====================
   SECCIÓN INTEGRANTES
====================== */
.integrantes {
  background-color: var(--primary);
  padding: 10px;
  text-align: center;
}

.integrantes h2 {
  color: var(--white);
  font-size: 1.2rem;
  margin: 0;
}

/* =====================
   SECCIÓN MUSEO VIRTUAL
====================== */
.museo-virtual {
  padding: 20px;
  text-align: center;
}

.museo-virtual iframe {
  width: 100%;
  height: 600px;
  border: none;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

/* =====================
   MEDIA QUERIES
====================== */

/* 1024px */
@media (max-width: 1024px) {
  .carta {
    width: 45%;
    height: 250px;
  }

  /* Taller - Reducir altura */
  .taller-inscripcion {
    min-height: 200px;
    padding: 20px 30px;
  }

  .introduccion {
    padding: 30px;
  }

  .contenedor-texto,
  .contenedor-imagen {
    width: 100%;
    margin-bottom: 20px;
  }

  .contenedor-imagen {
    height: 400px;
  }

  .cartas {
    gap: 12px;
  }

  .carrusel {
    height: 350px;
  }

  .menu-principal {
    grid-column: 3 / 11;
  }

  .redes-sociales {
    grid-column: 11 / 13;
  }
}

/* 900px (sidebar y hamburguesa) */
@media (max-width: 900px) {

  .menu-principal,
  .redes-sociales {
    display: none !important;
  }

  .btn-hamburguesa {
    display: flex;
    position: absolute;
    right: 20px;
    top: 20px;
  }

  .sidebar-nav {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 20px 20px 30px;
    transform: translateX(100%);
    transition: transform 0.7s cubic-bezier(.77, 0, .18, 1);
  }

  .sidebar-nav.open {
    transform: translateX(0);
  }

  .sidebar-nav nav {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .sidebar-nav nav a {
    color: var(--primary);
    text-decoration: none;
    font-size: 1.3rem;
    margin: 18px 0;
    font-weight: 500;
    transition: color 0.2s;
  }

  .sidebar-nav nav a:hover {
    color: var(--secondary);
  }

  .close-sidebar {
    background: none;
    border: none;
    font-size: 2.2rem;
    color: var(--primary);
    position: absolute;
    top: 10px;
    right: 18px;
    cursor: pointer;
    z-index: 1002;
  }
}

/* 901px+ (ocultar sidebar) */
@media (min-width: 901px) {
  .sidebar-nav {
    display: none !important;
    transform: none !important;
  }
}

/* 768px */
@media (max-width: 768px) {
  .carta {
    width: 80%;
    height: 250px;
  }

  /* Sección Taller - Mobile */
  .taller-inscripcion {
    flex-direction: column;
    padding: 10px 15px;
    min-height: 150px;
    text-align: center;
  }

  .taller-inscripcion .contenedor-texto,
  .taller-inscripcion .contenedor-imagen {
    width: 100%;
    margin-bottom: 5px;
  }

  .taller-inscripcion .contenedor-texto h2 {
    font-size: 2rem;
  }

  .taller-inscripcion .contenedor-texto p {
    font-size: 1rem;
  }

  .imagen-taller {
    max-width: 350px;
    animation: flotar-taller 4s ease-in-out infinite;
  }

  .boton-taller {
    padding: 12px 25px;
    font-size: 1rem;
  }

  .introduccion {
    flex-direction: column;
    padding: 20px;
  }

  .contenedor-texto,
  .contenedor-imagen {
    width: 100%;
    margin-bottom: 20px;
  }

  .contenedor-imagen {
    height: 400px;
  }

  .carrusel {
    height: 40vw;
    min-height: 140px;
    height: 400px;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }

  .carrusel-imagenes {
    width: 100%;
    height: 100%;
    min-width: 0;
    display: flex;
  }

  .carrusel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    border-radius: 8px;
    flex: 1 0 100%;
    min-width: 0;
  }

  .contenedor-texto h2 {
    font-size: 2rem;
  }

  .contenedor-texto p {
    font-size: 1rem;
  }

  .contenedor-texto .boton {
    width: 80%;
  }

  .menu-principal {
    display: none;
    grid-column: 1 / 13;
    flex-direction: column;
    gap: 10px;
  }

  .menu-principal a {
    width: 100%;
  }

  .redes-sociales {
    grid-column: 1 / 13;
    justify-content: center;
    display: none;
  }
}

/* 500px */
@media (max-width: 500px) {
  .carta {
    width: 90%;
    height: 200px;
  }

  .carrusel {
    height: 450px;
  }
}

/* 425px */
@media (max-width: 425px) {
  .carta {
    width: 95%;
    height: 180px;
  }

  .sidebar-nav {
    width: 90vw;
    padding-left: 10vw;
  }

  .carrusel {
    height: 400px;
  }
  .contenedor-imagen {
    height: 275px;
  }
}

/* 375px */
@media (max-width: 375px) {
  .carta {
    width: 98%;
    height: 200px;
  }

  .sidebar-nav {
    width: 98vw;
    padding-left: 2vw;
  }

  .carrusel {
    height: 300px;
  }
  .contenedor-imagen {
    height: 250px;
  }

  /* Taller - Imagen ancho completo */
  .taller-inscripcion {
    padding: 10px;
    overflow: visible;
  }

  .taller-inscripcion .contenedor-imagen {
    width: 100%;
    padding: 0;
    margin: 0;
    display: block;
    box-sizing: border-box;
  }

  .imagen-taller {
    max-width: 100%;
    width: 100%;
    margin: 0;
    border-radius: 10px;
    box-shadow: none;
    box-sizing: border-box;
    animation: flotar-taller 4s ease-in-out infinite;
  }

  .img-taller {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    box-sizing: border-box;
  }
}

/* 320px */
@media (max-width: 320px) {
  .carta {
    width: 100%;
    height: 200px;
  }

  .sidebar-nav {
    width: 94vw;
    min-width: 0;
    padding-left: 3vw;
    padding-right: 3vw;
    box-sizing: border-box;
  }

  .carrusel {
    height: 300px;
  }
  .contenedor-imagen {
    height: 200px;
  }

  /* Taller - Imagen ancho completo pantallas pequeñas */
  .taller-inscripcion {
    padding: 8px;
    overflow: visible;
  }

  .taller-inscripcion .contenedor-imagen {
    width: 100%;
    padding: 0;
    margin: 0;
    display: block;
    box-sizing: border-box;
  }

  .imagen-taller {
    max-width: 100%;
    width: 100%;
    margin: 0;
    border-radius: 8px;
    box-shadow: none;
    box-sizing: border-box;
    animation: flotar-taller 4s ease-in-out infinite;
  }

  .img-taller {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    box-sizing: border-box;
  }
}

/* =====================
   SECCIÓN BANNER ANUNCIOS
====================== */
/* Contenedor principal siguiendo .ads-container */
.banner-anuncios {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.5rem auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
  max-width: 800px; /* Reducido de 1200px a 800px */
  min-height: 40px; /* Reducido aún más */
  background: transparent;
  padding: 10px; /* Reducido de 20px a 10px */
}

/* Enlaces dentro del contenedor */
.banner-link {
  display: block;
  width: 100%;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.banner-link:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

/* Imágenes siguiendo .ads-container img */
.banner-imagen {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  margin: 0 auto;
  transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
}

/* Responsividad siguiendo el sistema explicado */
@media (max-width: 768px) {
  .banner-anuncios {
    max-width: 100%; /* Cambiado de 600px a 100% para usar todo el ancho */
    padding: 10px; /* Reducido padding para más espacio */
    min-height: 120px;
    margin: 0.5rem 10px; /* Añadido margen lateral */
  }
  
  .banner-imagen {
    max-width: 100%;
    border-radius: 8px;
  }
}

@media (max-width: 425px) {
  .banner-anuncios {
    max-width: 100%; /* Cambiado de 400px a 100% */
    padding: 8px; /* Reducido padding */
    min-height: 100px;
    margin: 0.5rem 8px; /* Añadido margen lateral para evitar desbordamiento */
  }
  
  .banner-imagen {
    border-radius: 6px;
  }
}
