/* =====================================================
   BODY Y LAYOUT GENERAL
   - Hacemos que el body ocupe toda la altura
   - Permitimos que el footer quede siempre abajo
===================================================== */
:root {
  --primary: #980000;
  --prim_trsp: #980000c4;
  --secondary: #004586d2;
  --bg: #fff;
  --link: #0000FF;
  --black: #000;
  --muted: #f0f0f0;
  --border: #e0e0e0;
  --gray: #555;
  --shadow: rgba(0,0,0,0.15);
  --shadow-slow: rgba(0,0,0,0.08);
  --header-padding: 16px 32px;
  --breakpoint-md: 768px;
  --font-sans: 'Inter', Arial, sans-serif;
  --banner-bg: #171e27;
  --youtube-bg: #0f1318;
}

html,body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--black);
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Cuando el menú móvil está abierto, empujamos el HERO hacia abajo */
body.menu-open .hero {
  margin-top: 120px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.page-title-wrapper {
  width: 100%;
  line-height: 1.6;
  text-align: center;
}

/* Formato de texto general */
.general-text {
  max-width: 100%;
  font-size: 16px;
  line-height: 1.6;
  text-align: justify;
}

.general-text--italic {
  font-style: italic;
  opacity: 0.7;
}

/* Subtitulo */
.general-subtitle {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

/* Lista */
.ref-list {
  padding: 20px;
}

.ref-list li {
  margin-bottom: 1rem;
}

.ref-link {
  color: var(--link);
  text-decoration: underline;
}

/* Ocultar checkbox */
.score-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: absolute;
  opacity: 0;
}

/* ==============================
   Selector de idioma - general
============================== */
.lang-selector {
  position: static;
  display: flex;
  align-items: center;
}

/* Botón desplegable */
.lang-toggle {
  background-color: var(--muted);
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--black);
  text-transform: uppercase;
}

.lang-toggle.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--bg);
}

/* Opciones desplegables */
.lang-options {
  display: none;
  flex-direction: column;
  width: 120px;
  background-color: var(--bg);
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1000;
  border-top: 1px solid var(--border);
  box-shadow: 0 2px 6px var(--shadow);
}

.lang-options.active {
  display: flex;
}

.lang-options span {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  cursor: pointer;
}

.lang-options span.active {
  font-weight: bold;
  color: var(--primary);
}

.highlight {
  color: var(--primary);
  font-weight: 700;
}

/* ==============================
   Score Dutch - Resultados
============================== */
.score-dutch {
  width: 100%;
  margin-top: 40px;
}

.score-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  background: var(--bg);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.04);
  padding: 25px 0;
}

.score-block {
  padding: 10px 30px;
}

.score-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.4;
}

.score-item input {
  margin-top: 3px;
}

.score-item span {
  position: relative;
  padding-left: 32px;
  cursor: pointer;
  display: inline-block;
}

/* Cuadrado */
.score-item span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary);
  border-radius: 5px;
  background-color: var(--bg);
  transition: all 0.2s ease;
}

/* Marca de verificación */
.score-item input[type="checkbox"]:checked + span::after {
  content: "✓";
  position: absolute;
  left: 6px;
  top: 3px;
  color: var(--bg);
  font-size: 14px;
  font-weight: bold;
}

.score-item input[type="checkbox"]:checked + span::before {
  background-color: var(--primary);
}

/* Hover effect */
.score-item span:hover::before {
  box-shadow: 0 0 0 3px rgba(152, 0, 0, 0.15);
}

.score-item input:focus + span::before {
  outline: 2px solid rgba(152, 0, 0, 0.4);
}

.ldl-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ldl-input-group input {
  width: 120px;
  padding: 8px;
  font-size: 15px;
}

/* Cambio de unidades */
.unit-label {
  font-size: 14px;
}

.unit-toggle {
  position: relative;
  background: var(--primary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--bg);
  transition: all 0.3s ease;
}

/* Hover: agrandar y sombra */
.unit-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Tooltip oculto por defecto */
.unit-toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

