/* ==========================================================================
   Componentes · mismos nombres que en el diseño
   ========================================================================== */

/* --- c-btn ---------------------------------------------------------------- */
.c-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: var(--control-h);
  padding: 0 28px;
  border: 2px solid transparent;
  border-radius: var(--radius-control);
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
}
.c-btn--primary { background: var(--bg-cta); color: var(--text-on-cta); }
.c-btn--primary:hover { background: var(--bg-cta-hover); color: var(--text-on-cta); }

.c-btn--secondary { background: var(--color-white); border-color: var(--border-strong); color: var(--text-primary); }
.c-btn--secondary:hover { background: var(--color-navy-900); color: var(--text-on-dark); }

.c-btn--quiet {
  min-height: var(--control-h-sm);
  padding: 0 20px;
  font-size: var(--fs-body-sm);
  background: var(--color-white);
  border: 1px solid var(--border-input);
  color: var(--text-primary);
}
.c-btn--quiet:hover { background: var(--bg-alt); color: var(--text-primary); }

.c-btn--sm { min-height: var(--control-h-sm); padding: 0 24px; font-size: var(--fs-body-sm); }
.c-btn--block { width: 100%; }

.c-btn:disabled,
.c-btn[aria-disabled="true"] {
  background: var(--color-neutral-200);
  border-color: var(--color-neutral-200);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* --- c-icon-btn ------------------------------------------------------------ */
.c-icon-btn {
  width: var(--tap-min);
  height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-control);
  background: var(--color-white);
  color: var(--text-primary);
  cursor: pointer;
}
.c-icon-btn:hover { background: var(--bg-alt); }

/* --- c-ph · dato pendiente [entre corchetes] ------------------------------- */
.c-ph {
  background: var(--bg-placeholder);
  border: 1px dashed var(--border-placeholder);
  border-radius: var(--radius-xs);
  padding: 0 6px;
  color: var(--text-primary);
  font-style: normal;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.s-dark .c-ph {
  background: var(--bg-placeholder-dark);
  border-color: var(--border-placeholder-dark);
  color: var(--text-on-dark);
}
a.c-ph { text-decoration: underline; }
.c-ph--logo {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  vertical-align: middle;
}

/* --- c-img-slot · hueco de foto (se sustituye por <img> con alt) ----------- */
.c-img-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 2px dashed var(--border-image-slot);
  border-radius: var(--radius-lg);
  background: var(--bg-info);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  line-height: 1.5;
  text-align: center;
}
.c-img-slot__title { font-weight: var(--fw-semibold); }

/* --- c-card ----------------------------------------------------------------- */
.c-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--color-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}
.c-card--featured { border: 2px solid var(--color-orange-500); box-shadow: var(--shadow-lg); }
@media (min-width: 1024px) { .c-card { padding: var(--space-4); } }

/* --- c-chip / c-pill / c-icon-badge ---------------------------------------- */
.c-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--tap-min);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--color-white);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-medium);
  line-height: 1.35;
}
.c-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-dark);
  color: var(--text-on-dark);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
}
.c-icon-badge {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--bg-icon);
  color: var(--text-primary);
}
.c-icon-badge--round { width: 40px; height: 40px; border-radius: var(--radius-full); }
.c-icon-badge--white { background: var(--color-white); }

/* --- c-header (sticky) ----------------------------------------------------- */
.c-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-white);
  transition: box-shadow var(--duration-base);
}
.c-header.is-scrolled { box-shadow: var(--shadow-md); }
.c-header__bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.c-header__nav { display: none; align-items: center; gap: var(--space-0-5); }
.c-header__toggle { display: inline-flex; border: 0; }
@media (min-width: 1024px) {
  .c-header__nav { display: flex; }
  .c-header__toggle { display: none; }
  .c-header__cta { margin-left: var(--space-2); }
}

.c-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-primary); }
.c-logo:hover { color: var(--text-primary); }
.c-logo__icon { width: 21px; height: 23px; }
.c-logo__smile { fill: var(--color-white); }
.c-logo__name { font-size: 18px; font-weight: var(--fw-bold); line-height: var(--lh-tight); letter-spacing: -0.01em; }
@media (min-width: 1024px) {
  .c-logo { gap: var(--space-1-5); }
  .c-logo__icon { width: 25px; height: 27px; }
  .c-logo__name { font-size: 24px; }
}
.s-dark .c-logo, .s-dark .c-logo:hover { color: var(--text-on-dark); }

