:root {
  --bg-color: #000000;
  --text-color: #f0f0f0;
  --accent-color: #ffffff;
  --hover-color: #999;
  --font-family: 'Inter', sans-serif;
}

@font-face {
  font-family: 'CN';
  src: url('./media/fontes/leaguespartan-bold.ttf') format('truetype');
}

@font-face {
  font-family: 'NL';
  src: url('./media/fontes/HolidayFree.ttf') format('truetype');
}

@font-face {
  font-family: 'BR';
  src: url('./media/fontes/Anton-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'FAB';
  src: url('./media/fontes/Neuropol.ttf') format('truetype');
}

@font-face {
  font-family: 'RIG';
  src: url('./media/fontes/Kilsonburg.ttf') format('truetype');
}

@font-face {
  font-family: 'LIB';
  src: url('./media/fontes/AICON-VF.ttf') format('truetype');
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow: hidden; /* Keep no scroll bars */
  height: 100vh;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;

  /* Universal layout - works on ANY screen */
  display: grid;
  grid-template-rows: auto 1fr auto; /* header-container, main, footer */
  height: 100vh;
}

main {
  /* Main takes only the remaining space */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Critical: allows content to shrink on ANY screen */
}

/* HEADER */
header {
  background-color: rgba(0, 0, 0, 0.4);
  color: var(--accent-color);
  text-align: center;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border-radius: 0 0 10px 10px;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 500;
}

/* NAV */
nav {
  background-color: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border-radius: 0 0 10px 10px;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  padding: 0.5rem;
  gap: 0.75rem;
}

nav a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  background: transparent;
  border: none;
  transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.2s ease;
}

nav a:hover,
nav a:focus {
  color: #fff;
  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.8),
    0 0 10px rgba(255, 255, 255, 0.6),
    0 0 20px rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
  outline: none;
}

nav a.active {
  color: #fff;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 1),
    0 0 15px rgba(255, 255, 255, 0.8),
    0 0 25px rgba(255, 255, 255, 0.6);
  font-weight: 600;
}





/* ===========================
     FOOTER
=========================== */

footer {
  background-color: rgba(0, 0, 0, 0.4);
  color: var(--accent-color);
  text-align: center;
  padding: 0rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
  border-radius: 10px 10px 0 0;
  font-size: 0.75rem;
  font-family: var(--font-family); /* Ensure footer inherits correct font */

  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  
  /* GUARANTEE footer is always visible */
  flex-shrink: 0;
  min-height: 40px;
  max-height: 40px;
}

footer .copyright {
  flex: 1;
  min-width: 200px;
}

.social-icons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.social-icons a {
  color: var(--accent-color);
  font-size: 1rem;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.social-icons a:hover {
  color: #fff;
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.8),
    0 0 12px rgba(255, 255, 255, 0.6),
    0 0 20px rgba(255, 255, 255, 0.4);
}






/* ===========================
     EVENTOS
=========================== */

.proximos-eventos {
  margin: 2rem auto;
  padding: 2rem 3rem;
  max-width: 1050px;
  min-width: 320px;
  width: 90%;
  background-color: rgba(15, 15, 15, 0.6); /* tono más profundo */
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.08); /* borde sutil tipo glassmorphism */
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-sizing: border-box;
}


.proximos-eventos h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 0.5rem;
}

.evento-lista-item {
  display: flex;
  justify-content: space-between;
  background-color: rgba(255,255,255,0.05);
  padding: 1rem 2rem;
  border-radius: 10px;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;        /* Evita que los elementos se envuelvan */
  max-width: 100%;
  box-sizing: border-box;
}

.evento-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 200px;
}

.evento-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.evento-info p {
  font-size: 0.9rem;
  color: #ccc;
}

.evento-btn {
  background-color: #fff;
  color: #000;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.evento-btn:hover {
  background-color: #ddd;
  transform: scale(1.05);
}



/* ----------------- ESTILOS DE EVENTOS SIGNATURE ------------------- */
.eventos-signature {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  padding: 2rem 1rem 1rem 1rem; /* reduce padding-bottom a 1rem */
  max-width: 1300px; /* aquí aumentamos a 1300px */
  margin: 0 auto;
}

.evento-card {
  flex: 0 0 320px;
  height: 260px;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  background-color: rgba(15, 15, 15, 0.6);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
}


