@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Variables de Luz (Default) */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-accent-light: #E0F2FE;
  --color-primary: #3399FF;
  --color-primary-dark: #1D80E6;
  --color-text-main: #1E293B;
  --color-text-muted: #64748B;
  --color-border: #E2E8F0;
  
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --shadow-sm: 0 2px 8px -1px rgba(51, 153, 255, 0.08);
  --shadow-md: 0 12px 24px -4px rgba(51, 153, 255, 0.12);
  --shadow-lg: 0 20px 32px -6px rgba(51, 153, 255, 0.16);
  
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-theme: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
}

/* Modificaciones para Modo Oscuro */
body.dark-theme {
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-accent-light: rgba(51, 153, 255, 0.15);
  --color-text-main: #F8FAFC;
  --color-text-muted: #94A3B8;
  --color-border: #334155;
  
  --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 24px -4px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 32px -6px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-primary);
  color: var(--color-text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  line-height: 1.6;
  transition: var(--transition-theme);
}

/* Transiciones de tema de color globales */
header, section, footer, div, h1, h2, h3, p, a, input, textarea, button, .service-card, .project-card, .contact-card {
  transition: var(--transition-theme);
}

/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(51, 153, 255, 0.15);
}

body.dark-theme header {
  background: rgba(15, 23, 42, 0.8);
  border-bottom-color: rgba(51, 153, 255, 0.2);
}

header.scrolled {
  box-shadow: var(--shadow-sm);
  background: rgba(255, 255, 255, 0.96);
}

body.dark-theme header.scrolled {
  background: rgba(15, 23, 42, 0.96);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--color-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth) !important;
}

.logo span {
  background: linear-gradient(135deg, var(--color-primary), #00D2FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--color-text-main);
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  padding: 0.5rem 0;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: var(--transition-smooth);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--color-primary);
}

/* Contact Button in Nav */
.nav-btn {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #FFFFFF !important;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  box-shadow: 0 4px 14px rgba(51, 153, 255, 0.3);
  font-weight: 600;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(51, 153, 255, 0.4);
}

.nav-btn::after {
  display: none;
}

.nav-btn-secondary {
  border: 1.5px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary) !important;
  padding: 0.7rem 1.4rem;
  border-radius: 50px;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.nav-btn-secondary:hover {
  background: rgba(51, 153, 255, 0.08);
  transform: translateY(-2px);
}

.nav-btn-secondary::after {
  display: none;
}

/* Selector de Modo Claro/Oscuro (Unificado Desktop & Móvil) */

/* Ocultar selector de tema móvil en pantallas de escritorio */
@media (min-width: 1025px) {
  .mobile-only-toggle {
    display: none !important;
  }
}

/* Ocultar selector de tema de escritorio en pantallas móviles */
@media (max-width: 1024px) {
  .desktop-only-toggle {
    display: none !important;
  }
}

/* Selector de tema (Diseño Unificado Premium) */
.theme-toggle-icon {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  outline: none;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.theme-toggle-icon:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.theme-toggle-icon:active {
  transform: translateY(0) scale(0.95);
}

body.dark-theme .theme-toggle-icon {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .theme-toggle-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-primary);
}

/* Iconos de tema y posicionamiento */
.theme-toggle-icon svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

/* Modo Claro (default): Mostramos la luna */
.theme-toggle-icon .sun-icon {
  color: var(--color-primary);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg) scale(0.5);
  pointer-events: none;
}

