:root {
  /* Paleta base */
  --color-principal-suave: rgba(102, 178, 165, 0.6);
  --color-principal-claro: rgba(102, 178, 165, 0.3);

  --color-fondo-seccion: #dff5ec;

  --color-texto-principal-f: #234c3a;
  --color-texto-extra: #2d594c;
  --color-texto-detalle-f: #5779d6;

  --color-extra-info-bg: rgba(250, 255, 252, 0.5);

  --fuente-principal: 'Poppins', sans-serif;
}

/* ====== SUBTÍTULOS ====== */
.subtitulo {
  text-align: center;    /* Centrar texto */
  margin-top: -1rem;     /* Espaciado arriba negativo */
  margin-bottom: 2.5rem; /* Espaciado abajo */
  font-size: 1rem;       /* Tamaño de fuente */
  color: var(--color-texto-secundario);
  font-style: italic;
  font-family: var(--fuente-principal);
}

.titulo {
  color: var(--color-texto-detalle-f);
}

/* ====== NAVEGACIÓN FLOTANTE ====== */
.nav-flotante {
  position: fixed;       /* Posicionamiento fijo */
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;           /* Espacio entre botones */
  z-index: 2000;
}

.nav-flotante button {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-principal-suave); /* Usa tu variable si tienes */
  color: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(6px);
  transition: transform 0.2s ease, background 0.3s ease;
  cursor: pointer;
  font-size: 1.2rem;
}

.nav-flotante button:hover,
.nav-flotante button:focus {
  background: var(--color-principal-claro); /* O un tono más claro */
  transform: scale(1.1);
  outline: none;
}

/* ====== BOTÓN SITIO (base para todos los botones) ====== */
.boton-sitio {
  display: inline-block;
  margin-top: 1rem;      /* Separación arriba */
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  background-color: #007ACC;
  color: white;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.3s ease;
}

.boton-sitio:hover {
  background-color: #005f99;
}

/* ====== SECCIONES ====== */
section {
  padding: 4rem 2rem;    /* Espaciado general */
  background: var(--color-fondo-gradiente);
  backdrop-filter: var(--blur-suave);
}

#empresas {
  background: var(--color-bg);
}

#casuales {
  background: var(--color-bg);
}

/* ====== GRID DE TARJETAS ====== */
.grid-empresas,
.grid-casuales {
  display: flex;
  flex-direction: column;
  gap: 3rem;             /* Espaciado entre filas */
  padding: 0 2rem;
  align-items: center;
}

/* ====== CONTENEDOR DE CADA TARJETA Y EXTRA ====== */
.card-item-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 2rem;             /* Espaciado entre tarjetas */
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  max-width: 1200px;
}

/* ====== TARJETA BASE ====== */
.card {
  flex: 1 1 50%;         /* Flexibilidad para responsividad */
  width: 640px;
  height: auto;
  min-height: 450px;
  padding: 2rem;
  border-radius: 16px;
  background: var(--color-tarjeta-bg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: var(--blur-medio);
  -webkit-backdrop-filter: var(--blur-medio);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  box-sizing: border-box;
  font-family: var(--fuente-principal);
}

.card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 18px 40px rgba(102, 178, 165, 0.4);
  background: var(--color-principal-claro);
}

/* === TARJETA CON CONTENIDO (.filled) - estilos diferenciados === */
.card.filled {
  opacity: 0;
  background: var(--color-tarjeta-filled-bg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  animation: slideInUp 0.6s forwards;
}

/* Ajustes internos para contenido .filled */
.card.filled .card-content {
  gap: 1rem;           
  padding-top: 0.8rem;
  overflow-y: auto;
  max-height: 300px;
}

.card.filled .card-content h3 {
  font-size: 1.5rem;     
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-texto-principal-f);
  margin-bottom: 0.6rem;
}

.card.filled .card-content p {
  font-size: 1.1rem;     
  line-height: 1.5;
  color: var(--color-texto-secundario);
}

.card.filled .card-info-secundaria {
  font-size: 1rem;      
  gap: 1.2rem 3rem;
  color: var(--color-texto-detalle);
}

