/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 991px) {
  .social-icons {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
    position: relative;
    z-index: 2000;
  }

  .logo {
    position: relative;
    z-index: 2000;
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    padding: 5.5rem 1.5rem 2rem;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, visibility 0.35s ease;
    z-index: 1000;
    overflow-y: auto;
  }

  .nav-links.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-links li a {
    font-size: 1.15rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
    display: block;
    text-align: center;
  }

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

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

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

  .contact-card-premium {
    grid-template-columns: 1fr;
    max-width: 680px;
    margin: 0 auto;
  }

  .contact-info,
  .contact-form-wrapper {
    padding: 3rem 2.5rem;
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.25rem;
  }

  .contact-info,
  .contact-form-wrapper {
    padding: 2.25rem 1.5rem;
  }

  .contact-info h2 {
    font-size: 1.75rem;
  }

  .contact-info p {
    font-size: 0.98rem;
    margin-bottom: 2rem;
  }

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

  .section-title {
    font-size: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem 2rem;
  }

  .post-hero h1 {
    font-size: 2rem;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 1rem;
  }

  .contact-card-premium {
    border-radius: var(--radius-md);
  }

  .contact-info,
  .contact-form-wrapper {
    padding: 1.75rem 1.15rem;
  }

  .contact-info h2 {
    font-size: 1.45rem;
  }

  .contact-item {
    font-size: 0.9rem;
    gap: 0.75rem;
  }

  .contact-item svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-logo,
  .footer-socials {
    justify-content: center;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* =========================================
   ANIMACIÃ“N SCROLL
   ========================================= */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: none;
}

/* ==============================================
   COMENTARIOS
   ============================================== */
.lamuga-comments {
  max-width: 780px;
  margin: 4rem auto 0;
  padding: 0 1.5rem;
}

.comments-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-dark);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-primary-light);
}

/* Lista de comentarios - sin bullets ni indentaciones por defecto */
.comment-list,
.comment-list ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Comentario raÃ­z */
.comment-item.comment-root {
  margin-bottom: 1.5rem;
}

/* Comentario anidado (respuesta) */
.comment-item.comment-child {
  margin-top: 1rem;
  margin-left: 3rem;
  position: relative;
}

.comment-item.comment-child::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 1.5rem;
  bottom: 0;
  width: 2px;
  background: var(--color-primary-light);
  border-radius: 2px;
}

/* Tarjeta de comentario */
.comment-body {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 1.5rem 1.8rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .03);
  transition: all .3s ease;
}

.comment-body:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .06);
  border-color: rgba(117, 164, 126, 0.3);
}

/* Formulario premium */
.premium-comment-form {
  margin-top: 3rem;
}

.premium-comment-form h3#reply-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--color-dark);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

#cancel-comment-reply-link {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ef4444;
  text-decoration: none;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-pill);
  background: rgba(239, 68, 68, 0.05);
  transition: all 0.2s ease;
  vertical-align: middle;
}

#cancel-comment-reply-link:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.comment-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .comment-form-row {
    grid-template-columns: 1fr;
  }
}

.comment-form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.comment-form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.comment-form-group input,
.comment-form-group textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-dark);
  transition: all 0.3s ease;
}

.comment-form-group input:focus,
.comment-form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(117, 164, 126, 0.15);
}

.form-submit {
  margin-top: 2rem;
}

.form-submit input[type="submit"] {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 1rem 2.5rem;
  border-radius: 100px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(117, 164, 126, 0.3);
}

.form-submit input[type="submit"]:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(117, 164, 126, 0.4);
}

/* Autor */
.comment-author-info {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1rem;
}

.comment-avatar {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  border: 2px solid var(--color-primary-light);
  flex-shrink: 0;
}

.comment-author-name {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  color: var(--color-dark);
}