/* Mostrar tooltip al hover */
.unit-toggle:hover::after {
  opacity: 1;
}

.score-submit {
  text-align: center;
}

.primary-btn {
  padding: 12px 32px;
  background-color: var(--primary);
  color: var(--bg);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
}


/* === Bloque resultado Dutch Score === */
.dutch-score-result {
  display: none;
  padding: 10px 24px;
  margin: 16px auto;
  width: 100%;
  max-width: 500px;
  background: var(--bg);
  border-radius: 14px;
  box-shadow: 0 8px 20px var(--shadow);
  box-sizing: border-box;
}

/* Título */
.dutch-score-result h2 {
  color: var(--primary);
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
}

/* Filas de resultado */
.dutch-score-result p {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  margin: 10px 0;
}

/* Etiquetas (Puntos totales / Resultado) */
.dutch-score-result strong {
  color: #333;
  font-weight: 600;
}

/* Valores */
#totalDutchPoints {
  font-weight: 700;
  font-size: 1.1rem;
}

/* Resultado final (Poco probable, Posible, etc) */
#finalDutchScore {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
}

/* Desplazamos el formulario hacia abajo */
#dutchScoreForm {
  transition: transform 0.5s ease;
}

#dutchScoreForm.result-visible {
  margin-bottom: 40px;
  transform: translateY(20px);
}

.reset-btn {
  margin-top: 20px;
  margin-left: auto;
  display: block;
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  background-color: var(--primary);
  color: var(--bg);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* ==============================
   Redes sociales - Contacto
============================== */
.social-links {
  display: flex;
  justify-content: center;
  gap: 90px;
  flex-wrap: wrap;
  margin-top: 30px;
}

/* Cada enlace como bloque para que el hover funcione */
.social-links a {
  display: inline-block;
}

/* Imagen circular y tamaño base */
.social-links img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: block;
  transition: transform 0.3s ease;
}

.member-photo {
  width: 150px;
  height: 150px;
  max-width: 100%;
  max-height: 150px;
  object-fit: cover;
  margin-bottom: 10px;
}

/* =====================================================
  Pag ¿Quienes somos?
===================================================== */
/* Contenedor de equipos */
.teams {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Cada bloque de equipo */
.team-block {
  flex: 1 1 400px;
  background-color: #f9f9f9;
  border-radius: 12px;
  padding: 20px;
  box-sizing: border-box;
}

/* Título y descripción del equipo */
.team-title {
  font-size: 18px;
  text-align: center;
  margin-bottom: 10px;
}

.team-description {
  font-size: 15px;
  margin-bottom: 20px;
  text-align: center;
}

/* Contenedor de los miembros */
.team-members {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* Cada miembro */
.team-member {
  display: flex;
  gap: 16px;
  align-items: center;
  flex: 1 1 200px;
}

/* Foto del miembro */
.team-member .member-photo {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

/* Información del miembro */
.member-info {
  display: flex;
  flex-direction: column;
}

.member-name {
  font-weight: bold;
  font-size: 15px;
}

.member-role {
  font-size: 14px;
  color: var(--gray);
}

/* =====================================================
   HEADER
   - Barra superior fija visualmente
   - Logo + título a la izquierda
   - Menú a la derecha
===================================================== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--header-padding);
  position: relative;
  z-index: 10;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Marca (logo + texto) */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  height: 50px;
}

.brand-title {
  font-size: 22px;
  font-weight: bold;
  color: var(--primary);
}

/* =====================================================
   NAVEGACIÓN (DESKTOP)
===================================================== */
.nav {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 16px;
}

.nav-links a {
  text-decoration: none;
  color: var(--black);
}

.nav-links a:hover {
  color: var(--primary);
}

/* BOTÓN MENÚ COLAPSADO (☰) */
.menu-toggle {
  display: none;
  background-color: var(--bg);
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 22px;
  cursor: pointer;
  padding: 6px 10px;
  line-height: 1;
}

.menu-toggle:hover {
  background-color: #f5f5f5;
}

.menu-toggle.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--bg);
}

