/**
 * Fijate Tools - Auditor legal y checklist de e-commerce en España
 * Estilos canónicos, dashboard de scoring, tarjetas interactivas, modales y print
 */

:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta cromática corporativa y de cumplimiento */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Semáforos de riesgo legal */
  --color-safe: #10b981;
  --color-safe-bg: #ecfdf5;
  --color-safe-border: #a7f3d0;

  --color-medium: #3b82f6;
  --color-medium-bg: #eff6ff;
  --color-medium-border: #bfdbfe;

  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;

  --color-danger: #ef4444;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;

  --primary-accent: #2563eb;
  --primary-hover: #1d4ed8;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  --bg-page: #0b0f17;
  --bg-card: #151d2c;
  --bg-card-subtle: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --border-light: #1e293b;

  --color-safe: #34d399;
  --color-safe-bg: rgba(16, 185, 129, 0.15);
  --color-safe-border: rgba(16, 185, 129, 0.3);

  --color-medium: #60a5fa;
  --color-medium-bg: rgba(59, 130, 246, 0.15);
  --color-medium-border: rgba(59, 130, 246, 0.3);

  --color-warning: #fbbf24;
  --color-warning-bg: rgba(245, 158, 11, 0.15);
  --color-warning-border: rgba(245, 158, 11, 0.3);

  --color-danger: #f87171;
  --color-danger-bg: rgba(239, 68, 68, 0.15);
  --color-danger-border: rgba(239, 68, 68, 0.3);

  --primary-accent: #3b82f6;
  --primary-hover: #60a5fa;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-title,
.hero-title,
.kpi-label,
.section-heading-title {
  font-family: var(--font-heading);
}

.mono,
code,
.kpi-number,
.score-value {
  font-family: var(--font-mono);
}

/* Layout canónico */
.tool-layout {
  max-width: 1240px;
  margin: 1.5rem auto 3.5rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Hero & barra de configuración superior */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-badge-legal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-accent);
  background: var(--color-medium-bg);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--color-medium-border);
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0.35rem 0 0.5rem;
  line-height: 1.2;
  color: var(--text-main);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.hero-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.preset-selector-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 320px;
}

.preset-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.preset-select {
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.6rem 2.5rem 0.6rem 0.9rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.preset-select:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 2px var(--color-medium-border);
}

.preset-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
  padding: 0.5rem;
}

.hero-action-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Botones estándar */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary-accent);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.825rem;
  min-height: 34px;
}