.comment-date {
  font-size: .78rem;
  color: var(--color-text-muted, #506176);
  text-decoration: none;
  display: block;
  margin-top: .1rem;
}

.comment-date:hover {
  color: var(--color-primary);
}

/* Texto del comentario */
.comment-text p {
  margin: 0;
  color: var(--color-text);
  font-size: .95rem;
  line-height: 1.7;
}

/* Acciones: responder, editar */
.comment-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px solid #f1f5f9;
}

.comment-actions a,
.comment-reply-link,
.comment-edit-link {
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-text-muted, #506176);
  text-decoration: none;
  transition: color .15s;
}

.comment-reply-link:hover {
  color: var(--color-primary);
}

.comment-edit-link {
  color: #64748b;
}

.comment-edit-link:hover {
  color: #334155;
}

/* Pendiente de moderación */
.comment-awaiting-moderation {
  font-size: .82rem;
  color: #b45309;
  background: #fffbeb;
  border-radius: 6px;
  padding: .4rem .8rem;
  margin-bottom: .5rem;
}

/* Paginación de comentarios */
.comment-nav {
  display: flex;
  justify-content: space-between;
  margin: 1.5rem 0;
  font-size: .9rem;
}

.comment-nav a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

/* Formulario de comentarios */
#respond {
  margin-top: 3rem;
  background: #f8fafc;
  border-radius: 16px;
  padding: 2rem;
  border: 1.5px solid #f1f5f9;
}

#reply-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-dark);
  margin-bottom: 1.5rem;
}

#reply-title small a {
  font-size: .75rem;
  font-weight: 500;
  color: var(--color-text-muted, #506176);
  margin-left: .75rem;
}

.comment-notes {
  font-size: .82rem;
  color: var(--color-text-muted, #506176);
  margin-bottom: 1.5rem;
}

.comment-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.comment-form-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1rem;
}

.comment-form-group label {
  font-size: .82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--color-dark);
}

.comment-form-group label span {
  font-weight: 400;
  color: var(--color-text-muted, #506176);
}

.comment-form-group input,
.comment-form-group textarea {
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: .65rem 1rem;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-dark);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  width: 100%;
}

.comment-form-group input:focus,
.comment-form-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(117, 164, 126, .15);
}

.comment-form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  margin-top: .5rem;
}

.form-submit #submit {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: .75rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 4px 15px rgba(117, 164, 126, .3);
}

.form-submit #submit:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(117, 164, 126, .4);
}

@media (max-width: 600px) {
  .comment-form-row {
    grid-template-columns: 1fr;
  }

  .comment-item.comment-child {
    margin-left: 1.5rem;
  }
}

/* =========================================
   ESTILOS COMPLEMENTARIOS ADAPTADOS (floating labels / maps)
   ========================================= */
.map-overlay-link {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-dark);
  box-shadow: var(--shadow-md);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition-normal);
}

.map-overlay-link:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-2px);
}