.c-nav-link {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  text-decoration: none;
}
.c-nav-link:hover { background: var(--bg-alt); color: var(--text-primary); }
/* Menú de escritorio: enlaces secundarios en gris; --strong destaca el primero */
.c-header__nav .c-nav-link { font-weight: var(--fw-regular); color: var(--text-muted); }
.c-header__nav .c-nav-link:hover { color: var(--text-primary); }
.c-header__nav .c-nav-link--strong { font-weight: var(--fw-medium); color: var(--text-primary); }

/* --- c-mobile-menu -------------------------------------------------------- */
.c-mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-0-5);
  padding: var(--space-1) var(--grid-margin) var(--space-3);
  background: var(--color-white);
  border-bottom: 1px solid var(--border-default);
  box-shadow: var(--shadow-md);
}
.c-mobile-menu[hidden] { display: none; }
.c-mobile-menu .c-nav-link {
  min-height: var(--control-h);
  padding: 0 var(--space-0-5);
  border-bottom: 1px solid var(--border-default);
  border-radius: 0;
  font-size: var(--fs-body);
}
.c-mobile-menu .c-btn { margin-top: var(--space-2); }
.c-menu-veil {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(16, 18, 34, 0.4);
}
.c-menu-veil[hidden] { display: none; }
@media (min-width: 1024px) { .c-mobile-menu, .c-menu-veil { display: none !important; } }

/* --- c-float-cta · CTA flotante (móvil y tablet) -------------------------- */
.c-float-cta {
  position: fixed;
  right: var(--grid-margin);
  bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  z-index: 30; /* bajo el velo del menú (40) y la cabecera (50) */
  width: var(--control-h);
  height: var(--control-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg-cta);
  color: var(--text-on-cta);
  box-shadow: var(--shadow-lg);
  transition: background-color var(--duration-fast);
  animation: c-float-cta-in var(--duration-base) ease-out;
}
.c-float-cta:hover { background: var(--bg-cta-hover); color: var(--text-on-cta); }
/* Anillo doble: blanco pegado al botón + navy fuera, visible sobre claro y sobre oscuro */
.c-float-cta:focus-visible {
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: var(--focus-offset);
  box-shadow: 0 0 0 var(--focus-offset) var(--focus-ring-on-dark), var(--shadow-lg);
}
@keyframes c-float-cta-in {
  from { opacity: 0; transform: translateY(var(--space-2)); }
  to   { opacity: 1; transform: none; }
}
@media (min-width: 1024px) { .c-float-cta { display: none !important; } }

