/* ============================================================
   listado.css — Página de proveedores
   Depende de index.css (variables, reset, header, footer)
   ============================================================ */

/* === SECCIÓN PRINCIPAL ===================================== */
#listado {
  padding: 3.5rem 2rem 5rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

/* === ENCABEZADO DE SECCIÓN ================================= */
.listado-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.listado-header h1 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.listado-subtitulo {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.listado-contador {
  font-size: 0.8rem;
  color: var(--text-subtle);
  white-space: nowrap;
}

/* === ESTADO: CARGANDO ====================================== */
.listado-loading {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 4rem 0;
}

.listado-loading[hidden] {
  display: none;
}

.loading-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
  animation: dot-pulse 1.2s ease-in-out infinite;
}

.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1);    }
  50%       { opacity: 1;   transform: scale(1.25); }
}

/* === ESTADO: ERROR ========================================= */
.listado-error {
  text-align: center;
  padding: 4rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.listado-error[hidden] {
  display: none;
}

/* === GRID DE TARJETAS ====================================== */
.tarjetas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* === TARJETA =============================================== */
.tarjeta {
  z-index: 2;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.tarjeta:hover {
  border-color: rgba(107, 140, 255, 0.3);
  transform: translateY(-2px);
}

/* Cabecera de la tarjeta: avatar + nombre + categoría */
.tarjeta-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.tarjeta-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-dim);
  border: 1px solid rgba(107, 140, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  flex-shrink: 0;
  /* Las iniciales las inyecta JS */
}

.tarjeta-info {
  min-width: 0;
}

.tarjeta-nombre {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tarjeta-categoria {
  display: inline-flex;
  align-items: center;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(107, 140, 255, 0.18);
  border-radius: 4px;
  padding: 0.15rem 0.55rem;
  font-weight: 400;
}

/* === CALIFICACIÓN VISUAL =================================== */
.tarjeta-calificacion {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.estrellas {
  display: flex;
  gap: 2px;
}

/* Cada estrella es un span con clase .estrella-llena o .estrella-vacia */
.estrella {
  width: 14px;
  height: 14px;
  display: inline-block;
}

.estrella-llena {
  color: #f5c842;
}

.estrella-media {
  color: #f5c842;
  opacity: 0.5;
}

.estrella-vacia {
  color: rgba(255, 255, 255, 0.15);
}

.calificacion-numero {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
}

.calificacion-resenas {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

/* === ACCIONES ============================================== */
.tarjeta-acciones {
  display: flex;
  gap: 0.6rem;
  margin-top: auto;
  flex-wrap: wrap;
}

/* Botón primario chico — Ver detalle */
.tarjeta-btn-primary {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s ease;
  flex: 1;
  justify-content: center;
}

.tarjeta-btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

/* Botón ghost chico — Llamar / Ver más */
.tarjeta-btn-ghost {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--btn-border);
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tarjeta-btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--btn-border-h);
  background: var(--btn-ghost-bg-h);
}

select,
textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  width: 100%;
  outline: none;
  transition: border 0.15s ease, background 0.15s ease;
}


select:focus,
textarea:focus {
  border-color: rgba(107, 140, 255, 0.4);
  background: rgba(255, 255, 255, 0.02);
  background-color: rgba(8, 10, 16, 0.76);
}
.particle {
  z-index: 1;
  position: absolute;
  border-radius: 50%;
  animation-name: float;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes float {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-100vh); opacity: 0; }
}
/* === RESPONSIVE ============================================ */
@media (max-width: 600px) {
  #listado {
    padding: 2.5rem 1.25rem 3.5rem;
  }

  .tarjetas-grid {
    grid-template-columns: 1fr;
  }

  .listado-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (prefers-color-scheme: light) {
  .estrella-vacia {
    color: rgba(0, 0, 0, 0.15);
  }

  .tarjeta-btn-ghost {
    color: #111318;
    border-color: rgba(0, 0, 0, 0.2);
  }

  .tarjeta-btn-ghost:hover {
    color: #111318;
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.35);
  }

  select,
  textarea {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    color: #111318;
  }

  select:focus,
  textarea:focus {
    border-color: rgba(74, 108, 247, 0.4);
    background: #ffffff;
    background-color: #ffffff;
  }
  select {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #111318 !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
  }

  select:focus {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-color: rgba(74, 108, 247, 0.4) !important;
  }
}

/* === BURGER ================================================ */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px;
  z-index: 200;
}

.burger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Burger open state — X */
.burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile nav open */
.site-nav.open {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: var(--bg-header);
  padding: 1rem 1.25rem 2rem;
  border-bottom: 1px solid var(--border-card);
  z-index: 99;
  animation: nav-drop 0.2s ease;
}

.site-nav.open ul {
  flex-direction: column;
  gap: 0.25rem;
}

.site-nav.open a {
  font-size: 1rem;
  padding: 0.75rem 1rem;
}

@keyframes nav-drop {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .burger { display: flex; }
}