/* Premium Floating Input Labels */
.premium-input {
  position: relative;
  margin-top: 1rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.premium-input input,
.premium-input textarea,
.premium-input select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1rem;
  border: 1.5px solid #d4e4d6;
  border-radius: 10px;
  background: #f8faf9;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--color-dark);
  outline: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.premium-input label {
  position: absolute;
  left: 1rem;
  top: 0.95rem;
  color: var(--color-text-muted, #506176);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.82rem;
  line-height: 1.2;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0;
  padding: 0 0.35rem;
  margin-left: -0.35rem;
  border-radius: 4px;
  z-index: 2;
}

/* Trigger floating label state */
.premium-input input:focus~label,
.premium-input input:not(:placeholder-shown)~label,
.premium-input input:-webkit-autofill~label,
.premium-input textarea:focus~label,
.premium-input textarea:not(:placeholder-shown)~label {
  top: -0.55rem;
  left: 0.85rem;
  font-size: 0.7rem;
  line-height: 1;
  color: var(--color-primary-dark, #2d5a37);
  background-color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.8px;
}

/* Select field floating label */
.premium-input select~label {
  top: -0.55rem;
  left: 0.85rem;
  font-size: 0.7rem;
  line-height: 1;
  color: var(--color-primary-dark, #2d5a37);
  background-color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.8px;
}

/* Evitar fondo extraño de autocompletado del navegador */
.premium-input input:-webkit-autofill,
.premium-input input:-webkit-autofill:hover,
.premium-input input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--color-dark);
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Accesibilidad y Estados de Foco / Error (WCAG 3.3.1 & 3.3.3) */
.premium-input input:focus,
.premium-input textarea:focus,
.premium-input select:focus {
  background: #ffffff;
  border: 1.5px solid var(--color-primary-dark, #2d5a37) !important;
  box-shadow: 0 0 0 3px rgba(117, 164, 126, 0.22) !important;
  outline: none !important;
}

.premium-input input.field-invalid,
.premium-input textarea.field-invalid,
.premium-input select.field-invalid,
.premium-input input[aria-invalid="true"],
.premium-input textarea[aria-invalid="true"],
.premium-input select[aria-invalid="true"] {
  border: 1.5px solid #dc2626 !important;
  background: #fff5f5;
}

.premium-input input.field-invalid:focus,
.premium-input textarea.field-invalid:focus,
.premium-input select.field-invalid:focus,
.premium-input input[aria-invalid="true"]:focus,
.premium-input textarea[aria-invalid="true"]:focus,
.premium-input select[aria-invalid="true"]:focus {
  border: 1.5px solid #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18) !important;
  outline: none !important;
}

.field-error-msg {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #dc2626;
  margin-top: 5px;
  line-height: 1.35;
  transition: opacity 0.2s ease;
}

.field-error-msg:empty {
  display: none;
}

html.dark-mode .field-error-msg {
  color: #f87171 !important;
}

html.dark-mode .premium-input input.field-invalid,
html.dark-mode .premium-input textarea.field-invalid,
html.dark-mode .premium-input select.field-invalid {
  border: 1.5px solid #ef4444 !important;
}

html.dark-mode .premium-input input:focus,
html.dark-mode .premium-input textarea:focus,
html.dark-mode .premium-input select:focus {
  border-color: #34d399 !important;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2) !important;
  outline: none !important;
}

html.dark-mode .premium-input input:focus~label,
html.dark-mode .premium-input input:not(:placeholder-shown)~label,
html.dark-mode .premium-input input:-webkit-autofill~label,
html.dark-mode .premium-input textarea:focus~label,
html.dark-mode .premium-input textarea:not(:placeholder-shown)~label,
html.dark-mode .premium-input select~label {
  background-color: var(--dm-bg-surface, #1e293b) !important;
  color: #34d399 !important;
}

html.dark-mode .premium-input input:-webkit-autofill,
html.dark-mode .premium-input input:-webkit-autofill:hover,
html.dark-mode .premium-input input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--color-dark) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--dm-bg-surface, #1e293b) inset !important;
}

.form-group-checkbox.field-invalid span {
  color: #dc2626 !important;
  font-weight: 600;
}

html.dark-mode .form-group-checkbox.field-invalid span {
  color: #f87171 !important;
}

/* Checkbox de Privacidad Responsivo */
.form-group-checkbox {
  margin: 1.25rem 0;
  font-size: 0.88rem;
  color: #64748b;
  width: 100%;
  box-sizing: border-box;
}

.form-group-checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  line-height: 1.45;
  width: 100%;
}

.form-group-checkbox input[type="checkbox"] {
  margin-top: 3px;
  accent-color: #4a7a58;
  width: 16px;
  height: 16px;
  min-width: 16px;
  flex-shrink: 0;
}

.form-group-checkbox span {
  flex: 1;
  word-break: break-word;
  overflow-wrap: break-word;
}

.form-group-checkbox a {
  color: #4a7a58;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.form-group-checkbox a:hover {
  color: var(--color-primary-dark);
}

.contact-form .submit-btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 1.5rem;
}

/* =========================================
   METODOLOGIA & CTA (PAGINA SERVICIOS)
   ========================================= */
.process {
  background-color: var(--color-primary-light);
}

.process-step {
  background: var(--color-white);
  padding: 3rem 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  border: 1px solid rgba(0, 0, 0, 0.02);
}

.process-step:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.process-step-number {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  color: var(--color-primary);
  opacity: 0.35;
  margin-top: -1rem;
  margin-bottom: 1rem;
  font-family: var(--font-heading);
}

.process-step h4 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--color-dark);
}