.theme-toggle-icon .moon-icon {
  color: #00D2FF;
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

/* Modo Oscuro (dark-theme): Mostramos el sol */
body.dark-theme .theme-toggle-icon .sun-icon {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

body.dark-theme .theme-toggle-icon .moon-icon {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-90deg) scale(0.5);
  pointer-events: none;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 2rem 4rem 2rem;
  background: radial-gradient(circle at 90% 10%, var(--bg-accent-light) 0%, transparent 40%);
  overflow: hidden;
}

.hero-canvas-container {
  position: absolute;
  top: 0;
  right: 0;
  width: 55%;
  height: 100%;
  z-index: 1;
  pointer-events: auto;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin-left: calc((100vw - 1200px) / 2);
}

@media (max-width: 1200px) {
  .hero-content {
    margin-left: 0;
  }
}

.hero h1 {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 3.8rem;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  color: var(--color-text-main);
}

.hero h1 span {
  color: var(--color-primary);
  background: linear-gradient(135deg, var(--color-primary) 0%, #007FFF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
  max-width: 500px;
}

.cta-group {
  display: flex;
  gap: 1.25rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 1rem 2rem;
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 24px rgba(51, 153, 255, 0.25);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth) !important;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(51, 153, 255, 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 1rem 2rem;
  border-radius: var(--border-radius-md);
  border: 2px solid var(--color-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: var(--transition-smooth) !important;
}

.btn-secondary:hover {
  background: rgba(51, 153, 255, 0.05);
  transform: translateY(-3px);
}

/* Sections Base */
section.py-section {
  padding: 8rem 2rem;
  position: relative;
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 5rem auto;
}

.section-tag {
  color: var(--color-primary);
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
  display: block;
}

.section-title {
  font-family: var(--font-title);
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--color-text-main);
  line-height: 1.2;
}

.section-title span {
  color: var(--color-primary);
}

/* Servicios Section */
#servicios {
  background-color: var(--bg-secondary);
}

.servicios-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.service-card {
  background: var(--bg-primary);
  padding: 2.25rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-border);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 1.5rem;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--color-primary);
  transform: scaleY(0);
  transition: var(--transition-smooth);
  transform-origin: bottom;
}

.service-card:hover {
  transform: translateX(8px);
  box-shadow: var(--shadow-md);
  border-color: rgba(51, 153, 255, 0.2);
}

body.dark-theme .service-card:hover {
  border-color: rgba(51, 153, 255, 0.35);
}

.service-card:hover::before {
  transform: scaleY(1);
}

.service-icon {
  background: var(--bg-accent-light);
  color: var(--color-primary);
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  transition: var(--transition-smooth) !important;
}

.service-card:hover .service-icon {
  background: var(--color-primary);
  color: #FFFFFF;
  transform: scale(1.05);
}

.service-card h3 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text-main);
}

.service-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.babylon-container {
  height: 500px;
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}

.babylon-canvas {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

.interactive-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  border: 1px solid rgba(51, 153, 255, 0.2);
  pointer-events: none;
  animation: pulse 2s infinite;
  z-index: 5;
}

body.dark-theme .interactive-hint {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(51, 153, 255, 0.3);
}

/* Portafolio Section */
.portafolio-layout {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.spline-showcase {
  width: 100%;
  height: 450px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  position: relative;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2.5rem;
}

.project-card {
  background: var(--bg-primary);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(51, 153, 255, 0.3);
}

.project-thumbnail {
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  overflow: hidden;
  position: relative;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth) !important;
}

.project-card:hover .project-img {
  transform: scale(1.05);
  filter: brightness(1.03);
}

.project-info {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Badges de tecnología en tarjetas */
.project-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tech-badge {
  background: var(--bg-accent-light);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  letter-spacing: 0.2px;
}

body.dark-theme .tech-badge {
  background: rgba(51, 153, 255, 0.12);
  color: #5eb5ff;
}

.project-card h3 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--color-text-main);
  transition: var(--transition-smooth) !important;
}

.project-card:hover h3 {
  color: var(--color-primary);
}

.project-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
  flex-grow: 1;
}

.project-link-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: auto;
}

.project-link-label svg {
  transition: var(--transition-smooth) !important;
}

.project-card:hover .project-link-label svg {
  transform: translateX(4px);
}

/* Contacto Section */
#contacto {
  background-color: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-info h3 {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-text-main);
}