/* HERO (ZONA CENTRAL) */
.hero {
  position: relative;
  padding: 80px 20px;
  transition: margin-top 0.3s ease;
  display: flex;
  justify-content: center;
}

.hero--home {
  flex: 1;
  text-align: center;
  background-image: url('../Assets/Fondo_home.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 40vh;
}

.hero--page {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 40px 20px;
  box-sizing: border-box;
  width: 100%;
  max-width: 1236px;
  margin: 0 auto;
}

.hero--page h1 {
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 35px;
  font-weight: 700;
  color: var(--primary);
}

.hero--page p {
  display: block;
  width: 100%;
  text-align: left;
  line-height: 1.6;
  font-size: 16px;
}

/* Capa clara para asegurar legibilidad del texto */
.hero--home::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(13, 16, 20, 0.55);
  z-index: 0;
}

/* Aseguramos que el contenido esté por delante del fondo */
.hero > * {
  position: relative;
  z-index: 1;
}

.hero--home h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--bg);
}

.hero--home p {
  font-size: 18px;
  color: var(--bg);
}

/* Botón INICIAR */
.start-button {
  display: inline-block;
  margin-top: 15px;
  padding: 14px 36px;
  background-color: var(--primary);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 16px;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ==============================
   BANNER DE LA APP
============================== */
.app-banner {
  background: var(--banner-bg);
  padding: 60px 20px;
  display: flex;
  justify-content: center;
}

.app-banner__content {
  max-width: 1100px;
  width: 100%;
  display: flex;
  gap: 40px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.app-banner__text {
  max-width: 480px;
}

.app-banner__text h2 {
  font-size: 28px;
  color: var(--bg);
  margin-bottom: 12px;
}

.app-banner__text p {
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
}

.app-banner__actions {
  display: flex;
  align-items: center;
  gap: clamp(30px, 5vw, 60px);
}

.store-btn {
  padding: 14px 24px;
  color: var(--bg);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.store-btn.google {
  background: #1db954;
}

.store-btn.apple {
  background: #000;
  border: 1px solid rgba(255,255,255,0.3);
}

.store-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.store-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.store-block img {
  width: 110px;
  height: 110px;
  background: var(--bg);
  padding: 8px;
  border-radius: 12px;
}

/* ==============================
   YOUTUBE SECTION
============================== */
.youtube-section {
  background: var(--youtube-bg);
  padding: 60px 20px;
  display: flex;
  justify-content: center;
}

.youtube-content {
  max-width: 1100px;
  width: 100%;
  display: flex;
  gap: 50px;
  align-items: center;
  flex-wrap: wrap;
}

.youtube-image {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.youtube-image img {
  width: 100%;
  border-radius: 16px;
  display: block;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 64px;
  color: white;
  background: rgba(0,0,0,0.35);
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.youtube-image:hover .play-overlay {
  opacity: 1;
}

.youtube-text {
  flex: 1;
  min-width: 280px;
}

.youtube-text h2 {
  font-size: 28px;
  color: var(--bg);
  margin-bottom: 16px;
}

.youtube-text p {
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
  margin-bottom: 24px;
}

.youtube-btn {
  display: inline-block;
  padding: 14px 26px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.youtube-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

/* =====================================================
   FOOTER
===================================================== */
.footer {
  background-color: var(--muted);
  padding: 16px;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
}

.footer .award {
  margin-bottom: 8px;
  color: var(--primary);
}

.footer p {
  margin: 4px 0 0;
}
/* =====================================================
    FORMULARIO LIPIDWISE APP
===================================================== */
/* Contenedor general */
.lw-container {
  width: 100%;
  margin-top: 40px;
  font-family: "Inter", sans-serif;
}
.lw-container h2 {
  margin-top: 0;
  font-size: 1.4rem;
  color: var(--primary);
}

.lw-container-results h2 {
  text-align: center;
}

/* Panel individual */
.lw-panel {
  background: var(--bg);
  border-radius: 14px;
  padding: 30px;
  margin-bottom: 30px;
  margin-top: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.04);
}

.lw-panels-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.lw-panels-row > .lw-panel {
  min-width: 0;
}
/* Cuando NO hay tratamiento → solo 2 paneles */
.lw-panels-row.no-treatment {
  grid-template-columns: repeat(2, 1fr);
  justify-content: center; /* centra el conjunto */
}

/* Título del panel */
.lw-panel h2 {
  margin-top: 0;
  font-size: 1.4rem;
  color: var(--primary);
}

/* Párrafos dentro del panel */
.lw-panel p {
  color: #555;
  margin-bottom: 15px;
}

/* Párrafos dentro del panel */
.lw-panel-info {
  padding: 20px;
}

.lw-panel-info p {
  color: #555;
  margin-bottom: 10px;
  font-style: italic;
  text-align: center;
}

.lw-panel-split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.lw-panel-split > * {
  min-width: 0;
}

.lw-panel-form {
  display: flex;
  justify-content: center;
  flex-direction: row;
  gap: 20px;
}

.lw-panel-form > * {
  width: 50%;
}

/* Panel con transición (estado inicial oculto) */
.lw-panel-transition {
  padding: 0;
  margin: 0;
  max-height: 0;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.35s ease, transform 0.35s ease, max-height 0.35s ease;
  overflow: hidden;
}
/* Estado visible del panel */
.lw-panel-transition.is-visible {
  padding: 20px;
  margin: 20px;
  opacity: 1;
  transform: translateY(0);
  max-height: 2000px;
}

/* Panel opcional con transición */
.lw-panel-optional {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

/* Panel visible */
.lw-panel-optional.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lw-panel-optional.is-hidden {
  display: none;
}


/* Columna derecha: solo subpanel medicamentos */
.lw-right {
  flex: 1;
}

/* Subpanel medicamentos */
.lw-subpanel {
  border-radius: 12px;
  box-shadow: 0 8px 20px var(--shadow);
  padding: 20px;
  max-height: 0;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.35s ease, transform 0.35s ease, max-height 0.35s ease;
  overflow: hidden;
  pointer-events: none;
}

/* Estado visible del subpanel */
.lw-subpanel.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;  
  max-height: 2000px; /* un valor muy alto para asegurar que se expanda completamente */
}

/* Panel de enfermedad (sin estilos visuales, solo transiciones) */
.lw-disease-subpanel {
  padding: 0;
  margin: 0;
  max-height: 0;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.35s ease, transform 0.35s ease, max-height 0.35s ease, padding 0.35s ease;
  overflow: hidden;
  pointer-events: none;
}

/* Estado visible del panel de enfermedad */
.lw-disease-subpanel.is-visible {
  padding: 0px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;  
  max-height: 2000px;
}


.lw-checkboxes {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(4, 1fr);
  gap: 10px;
}

.lw-checkboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lw-checkboxes-dm {
  grid-template-rows: repeat(3, 1fr);
}

/* ===== Toggle Sí / No ===== */
.lw-toggle {
  display: flex;
  gap: 16px;
}


.lw-toggle--results {
  justify-content: center;
  text-align: center;
}

/* Ocultamos el radio real */
.lw-toggle input[type="radio"] {
  display: none;
}

/* El botón visual */
.lw-toggle span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1.5px solid var(--gray);
  background: #f4f4f4;
  color: var(--gray);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Hover */
.lw-toggle span:hover {
  background: #ececec;
}

/* Estado ON (seleccionado) */
.lw-toggle input[type="radio"]:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 6px 16px var(--shadow);
}

/* Focus accesible (teclado) */
.lw-toggle input[type="radio"]:focus + span {
  outline: 3px solid var(--shadow);
  outline-offset: 2px;
}


.lw-toggle--vertical {
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.lw-toggle--vertical span {
  width: 70%;
}


/* ===== Panel 2: Layout ===== */
.lw-profile-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lw-profile-right {
  border-radius: 12px;
  box-shadow: 0 8px 20px var(--shadow);
  padding: 10px;
  min-width: 0;
  width: 100%;
}

/* Campos */
.lw-field {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  font-weight: 500;
  gap: 6px;
}

.lw-field input {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.lw-field-result {
  padding: 10px;
  border-radius: 8px;
  font-size: 0.95rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background-color: var(--shadow-slow);
}

.lw-text-results {
  text-align: center;
}

.lw-field-result p {
  text-align: center;
  font-size: 0.95rem;
}
.lw-color-results {
  color: var(--primary);
}

.contenedor-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Estilo bonito solo para los select */
.lw-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  background-color: #f9f9f9;
  color: #333;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

/* Hover y focus */
.lw-field select:hover {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.lw-field select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--shadow-slow)
}

/* Opciones del select con fondo blanco */
.lw-field select option {
  background-color: white;
  color: #333;
}

/* Etiqueta tipo texto */
.lw-label {
  margin-bottom: 6px;
  font-weight: 500;
}

.lw-lipid-panel {
  border-radius: 12px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr; 
  grid-auto-columns: 1fr; /* Permite que cada columna se ajuste automáticamente al contenido */
  gap: 20px;
}
/* Total */
.lw-field[data-field="total"] {
  grid-column: 1;
  grid-row: 1;
}

/* Triglicéridos */
.lw-field[data-field="tg"] {
  grid-column: 2;
  grid-row: 1;
}

/* LDL */
.lw-field[data-field="ldl"] {
  grid-column: 1;
  grid-row: 2;
}

/* HDL */
.lw-field[data-field="hdl"] {
  grid-column: 1;
  grid-row: 3;
}

/* Selector de unidades */
.lw-unit-toggle {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

/* ==============================
  Annimación panel resultado
============================== */
#LipidWise-form {
  opacity: 1;
  transform: translateY(0);
  max-height: 5000px;
  overflow: hidden;
  transition: opacity 0.35s ease, transform 0.35s ease, max-height 0.35s ease;
}

#LipidWise-form.is-hiding {
  opacity: 0;
  transform: translateY(-16px);
  max-height: 0;
}

#LipidWise-form.is-hidden {
  display: none;
}

#LipidWise-form {
  opacity: 1;
  transform: translateY(0);
  max-height: 5000px;
  overflow: hidden;
  transition: opacity 0.35s ease, transform 0.35s ease, max-height 0.35s ease;
}

#LipidWise-form.is-hiding {
  opacity: 0;
  transform: translateY(-16px);
  max-height: 0;
}

#LipidWise-form.is-hidden {
  display: none;
}