.process-step p {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.6;
}

.cta {
  background-color: var(--color-white);
  border-top: 1px solid var(--color-primary-light);
}

/* =========================================
   ESTILOS MODO OSCURO (DARK MODE)
   Tokens definidos en assets/css/variables.css
   ========================================= */
html.dark-mode,
html.dark-mode body {
  background-color: var(--dm-bg-base);
  color: var(--color-text);
}

/* Navbar en Modo Oscuro */
html.dark-mode .navbar {
  background-color: var(--dm-bg-navbar);
  border-bottom: 1px solid var(--dm-border-subtle);
}

html.dark-mode .navbar.scrolled {
  background-color: var(--dm-bg-navbar-scrolled);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
}

html.dark-mode .logo-text {
  color: var(--color-dark) !important;
}

html.dark-mode .nav-links li a {
  color: var(--color-text);
}

html.dark-mode .nav-links li a:hover,
html.dark-mode .nav-links li.current-menu-item a {
  color: var(--color-primary);
}

/* Menú móvil en Modo Oscuro */
@media (max-width: 991px) {
  html.dark-mode .nav-links {
    background: var(--dm-bg-navbar-scrolled);
  }
}

/* Secciones y Tarjetas en Modo Oscuro */
html.dark-mode .bg-light,
html.dark-mode .service-card,
html.dark-mode .blog-card,
html.dark-mode .process-step,
html.dark-mode .contact-card-premium,
html.dark-mode .contact-form-wrapper,
html.dark-mode .horario-box,
html.dark-mode #respond,
html.dark-mode .service-option-inner,
html.dark-mode .radio-option,
html.dark-mode .result-item,
html.dark-mode .comment-body {
  background-color: var(--dm-bg-surface) !important;
  border-color: var(--dm-border-subtle) !important;
  box-shadow: var(--dm-shadow-card) !important;
}

html.dark-mode .blog-title a,
html.dark-mode .service-title,
html.dark-mode .section-title,
html.dark-mode .hero-title,
html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
html.dark-mode h4 {
  color: var(--color-dark) !important;
}

html.dark-mode .service-desc,
html.dark-mode .blog-excerpt,
html.dark-mode .hero-subtitle,
html.dark-mode p,
html.dark-mode label {
  color: var(--color-text);
}

html.dark-mode .post-reading-time {
  color: var(--color-primary);
  background: rgba(130, 196, 147, 0.12);
  border-color: rgba(130, 196, 147, 0.25);
}

html.dark-mode .location-section,
html.dark-mode .contact-section,
html.dark-mode .calculator-section,
html.dark-mode .about,
html.dark-mode .post-hero,
html.dark-mode .process {
  background-color: var(--dm-bg-base) !important;
}

/* Footer en Modo Oscuro */
html.dark-mode .site-footer {
  background-color: var(--dm-bg-footer) !important;
  border-top-color: var(--dm-border-subtle) !important;
  color: var(--color-text-muted);
}

html.dark-mode .site-footer .logo-text,
html.dark-mode .site-footer h4 {
  color: var(--color-dark) !important;
}

html.dark-mode .site-footer .horario-box {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: var(--dm-border-subtle) !important;
}

html.dark-mode .footer-bottom {
  border-top-color: var(--dm-border-subtle) !important;
}