.contact-info p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-item-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-primary);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.contact-item-text h4 {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.contact-item-text p {
  font-weight: 600;
  color: var(--color-text-main);
  font-size: 1rem;
}

/* Contact Form with Material Floating Labels */
.contact-card {
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
  padding: 3.5rem;
  box-shadow: var(--shadow-md);
}

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

.form-control {
  width: 100%;
  padding: 1.25rem 1rem 0.75rem 1rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--bg-secondary);
  color: var(--color-text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
}

/* Input Floating Label Logic */
.floating-label {
  position: absolute;
  left: 1rem;
  top: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), font-size 0.25s, color 0.25s;
  transform-origin: left top;
}

/* Focus and active states */
.form-control:focus {
  border-color: var(--color-primary);
  background-color: var(--bg-primary);
  box-shadow: 0 0 0 4px rgba(51, 153, 255, 0.15);
}

/* Mover label arriba si está enfocado o no vacío */
.form-control:focus ~ .floating-label,
.form-control:not(:placeholder-shown) ~ .floating-label {
  transform: translateY(-0.85rem) scale(0.78);
  color: var(--color-primary);
}

textarea.form-control {
  resize: vertical;
  min-height: 150px;
  padding-top: 1.5rem;
}

.form-btn {
  width: 100%;
  justify-content: center;
}

.form-status {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  display: none;
  text-align: center;
}

.form-status.success {
  display: block;
  background-color: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

body.dark-theme .form-status.success {
  background-color: rgba(22, 163, 74, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
}

.form-status.error {
  display: block;
  background-color: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FCA5A5;
}

body.dark-theme .form-status.error {
  background-color: rgba(220, 38, 38, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Footer */
footer {
  background-color: #0F172A;
  color: #FFFFFF;
  padding: 4rem 2rem 2rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-theme footer {
  background-color: #090D16;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.8rem;
  color: #FFFFFF;
  text-decoration: none;
}

.footer-logo span {
  color: var(--color-primary);
}

.footer-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.footer-link {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  transition: var(--transition-smooth) !important;
}

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

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
}

/* EFEECTO SCROLL REVEAL (Animaciones de entrada) */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Animations */
@keyframes pulse {
  0% {
    transform: translateX(-50%) scale(1);
    box-shadow: 0 2px 10px rgba(51, 153, 255, 0.1);
  }
  50% {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 4px 20px rgba(51, 153, 255, 0.25);
  }
  100% {
    transform: translateX(-50%) scale(1);
    box-shadow: 0 2px 10px rgba(51, 153, 255, 0.1);
  }
}

/* Animación del indicador de escritura de chat Hami AI */
@keyframes chatDotBounce {
  0%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-6px);
  }
}

/* Responsive Grid Adjustments */
@media (max-width: 968px) {
  html {
    font-size: 15px;
  }
  
  .nav-menu {
    gap: 1.2rem;
  }
  
  .hero {
    padding-top: 8rem;
    min-height: auto;
  }
  
  .hero .section-container {
    grid-template-columns: 1fr !important;
    gap: 3rem !important;
    text-align: center;
  }
  
  .hero-content {
    max-width: 100% !important;
    margin: 0 auto !important;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .cta-group {
    justify-content: center;
  }
  
  .servicios-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .babylon-container {
    height: 350px;
    order: -1;
  }
  
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  /* Portal responsivo de dos columnas */
  .portal-container {
    grid-template-columns: 1fr !important;
    padding: 2rem 1.5rem !important;
    gap: 2.5rem !important;
  }

  #col-register, #col-success {
    border-right: none !important;
    border-bottom: 1px solid var(--color-border);
    padding-right: 0 !important;
    padding-bottom: 2.5rem !important;
  }

  #col-login {
    padding-left: 0 !important;
    padding-top: 1rem;
  }

  .modules-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Colapso de secciones Simulador, Dashboard y Calculadora */
  .simulador-layout, .dashboard-grid, .calc-layout {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }
}

/* Custom styles for select option styling */
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2rem;
  padding-right: 2.5rem;
}

body.dark-theme select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Dashboard status updates */
#dash-project-status {
  transition: all 0.3s ease;
}

/* Checklist customization */
.tasks-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text-main);
  transition: color 0.2s ease;
  user-select: none;
}

