/* ==========================================================================
   Sanitio Widgets · base compartida
   Todo cuelga de la clase raíz .snw que pone la clase base en cada widget:
   nada aquí toca body, etiquetas desnudas ni el tema del cliente.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens (origen: css/tokens.css del proyecto, copiado de las variables de Figma,
   con la consolidación aprobada en la Fase 1)
   -------------------------------------------------------------------------- */
:root {
  /* Marca */
  --snw-color-brand-primary: #28353c;
  --snw-color-brand-accent: #009cd3;
  --snw-color-brand-accent-dark: #00759a;

  /* Texto */
  --snw-color-text-foreground: #202b30;
  --snw-color-text-muted: #465258;
  --snw-color-text-on-dark: #fcfcfc;
  --snw-color-text-on-dark-muted: #b7c4cb;

  /* Superficies */
  --snw-surface-background: #ffffff;
  --snw-surface-subtle: #f7fbfd;
  --snw-surface-secondary: #eaf4f8;
  --snw-surface-alt: #ebf5fa;

  /* Bordes */
  --snw-border-default: #dde6eb;
  --snw-border-hover: rgba(40, 53, 60, 0.3);

  /* Sobre fondo oscuro (consolidado: 3 rellenos y 3 bordes) */
  --snw-on-dark-fill: rgba(255, 255, 255, 0.06);
  --snw-on-dark-fill-hover: rgba(255, 255, 255, 0.12);
  --snw-on-dark-fill-active: rgba(255, 255, 255, 0.16);
  --snw-on-dark-border: rgba(255, 255, 255, 0.15);
  --snw-on-dark-border-strong: rgba(255, 255, 255, 0.25);
  --snw-on-dark-border-hover: rgba(255, 255, 255, 0.4);

  /* Degradados (consolidado: uno para los heros y otro para los fondos oscuros) */
  --snw-gradient-hero: linear-gradient(147.43deg, #1a262c 0%, #213c49 41.667%, var(--snw-color-brand-accent-dark) 83.333%);
  --snw-gradient-dark: linear-gradient(to bottom, #233037, #121c22);

  /* Sombras */
  --snw-shadow-card: 0 8px 24px rgba(40, 53, 60, 0.06);
  --snw-shadow-card-hover: 0 24px 60px -28px rgba(40, 53, 60, 0.35);
  --snw-shadow-step-hover: 0 12px 30px -18px rgba(40, 53, 60, 0.25);
  --snw-shadow-float: 0 24px 60px -24px rgba(40, 53, 60, 0.35);
  --snw-shadow-media: 0 24px 24px rgba(18, 28, 33, 0.35);
  --snw-shadow-enroll: 0 24px 48px rgba(18, 28, 33, 0.35);
  --snw-focus-ring: 0 0 0 3px rgba(0, 156, 211, 0.35);

  /* Radios */
  --snw-radius-sm: 8px;
  --snw-radius-md: 14px;
  --snw-radius-lg: 24px;
  --snw-radius-pill: 999px;

  /* Espaciado */
  --snw-space-8: 8px;
  --snw-space-12: 12px;
  --snw-space-16: 16px;
  --snw-space-24: 24px;
  --snw-space-32: 32px;
  --snw-space-48: 48px;
  --snw-space-64: 64px;
  --snw-space-80: 80px;
  --snw-space-120: 120px;

  /* Tipografía: los nombres deben coincidir con los de Elementor → Custom Fonts */
  --snw-font-heading: "Jost", system-ui, sans-serif;
  --snw-font-body: "Mulish", system-ui, sans-serif;

  /* Movimiento */
  --snw-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --snw-duration: 150ms;
  --snw-duration-image: 700ms;
  --snw-duration-accordion: 300ms;

  /* Contenedor */
  --snw-content-width: 1200px;
  --snw-gutter-min: 24px;

  /* Hueco que dejan las anclas para la cabecera fija (origen: curso.css, scroll-margin-top) */
  --snw-anchor-offset: 112px;
}

/* --------------------------------------------------------------------------
   Fuente base por widget.
   ¡OJO! AÑADE AQUÍ LA CLASE RAÍZ DE CADA WIDGET NUEVO (.snw-{slug}).
   Si falta, el widget hereda la fuente del tema o el serif del navegador.
   -------------------------------------------------------------------------- */
.snw-hero,
.snw-catalogo,
.snw-tarjetas-icono,
.snw-header,
.snw-footer,
.snw-pasos,
.snw-curso-hero,
.snw-curso-tabs,
.snw-curso-descripcion,
.snw-curso-incluye,
.snw-curso-temario,
.snw-curso-profesorado,
.snw-curso-acreditacion,
.snw-curso-info,
.snw-curso-tarifas,
.snw-aviso,
.snw-curso-ayuda {
  font-family: var(--snw-font-body);
  font-size: 16px;
  line-height: 24px;
  color: var(--snw-color-text-foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Reinicio acotado a los widgets
   -------------------------------------------------------------------------- */
.snw,
.snw *,
.snw *::before,
.snw *::after {
  box-sizing: border-box;
}

.snw :is(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure) {
  margin: 0;
}

.snw :is(ul, ol) {
  padding: 0;
  list-style: none;
}

/* Más específico que los estilos de enlace del kit de Elementor (.elementor-kit-N a) */
.elementor-element .snw a,
.elementor-element .snw a:hover {
  color: inherit;
  text-decoration: none;
}

.snw img {
  display: block;
  max-width: 100%;
  height: auto;
}

.snw :focus-visible {
  outline: none;
  box-shadow: var(--snw-focus-ring);
}

.snw .snw-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Contenedor: 1200px de contenido con 120px de margen a 1440px */
.snw .snw-container {
  padding-inline: max(var(--snw-gutter-min), calc((100% - var(--snw-content-width)) / 2));
}

/* --------------------------------------------------------------------------
   Tipografía (estilos de texto de Figma)
   Los titulares llevan clase propia, así ganan a los estilos globales del kit.
   -------------------------------------------------------------------------- */
.snw .snw-t-display,
.snw .snw-t-h1,
.snw .snw-t-h2,
.snw .snw-t-h3,
.snw .snw-t-h4 {
  font-family: var(--snw-font-heading);
  font-weight: 700;
  color: var(--snw-color-brand-primary);
  text-transform: none;
}

.snw .snw-t-display {
  font-size: 60px;
  line-height: 64px;
  letter-spacing: -1.5px;
}

.snw .snw-t-h1 {
  font-size: 48px;
  line-height: 52px;
  letter-spacing: -1px;
}

.snw .snw-t-h2 {
  font-size: 40px;
  line-height: 46px;
  letter-spacing: -0.8px;
}

.snw .snw-t-h3 {
  font-size: 24px;
  line-height: 30px;
  letter-spacing: -0.48px;
}

.snw .snw-t-h4 {
  font-weight: 600;
  font-size: 20px;
  line-height: 26px;
  letter-spacing: -0.2px;
}

.snw .snw-t-body-lg {
  font-size: 18px;
  line-height: 28px;
  color: var(--snw-color-text-muted);
}

.snw .snw-t-body {
  font-size: 16px;
  line-height: 24px;
}

.snw .snw-t-body-sm {
  font-size: 14px;
  line-height: 20px;
  color: var(--snw-color-text-muted);
}

.snw .snw-t-caption {
  font-size: 12px;
  line-height: 16px;
}

.snw .snw-t-eyebrow {
  font-family: var(--snw-font-body);
  font-weight: 600;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 2.64px;
  text-transform: uppercase;
  color: var(--snw-color-brand-accent);
}

/* --------------------------------------------------------------------------
   Cabecera de sección (eyebrow + titular + entradilla)
   -------------------------------------------------------------------------- */
.snw .snw-section-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.snw .snw-section-header--center {
  align-items: center;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

/* Ficha de curso: cabecera con 8px entre antetítulo y titular */
.snw .snw-section-header--compact {
  gap: 8px;
}

/* Sección de la columna principal de la ficha (Descripción, Temario…) */
.snw .snw-course-section {
  display: flex;
  flex-direction: column;
  gap: var(--snw-space-24);
}

/* Las anclas no quedan tapadas por la cabecera fija */
.snw[id] {
  scroll-margin-top: var(--snw-anchor-offset);
}

/* Tarjeta de la barra lateral (Información clave, Tarifas) */
.snw .snw-side-card {
  display: flex;
  flex-direction: column;
  gap: var(--snw-space-8);
  padding: var(--snw-space-24);
  border: 1px solid var(--snw-border-default);
  border-radius: var(--snw-radius-lg);
  background: var(--snw-surface-background);
}

/* --------------------------------------------------------------------------
   Botón · variantes: primary, accent, secondary, on-dark
   Hover (como sanitio.com): los rellenos se iluminan y la flecha se separa
   -------------------------------------------------------------------------- */
.snw .snw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: 0;
  border-radius: var(--snw-radius-pill);
  font-family: var(--snw-font-body);
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--snw-duration) var(--snw-ease),
    border-color var(--snw-duration) var(--snw-ease),
    filter var(--snw-duration) var(--snw-ease),
    box-shadow var(--snw-duration) var(--snw-ease),
    transform var(--snw-duration) var(--snw-ease);
}

.snw .snw-btn__icon {
  flex-shrink: 0;
  transition: transform var(--snw-duration) var(--snw-ease);
}

.snw .snw-btn:hover .snw-btn__icon {
  transform: translateX(2px);
}

.snw .snw-btn:active {
  transform: scale(0.98);
}

/* Se repite :hover en el selector para ganar a ".elementor-element .snw a:hover" */
.elementor-element .snw .snw-btn--primary,
.elementor-element .snw .snw-btn--primary:hover {
  background: var(--snw-color-brand-primary);
  color: var(--snw-color-text-on-dark);
}

.elementor-element .snw .snw-btn--accent,
.elementor-element .snw .snw-btn--accent:hover {
  background: var(--snw-color-brand-accent);
  color: var(--snw-color-text-on-dark);
}

.snw .snw-btn--primary:hover,
.snw .snw-btn--accent:hover {
  filter: brightness(1.1);
}

.snw .snw-btn--primary:active,
.snw .snw-btn--accent:active {
  filter: brightness(0.95);
}

.elementor-element .snw .snw-btn--secondary {
  background: var(--snw-surface-background);
  border: 1px solid var(--snw-border-default);
  color: var(--snw-color-brand-primary);
}

.elementor-element .snw .snw-btn--secondary:hover {
  background: var(--snw-surface-subtle);
  border-color: var(--snw-border-hover);
  color: var(--snw-color-brand-primary);
}

.snw .snw-btn--block {
  width: 100%;
}

.elementor-element .snw .snw-btn--on-dark {
  background: var(--snw-on-dark-fill);
  border: 1px solid var(--snw-on-dark-border-strong);
  color: var(--snw-color-text-on-dark);
}

.elementor-element .snw .snw-btn--on-dark:hover {
  background: var(--snw-on-dark-fill-hover);
  border-color: var(--snw-on-dark-border-hover);
  color: var(--snw-color-text-on-dark);
}

.elementor-element .snw .snw-btn--on-dark:active {
  background: var(--snw-on-dark-fill-active);
}

/* --------------------------------------------------------------------------
   Etiqueta (tag)
   -------------------------------------------------------------------------- */
.snw .snw-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--snw-radius-pill);
  font-weight: 800;
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.88px;
  text-transform: uppercase;
  white-space: nowrap;
}

.snw .snw-tag--light {
  background: var(--snw-surface-background);
  color: var(--snw-color-brand-primary);
}

.snw .snw-tag--accent {
  background: var(--snw-color-brand-accent);
  color: var(--snw-color-text-on-dark);
}

/* --------------------------------------------------------------------------
   Logo (cabecera y pie)
   -------------------------------------------------------------------------- */
.snw .snw-logo {
  display: inline-flex;
  flex-shrink: 0;
  border-radius: var(--snw-radius-sm);
  transition: opacity var(--snw-duration) var(--snw-ease);
}

.snw .snw-logo:hover {
  opacity: 0.85;
}

.snw .snw-logo__img {
  width: 139px;
  height: 48px;
  object-fit: contain;
}

/* Como en el original, afecta a los dos logos (cabecera y pie) */
@media (max-width: 420px) {
  .snw .snw-logo__img {
    width: 116px;
    height: 40px;
  }
}

/* --------------------------------------------------------------------------
   Aviso visible solo en el editor
   -------------------------------------------------------------------------- */
.snw .snw-editor-notice {
  margin: 8px 0;
  padding: 10px 14px;
  border: 1px dashed var(--snw-color-brand-accent);
  border-radius: var(--snw-radius-sm);
  background: var(--snw-surface-secondary);
  font-family: system-ui, sans-serif;
  font-size: 13px;
  line-height: 18px;
  color: var(--snw-color-brand-primary);
}

/* --------------------------------------------------------------------------
   Responsive (breakpoints del diseño: 1240 · 1024 · 720 · 420)
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .snw .snw-t-display {
    font-size: 40px;
    line-height: 44px;
    letter-spacing: -1px;
  }

  .snw .snw-t-h1 {
    font-size: 34px;
    line-height: 40px;
    letter-spacing: -0.7px;
  }

  .snw .snw-t-h2 {
    font-size: 32px;
    line-height: 38px;
    letter-spacing: -0.64px;
  }

  /* Los saltos de línea de Figma solo tienen sentido a ancho de escritorio */
  .snw .snw-section-header br {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .snw *,
  .snw *::before,
  .snw *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
