.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
  text-decoration: none;
}

.btn:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
}

.btn-primary, .btn.primary {
  background: var(--ink) !important;
  color: var(--bg) !important;
  border-color: var(--ink) !important;
  font-weight: 600;
}

.btn-primary:hover, .btn.primary:hover {
  background: #000 !important;
  color: #fff !important;
}

.btn-accent, .btn.accent {
  background: var(--acid) !important;
  color: var(--bg) !important;
  border-color: var(--acid) !important;
  font-weight: 600;
}

.btn-accent:hover, .btn.accent:hover {
  background: #3b6318 !important;
}

.btn-outline, .btn.ghost {
  background: transparent !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}

.btn-outline:hover, .btn.ghost:hover {
  background: var(--surface-2) !important;
  border-color: var(--line-strong) !important;
}

/* tag / chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  line-height: 1;
}

.chip.acid, .chip.success {
  background: var(--acid-soft) !important;
  color: var(--acid) !important;
  border-color: transparent !important;
}

.chip.amber, .chip.warning {
  background: var(--amber-soft) !important;
  color: var(--amber) !important;
  border-color: transparent !important;
}

.chip.coral, .chip.danger {
  background: var(--coral-soft) !important;
  color: var(--coral) !important;
  border-color: transparent !important;
}

/* Tarjetas de Categoría */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.category-icon {
  width: 3.75rem;
  height: 3.75rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.category-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.25rem;
  transition: transform 0.3s ease;
}

.category-card:hover .category-icon img {
  transform: scale(1.1);
}

.category-card h3 {
  margin-bottom: 0.5rem;
}

.category-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.category-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--primary);
}

.category-link:hover {
  gap: 0.75rem;
}

/* Tarjetas de Listado / Comparativa (TOP Rankings) */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 3rem 0;
}

.ranking-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.ranking-card:hover {
  box-shadow: var(--shadow-xl);
  border-color: rgba(79, 70, 229, 0.25);
  transform: translateY(-2px);
}

/* Destacar la tarjeta TOP 1 con estilo dorado */
.ranking-card:has(.ranking-badge-gold) {
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: var(--glass-shadow), 0 8px 30px rgba(245, 158, 11, 0.04);
}

.ranking-card:has(.ranking-badge-gold):hover {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: var(--shadow-xl), 0 12px 35px rgba(245, 158, 11, 0.1);
}

.ranking-badge-top {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 0.6rem 1.75rem;
  border-bottom-right-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  z-index: 10;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.05);
}

.ranking-badge-gold {
  background: linear-gradient(135deg, #d97706 0%, #fbbf24 100%);
}

.ranking-card-main {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 2.5rem 2rem 2rem 2rem;
}

@media (max-width: 900px) {
  .ranking-card-main {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Imagen de la empresa */
.ranking-img-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 180px;
  background-color: var(--bg-tertiary);
}

.ranking-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Info del Negocio */
.ranking-info h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.verified-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background-color: #dcfce7;
  color: #15803d;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
}

.ranking-meta {
  display: flex;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.ranking-meta span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Desglose de Puntuaciones (Metros de Auditoría) */
.scores-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .scores-grid {
    grid-template-columns: 1fr;
  }
}

.score-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.score-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.score-track {
  width: 100%;
  height: 8px;
  background-color: rgba(228, 228, 231, 0.5);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.score-bar {
  height: 100%;
  background: var(--brand-gradient);
  border-radius: var(--radius-full);
  width: 0%; /* Animado con JS */
  transition: width 1.2s cubic-bezier(0.1, 0.8, 0.3, 1);
  box-shadow: 0 0 8px rgba(79, 70, 229, 0.2);
}

.score-bar-high {
  background: linear-gradient(90deg, #34d399, #10b981);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

.score-bar-mid {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

/* Nota Global (Círculo de Puntuación) */
.global-rating-wrapper {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.rating-circle {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  font-family: var(--font-heading);
  font-weight: 800;
  border: 2px solid rgba(79, 70, 229, 0.15);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.rating-circle.rating-top {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.1);
}

.rating-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.rating-stars {
  color: var(--warning);
  display: flex;
  gap: 0.15rem;
  margin-top: 0.25rem;
}

/* Acordeón de Detalles (Pros/Cons y Resumen) */
.ranking-details-trigger {
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  width: 100%;
  padding: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.ranking-details-trigger:hover {
  background-color: var(--primary-light);
  color: var(--primary-hover);
}

.ranking-details-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  border-top: 0px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.ranking-details-content.open {
  max-height: 1000px;
  border-top: 1px solid var(--border-color);
}

.details-inner {
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .details-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.details-block h4 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.details-pros-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.details-pros-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold;
}

.details-cons-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.details-cons-list li::before {
  content: "✗";
  position: absolute;
  left: 0;
  color: var(--danger);
  font-weight: bold;
}

/* Ficha del Especialista (E-E-A-T) */
.author-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin: 3rem 0;
  display: flex;
  gap: 2rem;
  align-items: center;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-normal);
}

.author-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(79, 70, 229, 0.15);
}

@media (max-width: 768px) {
  .author-card {
    flex-direction: column;
    text-align: center;
  }
}

.author-img {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 4px solid var(--primary-light);
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.15);
  flex-shrink: 0;
}

.author-info h3 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.author-role {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.author-bio {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 0;
  line-height: 1.7;
}

/* Formulario de Auditoría */
.audit-form-container {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow-xl), 0 10px 40px rgba(79, 70, 229, 0.04);
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.85rem 1.15rem;
  border: 1px solid rgba(228, 228, 231, 0.8);
  border-radius: var(--radius-md);
  background-color: rgba(248, 250, 252, 0.7);
  transition: var(--transition-fast);
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.form-input:focus {
  border-color: var(--primary);
  background-color: white;
  box-shadow: 0 0 0 4px var(--primary-glow);
  outline: none;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Preguntas Frecuentes (FAQ) */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  margin: 2rem auto;
}

.faq-item {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-normal);
}

.faq-item:hover {
  border-color: rgba(79, 70, 229, 0.2);
  box-shadow: var(--shadow-md);
}

.faq-question {
  width: 100%;
  padding: 1.35rem 1.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  background-color: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.faq-question::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--primary);
  transition: transform 0.25s ease;
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
  padding: 0 1.75rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  max-height: 250px;
  padding-bottom: 1.35rem;
}