.evento-card:hover {
  transform: scale(1.03);
}

/* Resto sin cambios */
.card-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.4;
  z-index: 1;
}

.card-content {
  position: relative;
  z-index: 2;
  padding: 1rem;
  color: #fff;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-content h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.card-content p {
  font-size: 0.9rem;
  color: #ddd;
}

.card-content .ver-detalhes {
  align-self: flex-start;
  background-color: rgba(255, 255, 255, 0.15); /* translúcido claro */
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.2); /* borde sutil blanco */
  color: #fff;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.1); /* glow sutil */
}

.card-content .ver-detalhes:hover {
  background-color: rgba(255, 255, 255, 0.25); /* un poco más brillante al hacer hover */
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}




 /* ===========================
     MERCADO
=========================== */


    /* Popup styles */
    .popup-overlay {
      position: fixed;
      top: 0; left: 0;
      width: 100%; height: 100%;
      background: rgba(5, 5, 5, 0.6);
      backdrop-filter: blur(4px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 9999;
    }

    .popup-window {
      width: 500px;
      max-width: 90%;
      background: rgba(15, 15, 15, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.08);
      backdrop-filter: blur(10px) saturate(120%);
      -webkit-backdrop-filter: blur(10px) saturate(120%);
      border-radius: 12px;
      box-shadow: 0 0 20px rgba(0,0,0,0.5);
      color: white;
      overflow: hidden;
      font-family: 'Inter', sans-serif;
    }

    .popup-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(255,255,255,0.1);
      padding: 0.75rem 1rem;
      border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .popup-title {
      font-weight: 600;
      font-size: 1.1rem;
    }

    .popup-close {
      width: 12px;
      height: 12px;
      background-color: rgba(255, 79, 79, 0.4); /* rojo translúcido */
      backdrop-filter: blur(10px) saturate(120%);
      -webkit-backdrop-filter: blur(10px) saturate(120%);
      border: 1px solid rgba(255, 79, 79, 0.6);
      border-radius: 50%;
      cursor: pointer;
      transition: background 0.3s ease, box-shadow 0.3s ease;
      padding: 0;
      line-height: 0;
      box-shadow: 0 0 6px 2px rgba(255, 79, 79, 0.5);
    }
    
    .popup-close:hover {
      box-shadow: 0 0 10px 4px rgba(255, 79, 79, 0.8);
      background-color: rgba(255, 79, 79, 0.6);
    }
    .popup-content {
      padding: 1rem;
      font-size: 0.95rem;
      line-height: 1.5;
    }

/* Contenedor principal de las categorías */
.mercado-categorias {
  display: flex;
  justify-content: space-around;
  gap: 2rem;
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;

  /* Ocupa la mayor parte de la ventana en altura */
  min-height: 80vh;

  /* Que los hijos se estiren en altura */
  align-items: stretch;
  flex-wrap: wrap;
}

/* Cada tarjeta categoría */
.categoria-card {
  background-color: rgba(15, 15, 15, 0.6); /* fondo glass */
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.08); /* borde sutil */
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  color: #fff;
  padding: 2rem;
  flex: 1 1 300px;
  max-width: 350px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  user-select: none;
  outline-offset: 4px;

  height: 100%;
  min-height: 70vh;
}

.categoria-card:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15), 0 0 40px rgba(255, 255, 255, 0.08);
}



/* Ventana Popup */
.popup1-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  background: rgba(20, 20, 20, 0.3); /* fondo oscuro translúcido */
  backdrop-filter: blur(12px) brightness(0.7); /* desenfoque y oscurecimiento */
  -webkit-backdrop-filter: blur(12px) brightness(0.7); /* compatibilidad Safari */

  border: 1px solid rgba(255, 255, 255, 0.1); /* borde sutil */
  border-radius: 15px;
  width: 50vw;
  max-width: 700px;
  min-height: 80vh;
  padding: 1rem 2rem 2rem 2rem;
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  font-family: Arial, sans-serif;
  color: white;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5); /* sombra para destacar */
}
/* Cuando el popup está activo */
.popup1-window.active {
  opacity: 1;
  pointer-events: auto;
  animation: popup1FadeIn 0.3s ease;
}