/* Dashboard de KPIs y Score */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.kpi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.kpi-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.kpi-main-stat {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.kpi-number {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
}

.kpi-unit {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.badge-risk {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-safe {
  color: var(--color-safe);
  background: var(--color-safe-bg);
  border-color: var(--color-safe-border);
}

.status-medium {
  color: var(--color-medium);
  background: var(--color-medium-bg);
  border-color: var(--color-medium-border);
}

.status-warning {
  color: var(--color-warning);
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
}

.status-danger {
  color: var(--color-danger);
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
}

.kpi-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.score-bar-track {
  width: 100%;
  height: 8px;
  background-color: var(--border-light);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.score-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease, background-color 0.4s ease;
}

.score-bar-fill.status-safe {
  background-color: var(--color-safe);
}

.score-bar-fill.status-medium {
  background-color: var(--color-medium);
}

.score-bar-fill.status-warning {
  background-color: var(--color-warning);
}

.score-bar-fill.status-danger {
  background-color: var(--color-danger);
}

/* Barras de desglose por área */
.breakdown-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.breakdown-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

.category-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem 1.5rem;
}

.cat-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cat-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.cat-bar-title {
  font-weight: 600;
  color: var(--text-main);
}

.cat-bar-pct {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cat-bar-track {
  width: 100%;
  height: 7px;
  background-color: var(--border-light);
  border-radius: 9999px;
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.cat-bar-fill.bar-safe {
  background-color: var(--color-safe);
}

.cat-bar-fill.bar-warning {
  background-color: var(--color-warning);
}

.cat-bar-fill.bar-danger {
  background-color: var(--color-danger);
}

/* Pestañas de categorías */
.category-tabs-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-height: 42px;
}

.category-tab:hover {
  color: var(--text-main);
  border-color: var(--primary-accent);
}

.category-tab.active {
  background: var(--primary-accent);
  color: #ffffff;
  border-color: var(--primary-accent);
}

.tab-icon {
  display: flex;
  align-items: center;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: var(--border-light);
  color: var(--text-muted);
}

.category-tab.active .tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Tarjetas de preguntas */
.questions-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.question-card.answered {
  border-left: 4px solid var(--primary-accent);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.question-cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.question-law-ref {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.question-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--text-main);
  line-height: 1.35;
}

.question-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.question-options-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.option-pill {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.option-pill:hover {
  border-color: var(--primary-accent);
  background: var(--bg-card);
}

.option-pill.selected {
  border-color: var(--primary-accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 2px var(--color-medium-border);
}

.option-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.opt-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s ease;
}

.option-pill.selected .opt-indicator {
  border-color: var(--primary-accent);
  background-color: var(--primary-accent);
}

.option-pill.selected .opt-indicator::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

.opt-text {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.4;
}

/* Sección del plan de acción */
.action-plan-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.action-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-heading-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
  color: var(--text-main);
}

.section-heading-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

.filter-pills-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 0.5rem 1rem;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  min-height: 40px;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  color: var(--text-main);
  border-color: var(--primary-accent);
}

.filter-pill.active {
  background: var(--text-main);
  color: var(--bg-card);
  border-color: var(--text-main);
}

.action-plan-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.plan-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.35rem;
  background: var(--bg-card-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.plan-card.plan-critical {
  border-color: var(--color-danger-border);
  background: var(--color-danger-bg);
}

.plan-card.plan-passed {
  border-color: var(--color-safe-border);
  background: var(--color-safe-bg);
}

.plan-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.plan-cat-name {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.plan-fine-tag {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.plan-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.plan-situation {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.plan-fine-desc {
  font-size: 0.9rem;
  color: var(--text-main);
  background: var(--bg-card);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px dashed var(--border-color);
  margin: 0;
}

.plan-action-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.85rem;
}

.action-icon {
  color: var(--primary-accent);
  display: flex;
  margin-top: 0.15rem;
}

.action-text strong {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--primary-accent);
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.action-text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.45;
}

.plan-template-cta {
  padding-top: 0.5rem;
}

.badge-status-ok {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-safe);
  background: var(--color-safe-bg);
  border: 1px solid var(--color-safe-border);
}

.plan-desc-ok {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.empty-plan {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.empty-plan.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-safe);
}

.empty-plan.success p {
  color: var(--text-main);
  max-width: 500px;
}

/* Modales */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  max-width: 680px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.btn-close-modal:hover {
  color: var(--text-main);
  background: var(--border-light);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.template-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  line-height: 1.45;
}

.template-code-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 380px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
}

/* Toast */
.app-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 1100;
  pointer-events: none;
}

.app-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Guía didáctica / SEO */
.seo-guide-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.25rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-sm);
}

.seo-guide-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 1rem;
  color: var(--text-main);
}

.seo-guide-section p {
  font-size: 1rem;
  color: var(--text-main);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.seo-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 1.75rem 0;
}

.seo-guide-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.4rem;
}

.seo-guide-box h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text-main);
}

.seo-guide-box p {
  font-size: 0.925rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

/* Acordeón de preguntas frecuentes */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card-subtle);
  overflow: hidden;
}

.faq-summary {
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-accent);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-summary::after {
  content: '−';
}

.faq-content {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-card {
    padding: 1.25rem;
  }

  .hero-title {
    font-size: 1.45rem;
  }

  .hero-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .preset-selector-box {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-action-buttons {
    width: 100%;
  }

  .hero-action-buttons .btn {
    flex: 1;
    min-height: 40px;
  }

  .btn-sm {
    min-height: 40px;
  }

  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }

  .action-plan-section {
    padding: 1.25rem;
  }
}

/* Estilos de impresión oficial A4 */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-header,
  .fijate-footer,
  .tool-ad-sidebar,
  .tools-ad-banner-section,
  .hero-controls,
  .category-tabs-nav,
  .filter-pills-nav,
  .hero-action-buttons,
  .modal-overlay,
  .plan-template-cta,
  #preset-selector,
  .related-tools-section,
  .affiliate-showcase-section,
  .seo-guide-section {
    display: none !important;
  }

  .tool-layout {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .tool-with-sidebar {
    display: block !important;
  }

  .hero-card,
  .kpi-card,
  .breakdown-card,
  .action-plan-section,
  .plan-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    background: #ffffff !important;
    page-break-inside: avoid;
  }

  .plan-card.plan-critical {
    border-left: 4px solid #ef4444 !important;
  }
}