/* Inputs en Modo Oscuro */
html.dark-mode input,
html.dark-mode textarea,
html.dark-mode select {
  color: var(--color-dark) !important;
  border-bottom-color: #475569 !important;
}

html.dark-mode select option {
  background-color: var(--dm-bg-surface);
  color: var(--color-dark);
}

html.dark-mode .premium-input label {
  color: var(--color-text-muted) !important;
}

html.dark-mode .form-group-checkbox,
html.dark-mode .form-group-checkbox label,
html.dark-mode .form-group-checkbox span {
  color: var(--color-text-muted) !important;
}

html.dark-mode .form-group-checkbox a {
  color: var(--dm-accent-label) !important;
}

/* Botón de cambio de Tema (Sol / Luna) */
.theme-toggle-btn {
  border: none;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background-color: var(--color-primary-light);
  color: var(--color-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
}

.theme-toggle-btn:hover {
  background-color: var(--color-primary);
  color: #ffffff;
  transform: translateY(-2px);
}

.theme-toggle-btn .sun-icon {
  display: none;
  width: 18px;
  height: 18px;
  color: #f59e0b;
}

.theme-toggle-btn .moon-icon {
  display: block;
  width: 18px;
  height: 18px;
  color: #475569;
}

html.dark-mode .theme-toggle-btn {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-dark);
}

html.dark-mode .theme-toggle-btn:hover {
  background-color: var(--color-primary);
}

html.dark-mode .theme-toggle-btn .sun-icon {
  display: block;
}

html.dark-mode .theme-toggle-btn .moon-icon {
  display: none;
}

/* Acordeón About en Modo Oscuro */
html.dark-mode .feature-item {
  background-color: var(--dm-bg-surface) !important;
  border: 1px solid var(--dm-border-subtle) !important;
  transition: all 0.25s ease;
}

html.dark-mode .feature-item:hover {
  background-color: var(--dm-bg-surface-hover) !important;
  border-color: var(--color-primary) !important;
}

html.dark-mode .feature-header h4 {
  color: var(--color-dark) !important;
}

html.dark-mode .plus-icon {
  color: var(--color-primary) !important;
}

html.dark-mode .feature-item.active {
  background-color: var(--color-primary) !important;
}

html.dark-mode .feature-item.active .feature-header h4,
html.dark-mode .feature-item.active .plus-icon {
  color: var(--color-dark) !important;
}

html.dark-mode .feature-item.active .accordion-body {
  background-color: var(--dm-bg-surface) !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

html.dark-mode .feature-item.active .accordion-body p,
html.dark-mode .feature-item.active .accordion-body strong {
  color: var(--color-text) !important;
}

/* Hero de entradas de Blog y Proyectos en Modo Oscuro */
html.dark-mode .post-hero {
  background: linear-gradient(135deg, var(--dm-bg-surface) 0%, var(--dm-bg-base) 100%) !important;
  border-bottom: 1px solid var(--dm-border-subtle) !important;
}

html.dark-mode .post-hero h1 {
  color: var(--color-dark) !important;
}

html.dark-mode .post-hero-meta {
  color: var(--dm-accent-sage) !important;
}

/* Contenido de Entradas en Modo Oscuro */
html.dark-mode .post-content-wrapper p,
html.dark-mode .post-content-wrapper li {
  color: var(--color-text) !important;
}

html.dark-mode .post-content-wrapper h2,
html.dark-mode .post-content-wrapper h3 {
  color: var(--color-dark) !important;
}

/* Valoración de Artículos en Modo Oscuro */
html.dark-mode .rating-widget {
  background: linear-gradient(135deg, var(--dm-bg-surface), var(--dm-bg-base)) !important;
  border-color: var(--dm-border-subtle) !important;
  box-shadow: var(--dm-shadow-elevated) !important;
}

html.dark-mode .rating-header,
html.dark-mode .rating-avg-number {
  color: var(--color-dark) !important;
}

html.dark-mode .rating-votes-count,
html.dark-mode .rating-no-votes {
  color: var(--color-text-muted) !important;
}

/* Formulario de Comentarios y Comentarios en Modo Oscuro */
html.dark-mode #respond {
  background-color: var(--dm-bg-surface) !important;
  border-color: var(--dm-border-subtle) !important;
}