.tasks-checklist input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--color-border);
  background-color: var(--bg-secondary);
  cursor: pointer;
  appearance: none;
  display: grid;
  place-content: center;
  transition: all 0.2s ease;
  margin-top: 2px;
  flex-shrink: 0;
}

.tasks-checklist input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em var(--bg-primary);
  background-color: CanvasText;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.tasks-checklist input[type="checkbox"]:checked {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.tasks-checklist input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.tasks-checklist input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.tasks-checklist label:hover {
  color: var(--color-primary);
}

.tasks-checklist label.completed {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

/* Estilos para la Factura Simulada (factura001) */
.invoice-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, background-color 0.4s ease, border-color 0.4s ease !important;
}

body.dark-theme .invoice-card {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

.invoice-card table th {
  border-bottom: 2px solid var(--color-border);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.invoice-card table td {
  padding: 8px 0;
  border-bottom: 1px dashed var(--color-border);
  font-size: 0.8rem;
}

.invoice-card table tr:last-child td {
  border-bottom: none;
}

/* Botones de Cantidad (+ / -) en el simulador */
.btn-qty {
  transition: var(--transition-smooth) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.btn-qty:hover {
  background-color: var(--color-primary) !important;
  color: #FFFFFF !important;
  border-color: var(--color-primary) !important;
  transform: scale(1.1);
}

.btn-qty:active {
  transform: scale(0.95);
}

.simulador-controls {
  transition: var(--transition-theme);
}

body.dark-theme .simulador-controls {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

/* Estilo para los ítems de la lista de productos */
#invoice-product-inputs > div {
  transition: border-color 0.3s ease;
}

body.dark-theme #invoice-product-inputs > div {
  border-bottom-color: #334155 !important;
}

/* Animación para la cinta de clientes */
@keyframes scroll-ribbon {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-33.33%);
  }
}

/* Estilos visuales de las tarjetas de módulos (Ecosistema Hami) */
.module-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(51, 153, 255, 0.3) !important;
}

body.dark-theme .module-card {
  background-color: var(--bg-secondary) !important;
  border-color: var(--color-border) !important;
}

body.dark-theme .module-card:hover {
  border-color: rgba(51, 153, 255, 0.4) !important;
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.5) !important;
}

/* =========================================================================
   ESTILOS DE MENÚ HAMBURGUESA PARA DISPOSITIVOS MÓVILES
   ========================================================================= */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1025;
  flex-shrink: 0;
}

.mobile-menu-btn span {
  width: 100%;
  height: 2px;
  background-color: var(--color-text-main);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: left center;
}

/* Animación a X al abrir */
.mobile-menu-btn.open span:first-child {
  transform: rotate(45deg) translate(1px, -1px);
}

.mobile-menu-btn.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-btn.open span:last-child {
  transform: rotate(-45deg) translate(1px, 1px);
}

@media (max-width: 1024px) {
  .mobile-menu-btn {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 290px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.25rem;
    padding: 3rem;
    z-index: 1015;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  body.dark-theme .nav-menu {
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.4);
    border-left: 1px solid var(--color-border);
  }

  .nav-menu.open {
    right: 0;
  }

  .nav-menu li {
    width: 100%;
    text-align: center;
  }

  .nav-link {
    font-size: 1.15rem;
    display: block;
    padding: 0.5rem 0;
  }

  /* Desactivar línea inferior de nav-links en móvil y usar hover de color */
  .nav-link::after {
    display: none !important;
  }
}

/* =========================================================================
   ESTILOS PREMIUM PARA INPUT RANGE (DESLIZADORES CALCULADORA)
   ========================================================================= */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--color-border);
  border-radius: 5px;
  outline: none;
  transition: background 0.3s;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  border-radius: 5px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 2px 6px rgba(51, 153, 255, 0.4);
  transition: transform 0.1s, background-color 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--color-primary-dark);
}

body.dark-theme input[type="range"]::-webkit-slider-thumb {
  background: #00D2FF;
  box-shadow: 0 2px 6px rgba(0, 210, 255, 0.4);
}

