/* ==========================================================================
   Reset y Estilos Base
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Modo Oscuro / Claro
   ========================================================================== */
body.dark-mode {
  background: linear-gradient(135deg, #0d1b2a 0%, #1b263b 100%);
  color: #e0e0e0;
}

body.light-mode {
  background: linear-gradient(135deg, #e0e7ff 0%, #f8fafc 100%);
  color: #1f2937;
}

/* ==========================================================================
   Contenedor Principal
   ========================================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

body.dark-mode .navbar {
  background: linear-gradient(90deg, #111827 0%, #1e293b 100%);
  border-bottom: 2px solid #3b82f6;
}

body.light-mode .navbar {
  background: linear-gradient(90deg, #f1f5f9 0%, #e0e7ff 100%);
  border-bottom: 2px solid #1e40af;
}

.navbar-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.navbar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

body.dark-mode .nav-link {
  color: #a5b4fc;
}

body.light-mode .nav-link {
  color: #1e40af;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  transition: width 0.3s ease;
}

body.dark-mode .nav-link::after {
  background: #3b82f6;
}

body.light-mode .nav-link::after {
  background: #1e40af;
}

.nav-link:hover::after {
  width: 100%;
}

body.dark-mode .nav-link:hover {
  color: #3b82f6;
}

body.light-mode .nav-link:hover {
  color: #1e40af;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Menu Toggle Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  padding: 0;
}

.menu-icon {
  display: block;
  width: 100%;
  height: 3px;
  background: #a5b4fc;
  transition: all 0.3s ease;
}

body.light-mode .menu-icon {
  background: #1e40af;
}

.menu-toggle.active .menu-icon:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .menu-icon:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .menu-icon:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ==========================================================================
   Buscador
   ========================================================================== */
.search-bar {
  position: relative;
  width: 100%;
  max-width: 250px;
  display: flex;
  align-items: center;
}

.search-bar input {
  padding: 0.5rem 0.8rem 0.5rem 2.5rem;
  border: 1px solid #3b82f6;
  border-radius: 12px;
  font-size: 0.9rem;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  width: 100%;
}

body.dark-mode .search-bar input {
  background: #1e293b;
  color: #e0e0e0;
  border-color: #3b82f6;
}

body.light-mode .search-bar input {
  background: #f1f5f9;
  color: #1f2937;
  border-color: #1e40af;
}

.search-bar input:focus {
  outline: none;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

body.light-mode .search-bar input:focus {
  box-shadow: 0 0 8px rgba(30, 64, 175, 0.5);
}

.search-bar input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.search-icon {
  position: absolute;
  left: 0.8rem;
  font-size: 1rem;
}

body.dark-mode .search-icon {
  color: #a5b4fc;
}

body.light-mode .search-icon {
  color: #1e40af;
}

/* ==========================================================================
   Search Results
   ========================================================================== */
.search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%; /* Match the search bar width */
  max-width: 250px; /* Match the search bar's max-width on desktop */
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  z-index: 20;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 0.5rem;
}

body.dark-mode .search-results {
  background: #1e293b;
  border-color: #4b5563;
}

.search-results.show {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem; /* Increased padding for better spacing */
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.2s ease;
  gap: 0.75rem; /* Space between logo, name, and button */
}

body.dark-mode .search-result-item {
  border-bottom: 1px solid #4b5563;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: #f1f5f9;
}

body.dark-mode .search-result-item:hover {
  background: #2d3748;
}

.search-result-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
  background: #ffffff;
  padding: 2px;
  flex-shrink: 0; /* Prevent logo from shrinking */
}

body.dark-mode .search-result-logo {
  background: #2d3748;
}

.search-result-name {
  flex-grow: 1; /* Allow name to expand and fill space */
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap; /* Prevent text wrapping */
  overflow: hidden;
  text-overflow: ellipsis; /* Add ellipsis for long names */
}

body.dark-mode .search-result-name {
  color: #e0e7ff;
}

body.light-mode .search-result-name {
  color: #1e40af;
}

.search-result-link {
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.3rem 0.75rem; /* Adjusted padding for button size */
  border-radius: 6px;
  background: #3b82f6;
  color: #ffffff;
  transition: background 0.3s ease, transform 0.2s ease;
  flex-shrink: 0; /* Prevent button from shrinking */
  margin-left: auto; /* Push button to the right */
}

body.light-mode .search-result-link {
  background: #1e40af;
}

.search-result-link:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

body.light-mode .search-result-link:hover {
  background: #1e3a8a;
}

.search-result-link[aria-disabled="true"] {
  background: #6b7280;
  cursor: not-allowed;
  pointer-events: none;
}

body.light-mode .search-result-link[aria-disabled="true"] {
  background: #d1d5db;
}

/* ==========================================================================
   Responsividad (Search Results)
   ========================================================================== */
@media (max-width: 768px) {
  .search-results {
    max-width: 100%; /* Already set to 100% of search bar */
    left: 0;
    right: auto;
    margin: 0;
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .search-results {
    max-width: 100%; /* Already set to 100% of search bar */
    left: 0;
    right: auto;
    margin: 0;
    margin-top: 0.5rem;
  }

  .search-result-logo {
    width: 20px;
    height: 20px;
    padding: 2px;
  }

  .search-result-name {
    font-size: 0.85rem;
  }

  .search-result-link {
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem; /* Slightly reduced padding for smaller screens */
  }
}

/* ==========================================================================
   Menú Desplegable de Idioma
   ========================================================================== */
.language-dropdown {
  position: relative;
}

.dropdown-toggle {
  background: #3b82f6;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.3rem 1.2rem 0.3rem 0.7rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  vertical-align: middle;
  transition: background 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
  color: #ffffff;
}

body.light-mode .dropdown-toggle {
  background: #1e40af;
  border-color: #1e40af;
  color: #ffffff;
}

.dropdown-toggle:hover {
  transform: translateY(-2px);
}

body.dark-mode .dropdown-toggle:hover {
  background: #2563eb;
}

body.light-mode .dropdown-toggle:hover {
  background: #1e3a8a;
}

.dropdown-icon {
  width: 1em;
  height: 1em;
  stroke-width: 2;
  vertical-align: middle;
  display: inline-block;
  line-height: 1;
  color: #ffffff;
}

.dropdown-toggle:hover .dropdown-icon {
  color: #ffffff;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  z-index: 20;
  min-width: 120px;
}

body.dark-mode .dropdown-menu {
  background: #1e293b;
  border-color: #3b82f6;
}

body.light-mode .dropdown-menu {
  background: #f1f5f9;
  border-color: #1e40af;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.2s ease, color 0.2s ease;
}

body.dark-mode .dropdown-item {
  color: #a5b4fc;
}

body.light-mode .dropdown-item {
  color: #1e40af;
}

.dropdown-item:hover {
  color: #ffffff;
}

body.dark-mode .dropdown-item:hover {
  background: #3b82f6;
}

body.light-mode .dropdown-item:hover {
  background: #1e40af;
}

/* ==========================================================================
   Botón de Tema
   ========================================================================== */
.btn-icon {
  background: #1f2937;
  border: 1px solid #3b82f6;
  border-radius: 50%;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
}

body.light-mode .btn-icon {
  background: #ffffff;
  border-color: #1e40af;
}

.btn-icon:hover {
  transform: translateY(-2px);
}

body.dark-mode .btn-icon:hover {
  background: #3b82f6;
}

body.light-mode .btn-icon:hover {
  background: #1e40af;
}

.icon, .theme-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

body.dark-mode .icon, body.dark-mode .theme-icon {
  color: #a5b4fc;
}

body.light-mode .icon, body.light-mode .theme-icon {
  color: #1e40af;
}

.btn-icon:hover .icon, .btn-icon:hover .theme-icon {
  color: #ffffff;
}

/* ==========================================================================
   Encabezado
   ========================================================================== */
header {
  background: linear-gradient(90deg, #1e3a8a 0%, #3b82f6 100%);
  padding: 3rem 0;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

header h1 {
  font-size: 2.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

header p {
  font-size: 1.2rem;
  margin-top: 0.5rem;
  color: #a5b4fc;
}

body.light-mode header {
  background: linear-gradient(90deg, #3b82f6 0%, #93c5fd 100%);
}

body.light-mode header h1 {
  color: #1f2937;
}

body.light-mode header p {
  color: #1e40af;
}

/* Existing styles from styles.css remain unchanged, only adding the new button styles */

/* ==========================================================================
   Main y Sección Home
   ========================================================================== */
main {
  flex: 1;
}

.home-section {
  text-align: center;
  padding: 3rem 0;
}

.home-section h2 {
  font-size: 2rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 1rem;
}

body.light-mode .home-section h2 {
  color: #1e40af;
}

.home-section p {
  font-size: 1.1rem;
  color: #d1d5db;
  margin-bottom: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

body.light-mode .home-section p {
  color: #4b5563;
}

.home-section .btn-catalog {
  background: #3b82f6;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: background 0.3s ease, transform 0.2s ease;
}

body.light-mode .home-section .btn-catalog {
  background: #1e40af;
}

.home-section .btn-catalog:hover {
  background: #2563eb;
  transform: scale(1.05);
}

body.light-mode .home-section .btn-catalog:hover {
  background: #1e3a8a;
}

/* ==========================================================================
   Responsividad (Home Section)
   ========================================================================== */
@media (max-width: 768px) {
  .home-section h2 {
    font-size: 1.8rem;
  }

  .home-section p {
    font-size: 1rem;
  }

  .home-section .btn-catalog {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .home-section h2 {
    font-size: 1.6rem;
  }

  .home-section p {
    font-size: 0.9rem;
  }

  .home-section .btn-catalog {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

/* ==========================================================================
   Cuadrícula de Tarjetas
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 3rem 0;
}

/* ==========================================================================
   Tarjetas (Cards)
   ========================================================================== */
.card {
  background: #1e293b;
  border-radius: 12px;
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #3b82f6;
  position: relative;
  overflow: hidden;
}

body.light-mode .card {
  background: #ffffff;
  border: 1px solid #93c5fd;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(59, 130, 246, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.card:hover::before {
  opacity: 1;
}

.card h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 1rem;
}

body.light-mode .card h2 {
  color: #1e40af;
}

.card p {
  font-size: 1rem;
  color: #d1d5db;
  margin-bottom: 1.5rem;
}

body.light-mode .card p {
  color: #4b5563;
}

/* ==========================================================================
   Botones Generales
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #3b82f6;
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.3s ease, transform 0.2s ease;
}

body.light-mode .btn {
  background: #1e40af;
}

.btn:hover {
  background: #2563eb;
  transform: scale(1.05);
}

body.light-mode .btn:hover {
  background: #1e3a8a;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  padding: 3rem 0;
  border-top: 2px solid #3b82f6;
  background: linear-gradient(180deg, #111827 0%, #0d1b2a 100%);
}

body.light-mode footer {
  background: linear-gradient(180deg, #f1f5f9 0%, #e0e7ff 100%);
  border-top: 2px solid #1e40af;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-left p {
  font-size: 0.95rem;
  font-weight: 400;
  color: #a5b4fc;
}

body.light-mode .footer-left p {
  color: #4b5563;
}

.footer-right {
  display: flex;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-link {
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
}

body.dark-mode .footer-link {
  color: #a5b4fc;
}

body.light-mode .footer-link {
  color: #1e40af;
}

.footer-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  transition: width 0.3s ease;
}

body.dark-mode .footer-link::after {
  background: #3b82f6;
}

body.light-mode .footer-link::after {
  background: #1e40af;
}

.footer-link:hover::after {
  width: 100%;
}

body.dark-mode .footer-link:hover {
  color: #3b82f6;
}

body.light-mode .footer-link:hover {
  color: #1e40af;
}

/* ==========================================================================
   Responsividad (Footer)
   ========================================================================== */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .footer-left {
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
}

@media (max-width: 480px) {
  footer {
    padding: 2rem 0;
  }

  .footer-left p {
    font-size: 0.85rem;
  }

  .footer-link {
    font-size: 0.85rem;
  }
}

/* ==========================================================================
   Responsividad (Navbar)
   ========================================================================== */
@media (max-width: 768px) {
  .navbar-top {
    flex-direction: row;
    align-items: center;
    position: relative;
  }

  .navbar-left {
    flex-direction: row;
    align-items: center;
    width: auto;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #111827 0%, #1e293b 100%);
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    z-index: 20;
  }

  body.light-mode .nav-links {
    background: linear-gradient(90deg, #f1f5f9 0%, #e0e7ff 100%);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-link {
    font-size: 1rem;
    padding: 0.5rem;
    width: 100%;
    text-align: center;
  }

  .navbar-right {
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    flex-grow: 1;
    position: relative;
  }

  .search-bar {
    max-width: 200px;
    flex-grow: 1;
    margin: 0 auto;
  }

  .language-dropdown {
    margin-left: auto;
    position: absolute;
    right: 0;
  }

  .dropdown-toggle {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
  }

  .dropdown-menu {
    right: 0;
  }

  .theme-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 30;
  }

  .home-section h2 {
    font-size: 1.8rem;
  }

  .home-section p {
    font-size: 1rem;
  }

  header h1 {
    font-size: 2rem;
  }

  header p {
    font-size: 1rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .navbar-right {
    gap: 0.3rem;
  }

  .search-bar {
    max-width: 220px;
  }

  .search-bar input {
    padding: 0.4rem 0.6rem 0.4rem 2rem;
    font-size: 0.8rem;
  }

  .search-icon {
    font-size: 0.9rem;
    left: 0.6rem;
  }

  .dropdown-toggle {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
  }

  .dropdown-icon {
    width: 0.8em;
    height: 0.8em;
  }

  .theme-toggle-btn {
    width: 36px;
    height: 36px;
    padding: 0.4rem;
    bottom: 15px;
    right: 15px;
  }

  .icon, .theme-icon {
    width: 18px;
    height: 18px;
  }

  .nav-link {
    font-size: 0.9rem;
    padding: 0.4rem;
  }
}

/* ==========================================================================
   Catalog Section
   ========================================================================== */
.catalog-section {
  padding: 2rem 0;
  text-align: left;
}

.catalog-section h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
  line-height: 1.2;
}

body.dark-mode .catalog-section h1 {
  color: #e0e7ff;
}

body.light-mode .catalog-section h1 {
  color: #1e40af;
}

.catalog-section p {
  font-size: 1rem;
  color: #d1d5db;
  margin-bottom: 1.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

body.dark-mode .catalog-section p {
  color: #a5b4fc;
}

body.light-mode .catalog-section p {
  color: #6b7280;
}

.catalog-section .nav-link {
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.3s ease;
}

body.dark-mode .catalog-section .nav-link {
  color: #3b82f6;
}

body.light-mode .catalog-section .nav-link {
  color: #1e40af;
}

.catalog-section .nav-link:hover {
  color: #2563eb;
}

body.light-mode .catalog-section .nav-link:hover {
  color: #1e3a8a;
}

.filter-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

body.dark-mode .filter-group label {
  color: #a5b4fc;
}

body.light-mode .filter-group label {
  color: #4b5563;
}

.filter-group select {
  padding: 0.5rem 1.8rem 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.9rem;
  background: #ffffff;
  color: #1f2937;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%231f2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  height: 38px;
}

body.dark-mode .filter-group select {
  background: #2d3748;
  border-color: #4b5563;
  color: #e0e7ff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23e0e7ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  height: 38px;
}

.filter-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.filter-group select option {
  background: #ffffff;
  color: #1f2937;
  font-size: 0.9rem;
}

body.dark-mode .filter-group select option {
  background: #2d3748;
  color: #e0e7ff;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
}

#apply-filters,
#reset-filters {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  height: 38px;
}

#apply-filters {
  background: #10b981;
  color: #ffffff;
}

body.light-mode #apply-filters {
  background: #059669;
}

#apply-filters:hover {
  background: #059669;
  transform: translateY(-2px);
}

body.light-mode #apply-filters:hover {
  background: #047857;
}

#reset-filters {
  background: #ef4444;
  color: #ffffff;
}

body.light-mode #reset-filters {
  background: #dc2626;
}

#reset-filters:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

body.light-mode #reset-filters:hover {
  background: #b91c1c;
}

.no-results {
  font-size: 1rem;
  text-align: center;
  margin: 2rem 0;
}

body.dark-mode .no-results {
  color: #a5b4fc;
}

body.light-mode .no-results {
  color: #6b7280;
}

.card {
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 220px;
}

body.dark-mode .card {
  background: #1f2937;
  border: 1px solid #374151;
}

body.light-mode .card {
  background: #ffffff;
  border: 1px solid #e0e7ff;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  background: #ffffff;
  padding: 4px;
}

body.dark-mode .card-logo {
  background: #2d3748;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

body.dark-mode .card-title {
  color: #e0e7ff;
}

body.light-mode .card-title {
  color: #1e40af;
}

.card-description {
  font-size: 0.9rem;
  line-height: 1.5;
  flex-grow: 1;
}

body.dark-mode .card-description {
  color: #a5b4fc;
}

body.light-mode .card-description {
  color: #6b7280;
}

.card-link {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  align-self: flex-end;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: #3b82f6;
  color: #ffffff;
  transition: background 0.3s ease, transform 0.2s ease;
  cursor: pointer;
  display: inline-block;
  position: relative;
  z-index: 1;
}

body.light-mode .card-link {
  background: #1e40af;
}

.card-link:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

body.light-mode .card-link:hover {
  background: #1e3a8a;
}

.card-link[aria-disabled="true"] {
  background: #6b7280;
  cursor: not-allowed;
  pointer-events: none;
}

body.light-mode .card-link[aria-disabled="true"] {
  background: #d1d5db;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

.card-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.3s ease, color 0.3s ease;
}

body.light-mode .card-tag {
  background: #bfdbfe;
  color: #1e40af;
}

body.dark-mode .card-tag {
  background: #60a5fa;
  color: #ffffff;
}

.card-tag:hover {
  opacity: 0.9;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.rating {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rating-value {
  font-size: 0.85rem;
  font-weight: 500;
}

body.dark-mode .rating-value {
  color: #a5b4fc;
}

body.light-mode .rating-value {
  color: #4b5563;
}

.stars {
  display: flex;
  gap: 0.2rem;
}

.star {
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.2s ease;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

body.light-mode .star {
  color: #f59e0b;
}

body.dark-mode .star {
  color: #f59e0b;
}

.star.filled {
  color: #63614b;
}

.star:hover,
.star:hover ~ .star {
  color: #63614b;
}

.star:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* ==========================================================================
   Responsividad (Catalog)
   ========================================================================== */
@media (max-width: 1024px) {
  .filter-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-buttons {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 768px) {
  .catalog-section {
    padding: 1.5rem 0;
  }

  .catalog-section h1 {
    font-size: 1.8rem;
  }

  .catalog-section p {
    font-size: 0.95rem;
  }

  .filter-panel {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .filter-group select {
    font-size: 0.85rem;
    padding: 0.4rem 1.6rem 0.4rem 0.6rem;
    background-size: 0.8rem;
    height: 36px;
  }

  #apply-filters,
  #reset-filters {
    padding: 0.4rem 0.8rem;
    height: 36px;
  }

  .card {
    padding: 1.25rem;
    min-height: 200px;
  }

  .card-link {
    padding: 0.4rem 0.8rem;
  }

  .card-tags {
    gap: 0.5rem;
  }

  .card-tag {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
  }
}

@media (max-width: 480px) {
  .catalog-section h1 {
    font-size: 1.6rem;
  }

  .catalog-section p {
    font-size: 0.9rem;
  }

  .filter-group label {
    font-size: 0.85rem;
  }

  .filter-group select {
    font-size: 0.8rem;
    padding: 0.35rem 1.5rem 0.35rem 0.5rem;
    background-size: 0.7rem;
    height: 34px;
  }

  #apply-filters,
  #reset-filters {
    font-size: 0.85rem;
    padding: 0.35rem 0.7rem;
    height: 34px;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .card-description {
    font-size: 0.8rem;
  }

  .card-link {
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
  }

  .card-logo {
    width: 28px;
    height: 28px;
    padding: 3px;
  }

  .card-tags {
    gap: 0.5rem;
  }

  .card-tag {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
  }

  .card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .rating-value {
    font-size: 0.8rem;
  }

  .star {
    font-size: 0.9rem;
  }
}

/* ==========================================================================
   Donations Section
   ========================================================================== */
.donations-section {
  padding: 3rem 1rem;
}

.donations-section h1 {
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1rem;
}

body.dark-mode .donations-section h1 {
  color: #e0e7ff;
}

body.light-mode .donations-section h1 {
  color: #1e40af;
}

.intro-text {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2rem;
  font-size: 1rem;
}

body.dark-mode .intro-text {
  color: #a5b4fc;
}

body.light-mode .intro-text {
  color: #6b7280;
}

.donation-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.donation-card {
  background: #1e293b;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #3b82f6;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.light-mode .donation-card {
  background: #ffffff;
  border: 1px solid #93c5fd;
}

.donation-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.2);
}

.donation-logo {
  width: 80px;
  height: auto;
  margin: 0 auto 1rem;
  display: block;
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
  border-radius: 4px;
}

body.dark-mode .donation-logo {
  background: #2d3748;
}

.donation-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

body.dark-mode .donation-card h3 {
  color: #e0e7ff;
}

body.light-mode .donation-card h3 {
  color: #1e40af;
}

.donation-card p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

body.dark-mode .donation-card p {
  color: #a5b4fc;
}

body.light-mode .donation-card p {
  color: #6b7280;
}

.account-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.account-details p {
  font-size: 0.85rem;
  word-break: break-all;
  margin: 0;
}

body.dark-mode .account-details p {
  color: #d1d5db;
}

body.light-mode .account-details p {
  color: #4b5563;
}

.btn-donate,
.btn-copy {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-donate {
  background: #3b82f6;
  color: #ffffff;
}

body.light-mode .btn-donate {
  background: #1e40af;
}

.btn-donate:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

body.light-mode .btn-donate:hover {
  background: #1e3a8a;
}

.btn-copy {
  background: #10b981;
  color: #ffffff;
}

body.light-mode .btn-copy {
  background: #059669;
}

.btn-copy:hover,
.btn-copy.copied {
  background: #059669;
  transform: translateY(-2px);
}

body.light-mode .btn-copy:hover,
body.light-mode .btn-copy.copied {
  background: #047857;
}

.donation-info {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.donation-info h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

body.dark-mode .donation-info h3 {
  color: #e0e7ff;
}

body.light-mode .donation-info h3 {
  color: #1e40af;
}

.donation-info ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.donation-info li {
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

body.dark-mode .donation-info li {
  color: #a5b4fc;
}

body.light-mode .donation-info li {
  color: #6b7280;
}

.donation-info li::before {
  content: '✓';
  color: #10b981;
  margin-right: 0.5rem;
}

body.light-mode .donation-info li::before {
  color: #059669;
}

.donation-info p {
  font-size: 0.9rem;
}

body.dark-mode .donation-info p {
  color: #a5b4fc;
}

body.light-mode .donation-info p {
  color: #6b7280;
}

/* ==========================================================================
   Responsividad
   ========================================================================== */
@media (max-width: 768px) {
  .donations-section {
    padding: 2rem 1rem;
  }

  .donations-section h1 {
    font-size: 1.8rem;
  }

  .intro-text {
    font-size: 0.9rem;
  }

  .donation-options {
    grid-template-columns: 1fr;
  }

  .donation-card {
    padding: 1.25rem;
  }

  .donation-logo {
    width: 70px;
  }

  .donation-card h3 {
    font-size: 1.1rem;
  }

  .donation-card p {
    font-size: 0.85rem;
  }

  .account-details p {
    font-size: 0.8rem;
  }

  .btn-donate,
  .btn-copy {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }

  .donation-info h3 {
    font-size: 1.3rem;
  }

  .donation-info li {
    font-size: 0.85rem;
  }

  .donation-info p {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .donations-section h1 {
    font-size: 1.6rem;
  }

  .intro-text {
    font-size: 0.85rem;
  }

  .donation-logo {
    width: 60px;
  }

  .donation-card h3 {
    font-size: 1rem;
  }

  .donation-card p {
    font-size: 0.8rem;
  }

  .account-details p {
    font-size: 0.75rem;
  }

  .btn-donate,
  .btn-copy {
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
  }

  .donation-info h3 {
    font-size: 1.2rem;
  }

  .donation-info li {
    font-size: 0.8rem;
  }

  .donation-info p {
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   Visitor Text
   ========================================================================== */
.visitor-text {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 10;
  font-size: 0.75rem; /* Small font size */
  color: #ffffff; /* White text for dark mode */
  background: #2563eb; /* Darker blue background for dark mode */
  padding: 0.3rem 0.6rem; /* Minimal padding */
  border-radius: 4px; /* Small rounded corners */
  line-height: 1.2; /* Tight line height */
  margin: 0; /* Remove default margin */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); /* Subtle shadow for text contrast */
}

body.light-mode .visitor-text {
  background: #1e3a8a; /* Deeper blue background for light mode */
  color: #ffffff; /* White text for light mode */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* Stronger shadow for better contrast */
}

@media (max-width: 768px) {
  .visitor-text {
    font-size: 0.7rem;
    bottom: 8px;
    right: 8px;
    padding: 0.25rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .visitor-text {
    font-size: 0.65rem;
    bottom: 40px;
    right: 6px;
    padding: 0.2rem 0.4rem;
  }
}

/* Existing styles for .card and .card-description (unchanged) */
.card {
  background: #1e293b;
  border-radius: 12px;
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #3b82f6;
  position: relative;
  overflow: hidden;
}

body.light-mode .card {
  background: #ffffff;
  border: 1px solid #93c5fd;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(59, 130, 246, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.card:hover::before {
  opacity: 1;
}

.card-description {
  font-size: 0.9rem;
  line-height: 1.5;
  flex-grow: 1;
}

body.dark-mode .card-description {
  color: #a5b4fc;
}

body.light-mode .card-description {
  color: #6b7280;
}