html.dark-mode #reply-title,
html.dark-mode .premium-comment-form h3#reply-title,
html.dark-mode .comment-form-group label,
html.dark-mode .comment-author-name {
  color: var(--color-dark) !important;
}

html.dark-mode .comment-notes {
  color: var(--color-text-muted) !important;
}

html.dark-mode .comment-form-group input,
html.dark-mode .comment-form-group textarea {
  background: var(--dm-bg-base) !important;
  border-color: var(--dm-border-input) !important;
  color: var(--color-dark) !important;
}

html.dark-mode .comment-form-group input:focus,
html.dark-mode .comment-form-group textarea:focus {
  border-color: var(--dm-accent-sage) !important;
  background: var(--dm-bg-surface) !important;
  box-shadow: 0 0 0 3px rgba(117, 164, 126, 0.25) !important;
}

html.dark-mode .comment-body {
  background: rgba(30, 41, 59, 0.7) !important;
  border-color: var(--dm-border-subtle) !important;
}

html.dark-mode .comment-text p {
  color: var(--color-text) !important;
}

html.dark-mode #cancel-comment-reply-link {
  color: #fca5a5 !important;
  border-color: rgba(252, 165, 165, 0.3) !important;
  background: rgba(252, 165, 165, 0.05) !important;
}

html.dark-mode #cancel-comment-reply-link:hover {
  background: rgba(252, 165, 165, 0.15) !important;
  color: #f87171 !important;
}

/* Contact Form en Modo Oscuro */
html.dark-mode .form-group input,
html.dark-mode .form-group textarea,
html.dark-mode .form-group select {
  color: var(--color-dark) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

html.dark-mode .form-group input:focus,
html.dark-mode .form-group textarea:focus,
html.dark-mode .form-group select:focus {
  border-color: var(--color-primary) !important;
  background: rgba(140, 184, 146, 0.08) !important;
  box-shadow: 0 0 0 3px rgba(140, 184, 146, 0.15) !important;
}

html.dark-mode .form-group input::placeholder,
html.dark-mode .form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
}

html.dark-mode .form-group label {
  color: var(--dm-accent-label) !important;
}

html.dark-mode .form-group select option {
  background-color: var(--dm-bg-surface) !important;
  color: var(--color-dark) !important;
}

/* Botones en Modo Oscuro */
html.dark-mode .btn-secondary {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--color-dark) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

html.dark-mode .btn-secondary:hover {
  background-color: var(--color-dark) !important;
  color: var(--dm-bg-base) !important;
  border-color: var(--color-dark) !important;
}

html.dark-mode .btn-primary {
  background-color: var(--color-primary) !important;
  color: var(--dm-bg-base) !important;
  font-weight: 600 !important;
}

html.dark-mode .btn-primary:hover {
  background-color: var(--color-primary-dark) !important;
  color: var(--dm-bg-base) !important;
}

/* Calculadora de Presupuesto en Modo Oscuro */
html.dark-mode .result-cta {
  background-color: var(--dm-bg-surface) !important;
  border: 1px solid var(--dm-border-subtle) !important;
  box-shadow: var(--dm-shadow-elevated) !important;
}

html.dark-mode .result-cta p,
html.dark-mode .result-cta strong {
  color: var(--color-dark) !important;
}

html.dark-mode .result-disclaimer {
  color: var(--color-text-muted) !important;
}

html.dark-mode .result-header p {
  color: var(--color-text) !important;
}

html.dark-mode .result-item {
  background-color: var(--dm-bg-surface) !important;
  border-color: var(--dm-border-subtle) !important;
}

