/* Tema publico: componentes construidos SOLO con los tokens del design system
   (resources/css/design-system/). Formas muy redondeadas, sombras verdosas,
   movimiento springy. */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--text-body);
  background: var(--surface-page);
}

h1, h2, h3, h4 {
  font-family: var(--heading-family);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  color: var(--text-strong);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-4);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--container-xl); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Botones: pill, verbo, springy ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--control-md); padding: 0 var(--space-6);
  border-radius: var(--radius-button); border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: var(--fw-bold); font-size: var(--text-md);
  transition: transform var(--dur-fast) var(--ease-bounce), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
  text-decoration: none !important;
}
.btn:hover { transform: translateY(-2px) scale(1.02); }
.btn:active { transform: scale(0.97); }
.btn-brand { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-brand); }
.btn-brand:hover { background: var(--brand-hover); box-shadow: var(--shadow-brand-lg); }
.btn-accent { background: var(--accent); color: var(--accent-fg); box-shadow: var(--shadow-accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-brand); border: 2px solid var(--border-brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-lg { height: var(--control-lg); font-size: var(--text-lg); padding: 0 var(--space-8); }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--surface-card); border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm); padding: var(--space-6);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-lg { border-radius: var(--radius-card-lg); padding: var(--space-8); }

/* Empresa destacada por pack: borde y sello ambar */
.card-featured { border: 2px solid var(--accent); position: relative; }
.badge-featured {
  position: absolute; top: calc(var(--space-3) * -1); right: var(--space-5);
  background: var(--accent); color: var(--accent-fg);
  border-radius: var(--radius-pill); padding: var(--space-1) var(--space-4);
  font-size: var(--text-xs); font-weight: var(--fw-extrabold);
  box-shadow: var(--shadow-accent);
}

/* ---------- Chips y etiquetas ---------- */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-1);
  border-radius: var(--radius-chip); padding: var(--space-1) var(--space-4);
  background: var(--brand-soft); color: var(--text-brand);
  font-size: var(--text-sm); font-weight: var(--fw-bold); text-decoration: none !important;
  transition: transform var(--dur-fast) var(--ease-bounce), background var(--dur-fast) var(--ease-out);
}
.chip:hover { background: var(--brand-soft-2); transform: scale(1.05); }

.price {
  font-family: var(--font-mono); font-weight: var(--fw-bold);
  color: var(--text-brand); font-size: var(--text-lg); white-space: nowrap;
}

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); }
.field label { font-weight: var(--fw-bold); font-size: var(--text-sm); color: var(--text-strong); }
.field input, .field textarea, .field select {
  font-family: var(--font-body); font-size: var(--text-md); color: var(--text-strong);
  border: 2px solid var(--border-default); border-radius: var(--radius-control);
  padding: var(--space-3) var(--space-4); background: var(--surface-card);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--brand); box-shadow: var(--ring-focus);
}
.field .error { color: var(--danger-500); font-size: var(--text-sm); font-weight: var(--fw-bold); }

/* ---------- FAQ acordeon (details nativo: funciona sin JS y es indexable) ---------- */
.faq { border: 1.5px solid var(--border-subtle); border-radius: var(--radius-md); margin-bottom: var(--space-3); background: var(--surface-card); overflow: hidden; }
.faq summary {
  cursor: pointer; list-style: none; padding: var(--space-4) var(--space-5);
  font-weight: var(--fw-bold); color: var(--text-strong); display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--font-display); font-size: var(--text-xl); color: var(--text-brand); transition: transform var(--dur-base) var(--ease-bounce); }
.faq[open] summary::after { transform: rotate(45deg); }
.faq[open] { border-color: var(--border-brand); box-shadow: var(--shadow-sm); }
.faq .answer { padding: 0 var(--space-5) var(--space-5); color: var(--text-body); line-height: var(--leading-relaxed); }

/* ---------- Cabecera cristal (maqueta DirectorioLanding) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1.5px solid var(--border-subtle);
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); height: 64px; }
.logo { text-decoration: none !important; display: flex; align-items: center; gap: 10px; }
.logo-tile {
  width: 38px; height: 38px; border-radius: 13px; background: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-brand); color: #fff;
}
.logo-tile svg, .logo-tile i { width: 20px; height: 20px; }
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: -0.02em; color: var(--text-strong); }
.wordmark .hl { color: var(--green-600); }
.main-nav { display: flex; align-items: center; gap: var(--space-4); }
.main-nav a { color: var(--text-body); font-weight: var(--fw-semibold); }
.btn-sm { height: 40px; font-size: var(--text-sm); padding: 0 var(--space-5); }
/* El dot del footer conserva su estilo */
.logo .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--brand); display: inline-block; }

.site-footer { background: var(--surface-inverse); color: var(--neutral-300); margin-top: var(--space-24); padding: var(--space-16) 0 var(--space-8); }
.site-footer a { color: var(--neutral-200); }
.site-footer .legal { border-top: 1px solid var(--neutral-800); margin-top: var(--space-10); padding-top: var(--space-6); font-size: var(--text-sm); color: var(--neutral-500); }