#LipidWise-results {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

#LipidWise-results.is-hidden-result {
  display: none;
}

#LipidWise-results.is-visible-result {
  opacity: 1;
  transform: translateY(0);
}

#results-content {
    display: flex;
    flex-direction: column; /* uno debajo de otro */
    gap: 20px; /* separación entre labels */
}

/* ===============================
   BOTÓN i INFORMACIÓN
=============================== */
/* Items con botón i pegado al texto */
.score-item-with-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-item-with-info input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: absolute;
  opacity: 0;
}

.score-item-with-info span {
  position: relative;
  padding-left: 32px;
  cursor: pointer;
  display: inline-block;
}

/* Cuadrado del checkbox */
.score-item-with-info span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary);
  border-radius: 5px;
  background-color: var(--bg);
  transition: all 0.2s ease;
}

/* Marca del checkbox */
.score-item-with-info input[type="checkbox"]:checked + span::after {
  content: "✓";
  position: absolute;
  left: 6px;
  top: 3px;
  color: var(--bg);
  font-size: 14px;
  font-weight: bold;
}

.score-item-with-info input[type="checkbox"]:checked + span::before {
  background-color: var(--primary);
}

/* Hover y focus */
.score-item-with-info span:hover::before {
  box-shadow: 0 0 0 3px rgba(152, 0, 0, 0.15);
}