body.dark-theme input[type="range"]::-webkit-slider-thumb:hover {
  background: #00b4db;
}

/* Adaptabilidad móvil del widget de chat AI */
@media (max-width: 480px) {
  .hami-chat-widget {
    bottom: 1rem !important;
    right: 1rem !important;
  }
  
  #chat-box {
    width: calc(100vw - 2rem) !important;
    max-width: 360px !important;
    height: 420px !important;
    bottom: 70px !important;
  }
}

/* =========================================================================
   CARRUSEL HORIZONTAL DE MÓDULOS EN CELULARES (EFECTO SLIDER)
   ========================================================================= */
@media (max-width: 768px) {
  .modules-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
    gap: 1.25rem !important;
    padding: 0.5rem 1rem 1.5rem 1rem !important;
    margin-left: -1rem !important;
    margin-right: -1rem !important;
    margin-top: 2rem !important;
    scrollbar-width: none; /* Firefox */
  }

  .modules-grid::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }

  .module-card {
    flex: 0 0 85% !important;
    max-width: 85% !important;
    scroll-snap-align: center !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
    padding: 1.75rem 1.5rem !important;
    text-align: left !important;
    display: flex !important;
    border-radius: var(--border-radius-md) !important;
    background: var(--bg-secondary) !important;
    box-shadow: var(--shadow-sm) !important;
  }

  .module-card .module-icon {
    width: 48px !important;
    height: 48px !important;
    margin-bottom: 0.25rem !important;
  }

  .swipe-indicator {
    display: flex !important;
    animation: swipePulse 2s infinite ease-in-out;
  }
}

@keyframes swipePulse {
  0%, 100% {
    transform: translateX(0);
    opacity: 0.7;
  }
  50% {
    transform: translateX(6px);
    opacity: 1;
  }
}
}

/* =========================================================================
   ESTILOS DE MENÚ DESPLEGABLE (DROPDOWN) - EMPRESA E INDUSTRIAS
   ========================================================================= */
.nav-dropdown-item {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 320px;
  background: var(--bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.75rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1050;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  backdrop-filter: blur(10px);
}

.nav-dropdown-item:hover .dropdown-menu,
.nav-dropdown-item.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateX(-50%) translateY(5px);
}

.nav-dropdown-item:hover .dropdown-arrow,
.nav-dropdown-item.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-link {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  color: var(--color-text-main);
  transition: var(--transition-smooth);
}

.dropdown-link:hover {
  background: var(--bg-primary);
  color: var(--color-primary);
}

.dropdown-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.dropdown-link strong {
  font-size: 0.9rem;
  display: block;
  margin-bottom: 2px;
}

.dropdown-link p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.3;
}

/* --- ESTILOS DE SUB-DESPLEGABLE (SUB-DROPDOWN) --- */
.nav-subdropdown-item {
  position: relative;
}

.subdropdown-menu {
  position: absolute;
  top: 0;
  left: 100%;
  transform: translateX(10px);
  width: 210px;
  background: var(--bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1060;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  backdrop-filter: blur(10px);
}

.nav-subdropdown-item:hover .subdropdown-menu,
.nav-subdropdown-item.open .subdropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateX(5px);
}

.nav-subdropdown-item:hover .subdropdown-arrow,
.nav-subdropdown-item.open .subdropdown-arrow {
  transform: rotate(90deg);
}