/* ---------- Hero (maqueta: degradado + patron de puntos) ---------- */
.hero { position: relative; overflow: hidden; text-align: center;
  background: linear-gradient(180deg, var(--green-50), var(--surface-page)); }
.hero-dots {
  position: absolute; inset: 0; opacity: 0.5;
  background-image: radial-gradient(circle at 1px 1px, var(--green-200) 1px, transparent 0);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(180deg, black, transparent);
  mask-image: linear-gradient(180deg, black, transparent);
}
.hero-inner { position: relative; max-width: 1024px; padding: 76px var(--gutter) 56px; margin: 0 auto; }
.badge-brand {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-soft); color: var(--green-700);
  border-radius: var(--radius-pill); padding: 5px 14px;
  font-size: var(--text-sm); font-weight: var(--fw-bold);
}
.badge-brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.hero h1 {
  font-size: clamp(38px, 6vw, 64px); line-height: 1.02; letter-spacing: -0.02em;
  max-width: 720px; margin: 18px auto;
}
.hero h1 .hl { color: var(--green-600); }
.hero p { font-size: 19px; color: var(--text-body); font-weight: var(--fw-medium); max-width: 540px; margin: 0 auto 34px; line-height: 1.5; }
.hero .search {
  position: relative; display: flex; align-items: center; gap: var(--space-2);
  max-width: 720px; margin: 0 auto;
  background: var(--surface-card); border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  box-shadow: var(--shadow-lg); border: 2px solid var(--border-subtle);
}
.hero .search:focus-within { border-color: var(--brand); box-shadow: var(--ring-focus), var(--shadow-lg); }
.hero .search .search-ico { width: 20px; height: 20px; color: var(--text-muted); flex: none; }
.hero .search input { flex: 1; border: none; outline: none; font-size: var(--text-md); font-family: var(--font-body); padding: var(--space-3) var(--space-2); background: transparent; min-width: 0; }
.popular { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 20px; align-items: center; }
.popular .lbl { font-size: var(--text-sm); color: var(--text-muted); font-weight: var(--fw-bold); }

/* ---------- Rejillas ---------- */
.grid { display: grid; gap: var(--space-5); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

/* ---------- Ficha: fila de informacion ---------- */
.info-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; font-weight: var(--fw-semibold); }
.info-row .ico { width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--green-700); display: inline-flex; align-items: center; justify-content: center; flex: none; }

.hours-row { display: flex; justify-content: space-between; padding: var(--space-2) var(--space-1); border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm); font-weight: var(--fw-semibold); }
.hours-row.today { background: var(--brand-soft); border-radius: var(--radius-xs); font-weight: var(--fw-extrabold); color: var(--green-800); }
.hours-row .closed { color: var(--danger-500); }

/* ---------- Banda de conversion ---------- */
/* Tarjetas de categoria con baldosa de icono (maqueta) */
.grid-cat { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cat-card {
  background: var(--surface-card); border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-card); box-shadow: var(--shadow-sm);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
  align-items: flex-start; text-decoration: none !important;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-brand); }
.cat-ico {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--brand-soft); color: var(--green-700);
  display: inline-flex; align-items: center; justify-content: center;
}
.cat-ico svg, .cat-ico i { width: 26px; height: 26px; }
.cat-name { display: block; font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--text-strong); }
.cat-count { display: block; font-size: 13px; color: var(--text-muted); font-weight: var(--fw-semibold); }