html.dark-mode .result-item-name {
  color: var(--color-dark) !important;
}

html.dark-mode .result-item-range {
  color: var(--dm-accent-sage) !important;
}

/* Elementos de Proyectos en Modo Oscuro */
html.dark-mode .proyecto-resultado-box {
  background: linear-gradient(135deg, var(--dm-bg-surface), var(--dm-bg-base)) !important;
  border-color: var(--dm-accent-sage) !important;
}

html.dark-mode .proyecto-resultado-label {
  color: var(--dm-accent-sage) !important;
}

html.dark-mode .proyecto-resultado-text {
  color: var(--color-dark) !important;
}

html.dark-mode .proyecto-meta-box {
  background-color: var(--dm-bg-surface) !important;
  border-color: var(--dm-border-subtle) !important;
}

html.dark-mode .proyecto-meta-label {
  color: var(--color-text-muted) !important;
}

html.dark-mode .proyecto-meta-value {
  color: var(--color-dark) !important;
}

/* =========================================
   MODO PARA DALTÓNICOS & ALTO CONTRASTE 👁️
   Tokens definidos en assets/css/variables.css
   ========================================= */

/* Refuerzo de enlaces con subrayado visible */
html.colorblind-mode p a,
html.colorblind-mode .post-body a,
html.colorblind-mode .page-content a,
html.colorblind-mode .footer-links a,
html.colorblind-mode .footer-legal-links a {
  text-decoration: underline !important;
  text-underline-offset: 3px;
  font-weight: 600;
}

/* Foco de alto contraste */
html.colorblind-mode :focus-visible {
  outline: 3px solid #0284c7 !important;
  outline-offset: 3px !important;
}

/* Botones con gradientes adaptados */
html.colorblind-mode .btn-primary,
html.colorblind-mode section[style*="background:linear-gradient(135deg,#75a47e,#588260)"] {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
}

/* Botón de alternancia en Footer */
.footer-accessibility-btn {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid #cbd5e1;
  border-radius: 100px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.footer-accessibility-btn:hover {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
  transform: translateY(-1px);
}

html.dark-mode .footer-accessibility-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

html.colorblind-mode .footer-accessibility-btn {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
}

/* Overrides para elementos con colores verdes hardcodeados */
html.colorblind-mode .contact-info {
  background-color: #0369a1 !important;
}

html.colorblind-mode .contact-item svg,
html.colorblind-mode .contact-info p,
html.colorblind-mode .contact-info h2 {
  color: #ffffff !important;
}

html.colorblind-mode .feature-item {
  background-color: #e0f2fe !important;
}

html.colorblind-mode .feature-item:hover {
  background-color: #bae6fd !important;
}

html.colorblind-mode .feature-item.active {
  background-color: #0284c7 !important;
}

html.colorblind-mode .feature-item.active .accordion-body {
  background-color: #e0f2fe !important;
  border-top-color: rgba(2, 132, 199, 0.3) !important;
}

html.colorblind-mode .blog-img-placeholder {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 60%, #e0f2fe 100%) !important;
}

html.colorblind-mode .site-footer {
  border-top-color: #0284c7 !important;
}

html.colorblind-mode .service-card:hover {
  border-top-color: #0284c7 !important;
}

html.colorblind-mode .post-hero-divider span {
  background: #0284c7 !important;
}

html.colorblind-mode .blog-read-more::after {
  background: #0284c7 !important;
}

html.colorblind-mode .blog-meta {
  border-bottom-color: rgba(2, 132, 199, 0.35) !important;
}

html.colorblind-mode .post-body>p:first-of-type {
  border-left-color: #0284c7 !important;
}

html.colorblind-mode .post-body h2 {
  border-left-color: #0284c7 !important;
}

html.colorblind-mode .horario-box {
  border-left-color: #0284c7 !important;
  background: rgba(2, 132, 199, 0.1) !important;
}

html.colorblind-mode .whatsapp-float {
  background: #0284c7 !important;
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.4) !important;
}