.subdropdown-link {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  color: var(--color-text-main);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.subdropdown-link:hover {
  background: var(--bg-primary);
  color: var(--color-primary);
}

/* --- ADAPTABILIDAD RESPONSIVA PARA CELULARES (DROPDOWN ACORDEÓN) --- */
@media (max-width: 1024px) {
  .dropdown-menu, .subdropdown-menu {
    position: static !important;
    width: 100% !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
    display: none;
    padding: 0.5rem 1rem !important;
    background: transparent !important;
  }

  .nav-dropdown-item.open .dropdown-menu {
    display: flex !important;
  }

  .nav-subdropdown-item.open .subdropdown-menu {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* Dos columnas en móvil para ahorrar espacio */
    gap: 0.5rem !important;
  }

  .dropdown-link {
    padding: 0.5rem !important;
  }
  
  .subdropdown-link {
    padding: 0.4rem 0.5rem !important;
    font-size: 0.8rem !important;
    text-align: left !important;
  }

  .subdropdown-arrow {
    transform: rotate(90deg) !important;
  }

  .nav-dropdown-item.open .dropdown-arrow {
    transform: rotate(180deg) !important;
  }

  .nav-subdropdown-item.open .subdropdown-arrow {
    transform: rotate(270deg) !important;
  }
}

/* =========================================================================
   ESTILOS ADICIONALES PARA EL PANEL FULL-SCREEN DE EMPRESA
   ========================================================================= */
.segment-card:hover, .industry-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary) !important;
  box-shadow: var(--shadow-md) !important;
}

body.dark-theme .segment-card, body.dark-theme .industry-card {
  background-color: var(--bg-secondary) !important;
}

#close-empresa-panel-btn:hover {
  transform: rotate(90deg) scale(1.05);
  background: var(--bg-primary);
  color: var(--color-primary);
}

@media (max-width: 968px) {
  .empresa-panel-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }
}

@media (max-width: 600px) {
  .industrias-panel-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
  
  #empresa-page-panel {
    padding: 3rem 1rem !important;
  }
}

/* =========================================================================
   17. ESTILOS INTERACTIVOS ONBOARDING DASHBOARD
   ========================================================================= */
.onboarding-tab-btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}
.onboarding-tab-btn:hover {
  background: rgba(51, 153, 255, 0.05) !important;
  color: var(--color-primary) !important;
}
.onboarding-tab-btn.active {
  background: rgba(51, 153, 255, 0.1) !important;
  color: var(--color-primary) !important;
}

/* Switch Toggle */
.onboard-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
.onboard-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.onboard-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-border);
  transition: .4s;
  border-radius: 34px;
}
.onboard-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .onboard-slider {
  background-color: var(--color-primary);
}
input:checked + .onboard-slider:before {
  transform: translateX(24px);
}

@media (max-width: 968px) {
  .onboarding-dashboard-layout {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
}

/* =========================================================================
   COOKIE CONSENT BANNER (PROFESSIONAL DESIGN)
   ========================================================================= */
.cookie-banner {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

body.dark-theme .cookie-banner {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cookie-banner.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.cookie-content {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.cookie-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
  animation: cookie-wiggle 3s ease infinite;
}

@keyframes cookie-wiggle {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-8deg); }
  20%, 40% { transform: rotate(8deg); }
  50% { transform: rotate(0deg); }
}

.cookie-text {
  font-size: 0.925rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin: 0;
}

body.dark-theme .cookie-text {
  color: #94a3b8;
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.cookie-btn {
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.cookie-btn-primary {
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(51, 153, 255, 0.2);
}

.cookie-btn-primary:hover {
  background: #1a88ff;
  border-color: #1a88ff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(51, 153, 255, 0.3);
}

.cookie-btn-primary:active {
  transform: translateY(0);
}

.cookie-btn-secondary {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
}

.cookie-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--color-text-muted);
}

body.dark-theme .cookie-btn-secondary {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--color-text-main);
}

body.dark-theme .cookie-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #94a3b8;
}

/* BOTÓN TRIGGER FLOTANTE (REABRIR PREFERENCIAS) */
.cookie-trigger {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 9998;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-theme .cookie-trigger {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cookie-trigger:hover {
  background: rgba(255, 255, 255, 1);
  border-color: var(--color-primary);
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

body.dark-theme .cookie-trigger:hover {
  background: rgba(15, 23, 42, 1);
}

.cookie-trigger.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

@media (max-width: 576px) {
  .cookie-banner {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
    padding: 1.25rem;
    z-index: 10050; /* Por encima de todo en móvil */
  }

  .cookie-trigger {
    bottom: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    z-index: 10049;
  }
}