.score-item-with-info input:focus + span::before {
  outline: 2px solid rgba(152, 0, 0, 0.4);
}

/* BOTÓN i pegado al texto */
.score-item-with-info .lw-info-btn {
  margin: 0;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-item-with-info .lw-info-btn:hover {
  opacity: 0.85;
}

/* Contenedor de label con info */
.lw-toggle-with-info {
  display: flex;
  align-items: center;
  gap: 8px;  /* espacio entre texto y botón i */
}

/* Botón i reutilizado de tu CSS */
.lw-toggle-with-info .lw-info-btn {
  margin: 0;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lw-toggle-with-info .lw-info-btn:hover {
  opacity: 0.85;
}


/* ===============================
   Mapa riesgo
=============================== */

.risk-map {
  max-width: 500px;
  margin: 20px auto;
  border-radius: 16px;
  box-shadow: 0 8px 24px var(--shadow);
  background: var(--bg);
  overflow: hidden;
}

/* Imagen */
.risk-map__image {
  width: 100%;
  display: block;
}

/* Leyenda */
.risk-map__legend {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
}

/* Cada indicador */
.risk-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  text-align: center;
}

/* Círculo */
.risk-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Colores */
.risk-item.low .risk-dot { background: #4CAF50; }
.risk-item.moderate .risk-dot { background: #FFC107; }
.risk-item.high .risk-dot { background: #FF9800; }
.risk-item.very-high .risk-dot { background: #D32F2F; }

/* ===============================
   OVERLAY Y MODAL DE INFORMACIÓN
=============================== */
.lw-info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lw-info-overlay.hidden {
  display: none;
}

.lw-info-modal {
  background: white;
  border-radius: 14px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  position: relative;
}

.lw-info-modal h3 {
  margin-top: 0;
  color: var(--primary);
}

.lw-info-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ==============================
   RESPONSIVE (DESKTOP)
============================== */
@media (min-width: 769px) {
  .header {
    justify-content: space-between;
  }

  /* Selector de idioma a la derecha */
  .lang-selector {
    order: 3;
    position: relative;
    width: auto;
  }

  .lang-options {
    display: none;
    position: absolute;
    top: 80%;
    right: 0;
    left: auto;
    transform: none;
    width: 120px;
    box-shadow: 0 2px 6px var(--shadow);
    border-top: 1px solid var(--border);
    z-index: 1100;
  }

  .lang-options.active {
    display: flex;
  }

  .social-links a:hover img {
    transform: scale(1.1);
  }

  .start-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  }

  .reset-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  }

  .unit-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  }

  .start-button:active,
  .reset-btn:active,
  .unit-toggle:active {
    filter: brightness(85%);
    transform: scale(0.95);
    transition: transform 0.1s ease, filter 0.1s ease;
  }

  .score-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* =====================================================
   UTILIDADES
===================================================== */
.hidden { display: none; }
@media (max-width: 768px) {
  .hero--home h1 {
    font-size: 25px;
  }

  .hero--home p {
    font-size: 15px;
  }

  .hero--page {
    padding: 24px 16px;
  }

  .hero--page h1 {
    font-size: 22px;
  }

  .hero--page p {
    font-size: 15px;
  }

  .general-text {
    font-size: 15px;
    line-height: 1.4;
  }

  /* Centramos logo + texto en el header */
  .header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
  }

  .brand {
    order: 2;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* El menú (☰) se mantiene a la derecha */
  .nav {
    order: 3;
  }

  .lang-selector {
    order: 1;
    width: auto;
  }

  /* Mostramos el botón ☰ */
  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  body.menu-open .hero {
    margin-top: 200px;
  }

  body.lang-open .hero {
    margin-top: 100px;
  }

  .app-banner {
    padding: 20px 20px;
  }

  .app-banner__content {
    gap: 10px;
    flex-direction: column;
    text-align: center;
  }

  .youtube-section {
    padding: 20px 20px;
  }

  .youtube-content {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  /* Ocultamos enlaces por defecto */
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    background-color: var(--bg);
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--border);
    z-index: 999;
  }

  /* Menú visible cuando se activa */
  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
  }

  /* Ajustes del hero en móvil */
  .hero {
    padding: 20px 20px;
  }

  .start-button {
    width: 100%;
    max-width: 280px;
    margin-top: 25px;
  }

  /* Botón de idioma en móvil */
  /* Mostramos botón desplegable */
  .lang-toggle {
    display: block;
    color: var(--black);
  }

  /* Opciones desplegables */
  .lang-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    background-color: var(--bg);
    flex-direction: column;
    gap: 0;
    z-index: 999;
    border-top: 1px solid var(--border);
  }

  .lang-options.active {
    display: flex;
  }

  .lang-options span {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    cursor: pointer;
  }

  .member-photo {
    width: 120px;
    height: 120px;
    max-height: 120px;
  }

  .team-member .member-info {
    margin-top: 10px;
  }

  .teams {
    flex-direction: column;
  }

  .team-member {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .social-links {
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }

  .social-links img {
    width: 70px;
    height: 70px;
  }

  /* Aplicamos dinamismo a los botones */
  .start-button:active,
  .reset-btn:active,
  .unit-toggle:active {
    filter: brightness(85%);
    transform: scale(0.95);
    transition: transform 0.1s ease, filter 0.1s ease;
  }

  .store-block img {
    display: none;
  }

  .lw-panel-split {
    flex-direction: column;
    gap: 20px;
  }

  .lw-right {
    width: 100%;
  }

  .lw-checkboxes {
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: 1fr;
  }

  .lw-extra-panel,
  .lw-lipid-panel {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
  }

  .lw-profile-right {
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
  }

  .lw-profile-left {
    width: 100%;
  }

  .lw-toggle {
    flex-wrap: wrap;
    justify-content: center;
  }

  .lw-toggle span {
    min-width: 70px;
    padding: 10px 16px;
  }

  .risk-map__legend {
    grid-template-columns: repeat(2, 1fr);
  }

  .lw-field[data-field] {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .lw-panels-row {
    grid-template-columns: 1fr;
    gap: 0px;
  }

  .lw-toggle--vertical span {
    width: 100%;
  }
  
  .lw-panels-row.no-treatment {
    grid-template-columns: 1fr;
  }

  .lw-panel-form {
    justify-content: center;
    flex-direction: column;
    gap: 20px;
  }

  .lw-panel-form > * {
    width: 100%;
  }
}

/* =====================================================
   VALIDACIÓN Y ERRORES
===================================================== */

/* Campo con error */
.lw-field.has-error,
.select-wrapper.has-error {
  /*background-color: #ffe6e6;
  padding: 12px;*/
  border-radius: 8px;
  /*border-left: 4px solid #d63031;*/
}

.lw-field.has-error input,
.select-wrapper.has-error select {
  background-color: #fff5f5;
  border-color: #d63031 !important;
}

.lw-field.has-error input:focus,
.select-wrapper.has-error select:focus {
  box-shadow: 0 0 0 3px rgba(214, 48, 49, 0.2) !important;
}

/* Mensaje de error */
.lw-error-message {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #d63031;
  font-size: 0.75rem;
  font-weight: 500;
  /* transición para animar desaparición */
  transition: opacity 220ms ease, transform 220ms ease, max-height 220ms ease, padding 220ms ease, margin 220ms ease;
  opacity: 1;
}

.lw-error-message::before {
  content: "⚠";
  font-size: 1rem;
  flex-shrink: 0;
}

/* Clase aplicada para animar el fade-out al eliminar mensajes */
.lw-error-message.fade-out {
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  overflow: hidden;
}

/* Transición suave para quitar el sombreado del campo */
.lw-field,
.select-wrapper{
  transition: background-color 220ms ease, border-left-color 220ms ease, box-shadow 220ms ease;
}

.lw-subpanel {
    transition: 
    max-height 0.35s ease,
    opacity 0.35s ease,
    transform 0.35s ease,
    background-color 0.22s ease,
    border-left-color 0.22s ease,
    box-shadow 0.22s ease;
}


/* Subpanel de medicamentos con error */
.lw-subpanel.has-error {
  background-color: #ffe6e6;
  /*border-left: 4px solid #d63031;*/
}

.lw-subpanel.has-error .lw-error-message {
  margin-bottom: 12px;
}

/* =====================================================
   UTILIDADES
===================================================== */
.hidden { display: none; }