/* --- c-demo · mini interfaz del asistente --------------------------------- */
.c-demo {
  display: flex;
  flex-direction: column;
  gap: var(--space-1-5);
  padding: var(--space-2);
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.c-demo__label { font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--text-muted); }
.c-demo__ask {
  padding: var(--space-1-5) 14px;
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) var(--radius-xs);
  background: var(--bg-info);
  font-size: var(--fs-body-sm);
  line-height: 1.5;
}
.c-demo__list { display: flex; flex-direction: column; gap: var(--space-1); }
.c-demo__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--space-1-5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-medium);
}
.c-demo__row--flag { background: var(--bg-placeholder); border: 1px dashed var(--border-placeholder); }
.c-demo__row--flag .icon { color: var(--text-accent); }
.c-demo__skel { display: none; }
.c-demo__note { font-size: 12px; color: var(--text-muted); }
@media (min-width: 1024px) {
  .c-demo { padding: var(--space-3); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
  .c-demo__label { font-size: var(--fs-caption); }
  .c-demo__ask { font-size: 17px; padding: 14px var(--space-2); }
  .c-demo__row { padding: var(--space-1-5); border-radius: var(--radius-md); }
  .c-demo__row--list { flex-wrap: wrap; }
  .c-demo__skel { display: flex; flex-direction: column; gap: 6px; flex-basis: 100%; padding-left: 30px; }
  .c-demo__skel span { height: 8px; border-radius: var(--radius-xs); background: var(--color-neutral-200); }
  .c-demo__note { font-size: var(--fs-micro); }
}

/* --- c-chart · gráfico de barras estático (ejemplo visual) --------------- */
.c-chart {
  width: 100%;
  padding: var(--space-2);
  border-radius: var(--radius-control);
  background: var(--bg-chart);
}
.c-chart__svg { width: 100%; height: auto; overflow: visible; }
.c-chart__svg text { font-family: var(--font-family); }
.c-chart__title { font-size: 12px; fill: var(--text-chart-title); }
.c-chart__label { font-size: 8px; fill: var(--text-chart); }
.c-chart__axis line { stroke: var(--border-chart); stroke-width: 0.6; }
.c-chart__bars rect { fill: var(--bg-chart-bar); }

/* --- c-acc · acordeón FAQ ------------------------------------------------- */
.c-acc { border-bottom: 1px solid var(--border-default); }
.c-acc__heading { font-size: inherit; font-weight: inherit; }
.c-acc__trigger {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  line-height: 1.4;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.c-acc__trigger:hover { color: var(--text-accent); }
.c-acc__icon { transition: transform var(--duration-base); }
.c-acc__trigger[aria-expanded="true"] .c-acc__icon { transform: rotate(180deg); }
.c-acc__panel { padding: 0 40px var(--space-3) 0; color: var(--text-secondary); }
.c-acc__panel[hidden] { display: none; }
.c-acc__panel p + p { margin-top: var(--space-1-5); }
@media (min-width: 1024px) {
  .c-acc__trigger { min-height: 72px; padding: 20px 0; font-size: var(--fs-body-lg); }
  .c-acc__panel { padding-right: var(--space-8); }
}

/* --- c-field / c-input ---------------------------------------------------- */
.c-field { display: flex; flex-direction: column; gap: var(--space-1); }
.c-label { font-size: var(--fs-body-sm); font-weight: var(--fw-semibold); color: var(--text-primary); }
.c-label__req { margin-left: var(--space-0-5); color: var(--text-accent); }
.c-help { font-size: var(--fs-caption); line-height: 1.45; color: var(--text-muted); }

.c-input {
  width: 100%;
  min-height: var(--control-h);
  padding: 14px var(--space-2);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-control);
  background: var(--color-white);
  font-size: var(--fs-body);
  line-height: 1.4;
  color: var(--text-primary);
}
.c-input::placeholder { color: var(--text-muted); opacity: 1; }
.c-input:hover { border-color: var(--border-strong); }
.c-input:focus { outline: var(--focus-width) solid var(--focus-ring); outline-offset: 2px; border-color: var(--border-strong); }
.c-input[aria-invalid="true"], .c-input--error { border: 2px solid var(--border-error); }
textarea.c-input { min-height: 128px; resize: vertical; }

.c-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-1-5);
  min-height: var(--tap-min);
  font-size: var(--fs-body-sm);
  line-height: 1.5;
  cursor: pointer;
}
.c-check input { width: 24px; height: 24px; margin: 0; flex-shrink: 0; accent-color: var(--color-navy-900); }
.c-check input[aria-invalid="true"] { outline: 2px solid var(--border-error); outline-offset: 1px; }

.c-error-msg {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  line-height: 1.45;
  color: var(--text-error);
}
.c-error-msg[hidden] { display: none; }

/* --- c-alert -------------------------------------------------------------- */
.c-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-1-5);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  font-size: var(--fs-body-sm);
  line-height: 1.5;
  color: var(--text-primary);
}
.c-alert[hidden] { display: none; }
.c-alert--error { background: var(--bg-error); border: 1px solid var(--border-error); }
.c-alert--error .icon { color: var(--text-error); }
.c-alert--success { background: var(--bg-success); border: 1px solid var(--border-success); }
.c-alert--success .icon { color: var(--text-success); }

/* --- c-step-num / c-price ------------------------------------------------- */
.c-step-num {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--bg-dark);
  color: var(--text-on-dark);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
}
@media (min-width: 1024px) { .c-step-num { width: 48px; height: 48px; font-size: var(--fs-body); } }

.c-price { font-size: var(--fs-price); font-weight: var(--fw-bold); line-height: var(--lh-tight); letter-spacing: -0.01em; }
.c-price__from { font-size: var(--fs-body-sm); font-weight: var(--fw-medium); color: var(--text-muted); }
.c-price__unit { font-size: var(--fs-body); font-weight: var(--fw-semibold); }