html.colorblind-mode .whatsapp-float:hover {
  background: #0369a1 !important;
}

/* =========================================
   ALINEACIÓN DINÁMICA DESDE EL EDITOR WEB
   ========================================= */
.lm-align-left,
.lm-align-left h1,
.lm-align-left h2,
.lm-align-left h3,
.lm-align-left h4,
.lm-align-left p,
.lm-align-left .section-description,
.lm-align-left .hero-subtitle {
  text-align: left !important;
}
.lm-align-left.hero-content {
  margin-left: 0 !important;
  margin-right: auto !important;
}
.lm-align-left .hero-actions,
.lm-align-left .contact-item {
  justify-content: flex-start !important;
}
.lm-align-left.section-description,
.lm-align-left .section-description {
  margin-left: 0 !important;
  margin-right: auto !important;
}

.lm-align-center,
.lm-align-center h1,
.lm-align-center h2,
.lm-align-center h3,
.lm-align-center h4,
.lm-align-center p,
.lm-align-center .section-description,
.lm-align-center .hero-subtitle,
.lm-align-center .horario-box {
  text-align: center !important;
}
.lm-align-center.hero-content {
  margin-left: auto !important;
  margin-right: auto !important;
}
.lm-align-center .hero-actions,
.lm-align-center .contact-item {
  justify-content: center !important;
}
.lm-align-center.section-description,
.lm-align-center .section-description {
  margin-left: auto !important;
  margin-right: auto !important;
}

.lm-align-right,
.lm-align-right h1,
.lm-align-right h2,
.lm-align-right h3,
.lm-align-right h4,
.lm-align-right p,
.lm-align-right .section-description,
.lm-align-right .hero-subtitle,
.lm-align-right .horario-box {
  text-align: right !important;
}
.lm-align-right.hero-content {
  margin-left: auto !important;
  margin-right: 0 !important;
}
.lm-align-right .hero-actions,
.lm-align-right .contact-item {
  justify-content: flex-end !important;
}
.lm-align-right.section-description,
.lm-align-right .section-description {
  margin-left: auto !important;
  margin-right: 0 !important;
}

/* Cabecera /proyectos cuando lleva imagen de fondo personalizada */
.post-hero.lm-post-hero-has-bg,
html.dark-mode .post-hero.lm-post-hero-has-bg {
  background-color: #0f172a;
  color: #ffffff !important;
}
.post-hero.lm-post-hero-has-bg .section-label {
  color: #86efac !important;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.post-hero.lm-post-hero-has-bg h1,
.post-hero.lm-post-hero-has-bg .section-title,
html.dark-mode .post-hero.lm-post-hero-has-bg h1 {
  color: #ffffff !important;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.post-hero.lm-post-hero-has-bg .section-description {
  color: rgba(255, 255, 255, 0.92) !important;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.lm-projects-intro p {
  margin-bottom: 1rem;
}
.lm-projects-intro p:last-child {
  margin-bottom: 0;
}
.no-proyectos p {
  text-align: center;
}
html.dark-mode .no-proyectos {
  background: var(--dm-bg-surface, #1e293b) !important;
  border-color: var(--dm-border-input, #334155) !important;
  box-shadow: var(--dm-shadow-card);
}
html.dark-mode .no-proyectos h3 {
  color: #ffffff !important;
}
html.dark-mode .no-proyectos p {
  color: #cbd5e1 !important;
}
html.dark-mode .a11y-card,
html.dark-mode .a11y-callout {
  background: var(--dm-bg-surface, #1e293b) !important;
  border-color: var(--dm-border-subtle, rgba(255, 255, 255, 0.1)) !important;
}
html.dark-mode .a11y-card p,
html.dark-mode .a11y-callout p,
html.dark-mode .a11y-callout li {
  color: #e2e8f0 !important;
}