.card.filled .boton-sitio {
  font-size: 1rem;       
  padding: 0.7rem 1.2rem;
  margin-bottom: 10px;
  background: var(--color-principal-claro);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 122, 204, 0.3);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.card.filled .boton-sitio:hover {
  background: var(--color-principal-suave);
  box-shadow: 0 6px 15px rgba(0, 95, 153, 0.5);
}

.card.filled img {
  width: 140px;          
  height: 140px;
  border: 1px solid #5db7f3;
  box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

/* Opcional: Extra-info adyacente a .filled */
.card.filled + .extra-info {
  background-color: #f5f8fa;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
  color: #333;
  font-size: 1.1rem;
  line-height: 1.7;
}

/* === TARJETA PLACEHOLDER === */
.card.placeholder {
  background: rgba(255, 255, 255, 0.1);
  opacity: 0.3;
  color: #97b6ad;
  border: 2px dashed #aacfc2;
}

.card.placeholder img {
  filter: grayscale(100%) brightness(1.1);
  opacity: 0.6;
}

.card.placeholder .lema {
  font-style: italic;
  color: #bbb;
}

.card.placeholder .boton-sitio {
  background-color: #ccc;
  color: #777;
  pointer-events: none;
  cursor: default;
  box-shadow: none;
}

.card.placeholder .boton-sitio:hover {
  background-color: #ccc;
}

/* ====== CONTENIDO DE LA TARJETA ====== */
.card img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--color-principal-suave);
  box-shadow: 0 4px 10px rgba(102, 178, 165, 0.3);
  object-fit: cover;
}

.card-content {
  flex: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.9rem;         
  padding-top: 0.5rem;
  overflow: hidden;
}

.card-content h3 {
  margin-bottom: 0.3rem;
  font-size: 1.2rem;
}

.card-content p {
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  margin: 0;
}

/* ====== INFORMACIÓN PRINCIPAL Y SECUNDARIA ====== */
.card-info-principal {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.card-info-secundaria {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem 2rem;
  font-size: 0.95rem;
  color: #444;
  margin-top: 0.6rem;
}

.card-info-secundaria p {
  margin: 0;
  flex: 1 1 45%;
  min-width: 150px;
}

/* ====== BOTÓN EN CONTENEDOR ====== */
.boton-container {
  flex: 1 1 100%;
  display: flex;
  justify-content: center;
  margin-top: 0.8rem;
}

/* ====== INFORMACIÓN EXTRA (lado de tarjeta) ====== */
.extra-info {
  flex: 1 1 40%;
  font-size: 1rem;
  line-height: 1.6;
  padding: 1.5rem;
  color: var(--color-texto-extra);
  background: var(--color-extra-info-bg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: var(--blur-suave);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  font-family: var(--fuente-principal);
}

.extra-info .descripcion {
  text-align: center;
  margin-bottom: 1rem;
}

.extra-info .calificacion {
  text-align: center;
  margin-top: auto;
}

/* ====== ANIMACIONES ====== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  .card-item-container {
    flex-direction: column;
    align-items: center;
  }

  .card,
  .extra-info {
    width: 100%;
    max-width: 95%;
  }

  .extra-info {
    margin-top: 1.5rem;
    text-align: center;
  }

  .card-content {
    align-items: center;
    text-align: center;
  }

  .card img {
    width: 100px;
    height: 100px;
  }

  .descripcion,
  .calificacion {
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  section {
    padding: 3.5rem 1.5rem; /* en lugar de 2rem */
  }

  .grid-empresas,
  .grid-casuales {
    padding: 0 1rem; /* en lugar de 2rem */
  }

  .card,
  .extra-info {
    max-width: 100%;
    padding: 1.5rem; /* Reduce padding interno, más contenido visible */
  }

  .card-content {
    padding-top: 0.3rem;
    gap: 0.7rem;
  }

  .card-content p {
    font-size: 1rem;
    line-height: 1.5;
  }

  .card.filled .boton-sitio {
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
  }

  .card img {
    width: 90px;
    height: 90px;
  }
}