/* Fondo Overlay */
.popup1-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000000cc;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Overlay visible */
.popup1-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Título */
.popup1-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
}

/* Contenedor de productos */
.popup1-products {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

/* Producto individual */
.popup1-product {
  background-color: #222;
  padding: 1rem;
  border-radius: 10px;
  flex-basis: 48%;
  box-sizing: border-box;
  box-shadow: 0 0 10px #111;
}

.popup1-product img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

/* Título producto */
.popup1-product-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #eee;
}

/* Precio producto */
.popup1-product-price {
  font-size: 1rem;
  color: #ccc;
}

/* Botón cerrar */
.popup1-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 2rem;
  color: white;
  cursor: pointer;
  z-index: 100001;
}

/* Animación de fade in */
@keyframes popup1FadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Scrollbar para el popup (opcional) */
.popup1-window::-webkit-scrollbar {
  width: 8px;
}

.popup1-window::-webkit-scrollbar-track {
  background: #222;
  border-radius: 4px;
}

.popup1-window::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.popup1-product button {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.popup1-product button:hover {
  background-color: #666;
}

/* BLUR solo en el fondo */
.popup2-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.4); /* opcional: añade un poco de oscuridad */
  z-index: 9998;
  display: none;
}

/* Mostrar overlay activo */
.popup2-overlay.active {
  display: block;
}

/* La ventana va encima del overlay */
.popup2-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 20, 0.9); /* sin blur aquí */
  color: white;
  padding: 2rem;
  border-radius: 16px;
  z-index: 9999;
  max-width: 500px;
  width: 90%;
  text-align: center;
}

.popup2-window.active {
  opacity: 1;
  pointer-events: auto;
}

.popup2-img {
  width: 100%;
  max-height: 250px;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.popup2-title {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.popup2-desc {
  font-size: 1rem;
  color: #ccc;
  margin-bottom: 1rem;
}

.popup2-price {
  font-size: 1.2rem;
  margin-bottom: 1.2rem;
}

.popup2-buy {
  background-color: #00cc88;
  border: none;
  color: black;
  font-weight: bold;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.popup2-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: white;
  cursor: pointer;
}

/* POPUP2 debe estar sobre popup1 */
.popup2-window,
.popup2-overlay {
  z-index: 9999;
}

/* popup1 tiene menor prioridad */
.popup1-window,
.popup1-overlay {
  z-index: 999;
}

/* Efecto hover para productos */
.popup1-product {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}
.popup1-product:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

/* Imagen en el popup2 */
#popup2-img {
  max-width: 90%;
  max-height: 50vh;
  border-radius: 12px;
  margin-bottom: 1rem;
  object-fit: contain;
}

/* popup2 responsivo y centrado */
.popup2-window {
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(10px);
  color: white;
  padding: 2rem;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Botón Comprar */
.btn-comprar {
  background: #ffffff10;
  border: 1px solid #ffffff30;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-comprar:hover {
  background: #ffffff20;
}

#popup2 {
  display: none;
  /* o con opacity y visibility para animaciones */
  /* opacity: 0; visibility: hidden; transition: opacity 0.3s ease; */
}

#popup2.active {
  display: block;
  /* o opacity: 1; visibility: visible; */
}




/* ===========================
     BACKGROUNDS
=========================== */

/* FUNDOS PERSONALIZADOS POR PÁGINA */

body.bg-club {
  background-image: url("media/B01 Club Benares.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.bg-eventos {
  background-image: url("media/B03 Eventos.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.bg-biblioteca {
  background-image: url("media/B05 Biblioteca Nacional.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.bg-cinemateca {
  background-image: url("media/B06 Canal 14.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.bg-laboratorio {
  background-image: url("media/Eventos\ \(3\).png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.bg-mercado {
  background-image: url("media/Eventos\ \(2\).png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.bg-comunidade {
  background-image: url("media/B10\ Comunidade.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.bg-contactos {
  background-image: url("media/B04\ Noticias.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Add this to your existing footer styles in styles.css */

.shadow-toggle-btn {
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0.4rem 0.8rem;
  font-weight: 600;
  font-size: 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.1);
  font-family: var(--font-family);
  user-select: none;
}

.shadow-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.shadow-toggle-btn.shadows-off {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.1);
}

.shadow-toggle-btn.shadows-off:hover {
  background-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}