/* Banda de conversion (maqueta: degradado + circulo decorativo) */
.cta-band {
  position: relative; overflow: hidden; color: var(--on-brand);
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  border-radius: var(--radius-3xl); padding: 52px 48px;
  margin: var(--space-14) 0 var(--space-16);
  box-shadow: var(--shadow-brand-lg);
}
.cta-circle { position: absolute; right: -40px; top: -40px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, 0.10); }
.cta-inner { position: relative; max-width: 560px; }
.cta-band h2 { color: #fff; font-size: 36px; line-height: 1.08; margin-bottom: 14px; }
.cta-band p { font-size: 18px; opacity: 0.95; margin-bottom: 28px; font-weight: var(--fw-medium); line-height: 1.5; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-size: var(--text-sm); color: var(--text-muted); padding: var(--space-5) 0; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { color: var(--text-subtle); }

@media (prefers-reduced-motion: reduce) {
  .btn, .chip, .card, .faq summary::after { transition: none !important; }
  .btn:hover, .chip:hover, .card-hover:hover { transform: none !important; }
}

@media (max-width: 720px) {
  .site-header .inner { height: 60px; }
  .main-nav a:not(.btn) { display: none; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .cta-band { padding: 36px 24px; }
  .cta-band h2 { font-size: 28px; }
}

/* ---------- Alta de empresa (onboarding): stepper, planes, preview ---------- */
/* Todo construido con los tokens del design system; sin valores de marca sueltos. */

.steps { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: 0 auto var(--space-8); }
.step { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-4) var(--space-1) var(--space-1); border-radius: var(--radius-pill); border: 1.5px solid var(--border-subtle); background: var(--surface-card); font-size: var(--text-sm); font-weight: var(--fw-bold); color: var(--text-muted); }
.step .step-dot { width: 28px; height: 28px; border-radius: var(--radius-pill); background: var(--surface-sunken); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: var(--text-xs); }
.step.current { border-color: var(--border-brand); background: var(--brand-soft); color: var(--green-700); }
.step.current .step-dot { background: var(--brand); color: var(--on-brand); }
.step.done { color: var(--green-700); }
.step.done .step-dot { background: var(--brand-soft-2); color: var(--green-700); }
.step .step-dot svg, .step .step-dot i { width: 14px; height: 14px; }
@media (max-width: 720px) { .step .step-label { display: none; } .step { padding-right: var(--space-1); } }

/* Tarjetas de eleccion de plan (alta con IA vs alta gratis) */
.plan-price { font-family: var(--font-mono); font-weight: var(--fw-bold); font-size: var(--text-3xl); color: var(--text-strong); }
.plan-price .from { display: block; font-family: var(--font-body); font-size: var(--text-sm); font-weight: var(--fw-bold); color: var(--text-muted); }
.check-list { list-style: none; padding: 0; margin: var(--space-4) 0; display: flex; flex-direction: column; gap: var(--space-2); }
.check-list li { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-sm); font-weight: var(--fw-semibold); }
.check-list li svg, .check-list li i { width: 18px; height: 18px; color: var(--green-600); flex: none; margin-top: 2px; }
.check-list li.muted { color: var(--text-muted); }
.check-list li.muted svg, .check-list li.muted i { color: var(--text-subtle); }

/* Avisos de estado */
.notice { border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); font-size: var(--text-sm); font-weight: var(--fw-semibold); margin-bottom: var(--space-4); }
.notice-ok { background: var(--brand-soft); color: var(--green-800); }
.notice-warn { background: var(--amber-50); color: var(--amber-700); }
.notice-error { background: var(--danger-50); color: var(--danger-700); }
.notice-info { background: var(--info-50); color: var(--info-700); }

/* Vista previa protegida del alta con IA. La proteccion real es de servidor
   (el contenido completo nunca llega al navegador antes del pago); esto es
   disuasion visual adicional: marca de agua + user-select none. */
.preview-protected { position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; }
.preview-watermark { position: absolute; inset: -10%; z-index: 1; pointer-events: none; display: flex; flex-wrap: wrap; gap: var(--space-10) var(--space-12); align-content: space-between; justify-content: center; transform: rotate(-18deg); opacity: 0.08; font-family: var(--font-mono); font-weight: var(--fw-bold); color: var(--neutral-900); white-space: nowrap; }
.locked-bar { display: inline-block; height: 10px; border-radius: var(--radius-pill); background: var(--surface-sunken); vertical-align: middle; }
.lock-chip { display: inline-flex; align-items: center; gap: var(--space-1); border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--text-muted); padding: var(--space-1) var(--space-3); font-size: var(--text-xs); font-weight: var(--fw-bold); }
.lock-chip svg, .lock-chip i { width: 12px; height: 12px; }

/* Desglose de extras y total del alta con IA */
.extra-row { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm); font-weight: var(--fw-semibold); }
.extra-row .price { font-size: var(--text-md); margin-left: auto; }
.extra-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); margin-top: 2px; flex: none; }
.total-row { display: flex; justify-content: space-between; align-items: center; padding-top: var(--space-4); font-size: var(--text-lg); font-weight: var(--fw-extrabold); color: var(--text-strong); }

/* Spinner del trabajo de IA en curso */
.spinner { width: 44px; height: 44px; border-radius: var(--radius-pill); border: 4px solid var(--brand-soft-2); border-top-color: var(--brand); margin: 0 auto var(--space-4); animation: onboarding-spin 0.9s linear infinite; }
@keyframes onboarding-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.5s; } }

/* Chips seleccionables (categorias del formulario manual) */
.chip-select { cursor: pointer; position: relative; }
.chip-select input { position: absolute; opacity: 0; pointer-events: none; }
.chip-select:has(input:checked) { background: var(--brand); color: var(--on-brand); }

/* Repetidor de productos y servicios del formulario manual */
.listing-item { border: 1.5px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-5); margin-bottom: var(--space-4); background: var(--surface-card); }
.listing-item .head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }

/* Contenido largo de paginas y posts */
.prose { line-height: var(--leading-relaxed); }
.prose h2 { margin-top: var(--space-8); }
.prose h3 { margin-top: var(--space-6); }
.prose img { max-width: 100%; border-radius: var(--radius-lg); }
.prose ul, .prose ol { padding-left: var(--space-6); }
