/* ===== VALCONTROL - SISTEMA DE DISEÑO UNIFICADO ===== */

/* ===== VARIABLES CSS ===== */
:root {
  /* Colores principales */
  --primary: #0071e3;
  --primary-dark: #0056b3;
  --primary-light: #4a9eff;
  --secondary: #1c5f9b;
  --secondary-dark: #134a7a;
  --secondary-light: #4a7cbd;
  
  /* Colores de fondo */
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-dark: #1d1d1f;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-dark: rgba(30, 30, 32, 0.7);
  
  /* Colores de texto */
  --text-primary: #1d1d1f;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --text-white: #ffffff;
  
  /* Colores de estado */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  
  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-glass: 0 0 0 1px rgba(255, 255, 255, 0.8) inset, 0 10px 32px 0 rgba(31, 38, 135, 0.15);
  --shadow-glass-dark: 0 0 0 1px rgba(0, 0, 0, 0.1) inset, 0 10px 32px 0 rgba(0, 0, 0, 0.1);
  
  /* Espaciado */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;
  
  /* Bordes */
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
  --border-radius-2xl: 1.5rem;
  --border-radius-3xl: 2rem;
  
  /* Transiciones */
  --transition-fast: 0.15s ease-out;
  --transition-normal: 0.3s ease-out;
  --transition-slow: 0.5s ease-out;
  
  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
}

/* ===== RESET Y BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TIPOGRAFÍA ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.875rem); }
h5 { font-size: clamp(1.125rem, 2vw, 1.5rem); }
h6 { font-size: clamp(1rem, 1.5vw, 1.25rem); }

p {
  margin-bottom: var(--spacing-md);
  color: var(--text-secondary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

/* ===== COMPONENTES BASE ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.section {
  padding: var(--spacing-3xl) 0;
}

.section-title {
  position: relative;
  display: inline-block;
  margin-bottom: var(--spacing-2xl);
  text-align: center;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

.gradient-text {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== GLASSMORPHISM ===== */
.glass-header {
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-lg);
  min-height: 90px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--border-radius-2xl);
  box-shadow: var(--shadow-glass);
  transition: all var(--transition-normal) cubic-bezier(0.165, 0.84, 0.44, 1);
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.glass-card-dark {
  background: var(--bg-glass-dark);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius-2xl);
  box-shadow: var(--shadow-glass-dark);
  color: var(--text-white);
}

/* ===== BOTONES ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md) var(--spacing-xl);
  border: none;
  border-radius: var(--border-radius-xl);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
  min-height: 48px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--text-white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: var(--text-white);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 2px solid transparent;
}

.btn-ghost:hover {
  background: var(--primary);
  color: var(--text-white);
}

/* ===== TARJETAS 3D FLIP ===== */
.flip-3d {
  perspective: 1000px;
  height: 420px;
  cursor: pointer;
}

.flip-3d__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform var(--transition-slow);
}

.flip-3d.is-flipped .flip-3d__inner {
  transform: rotateY(180deg);
}

.flip-3d__face {
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius-2xl);
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flip-3d__back {
  transform: rotateY(180deg);
  color: var(--text-white);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* ===== MEDIA PRODUCTO ===== */
.product-media {
  width: var(--media-size, 120px);
  height: var(--media-size, 120px);
  aspect-ratio: 1/1;
}

.product-media img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: var(--image-fit, contain);
  transform: scale(var(--image-scale, 1));
}

.product-media.has-image img {
  display: block;
}

.product-media .placeholder {
  display: flex;
}

.product-media.has-image .placeholder {
  display: none;
}

/* ===== ANIMACIONES ===== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes slideUp {
  0% { transform: translateY(40px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
  40%, 43% { transform: translate3d(0,-30px,0); }
  70% { transform: translate3d(0,-15px,0); }
  90% { transform: translate3d(0,-4px,0); }
}

.animate-float { animation: float 6s ease-in-out infinite; }
.animate-fade-in { animation: fadeIn 0.8s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.8s ease-out forwards; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-bounce { animation: bounce 1s infinite; }

/* ===== BOTÓN WHATSAPP ===== */
#whatsapp-button {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  color: var(--text-white);
  background: linear-gradient(135deg, #25D366, #128C7E);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  transition: all var(--transition-normal) cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: var(--z-toast);
  animation: float 4s ease-in-out infinite;
}

#whatsapp-button:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
}

/* ===== BARRAS DE PROGRESO ===== */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.05);
  z-index: var(--z-fixed);
}

.progress-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width var(--transition-fast) ease;
}

/* ===== FORMULARIOS ===== */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--spacing-md);
  border: 2px solid var(--text-light);
  border-radius: var(--border-radius-lg);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  font-size: 1rem;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-light);
}

/* ===== UTILIDADES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }
.mb-6 { margin-bottom: var(--spacing-2xl); }
.mb-8 { margin-bottom: var(--spacing-3xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }
.mt-6 { margin-top: var(--spacing-2xl); }
.mt-8 { margin-top: var(--spacing-3xl); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1023px) {
  .scrolly-sticky-visual {
    position: relative;
    top: auto;
    height: 400px;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
  }
  
  .visual-element {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out, visibility 0s 0.6s;
    border-radius: var(--border-radius-2xl);
    overflow: hidden;
  }
  
  .visual-element.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--spacing-md);
  }
  
  .section {
    padding: var(--spacing-2xl) 0;
  }
  
  .btn {
    padding: var(--spacing-md) var(--spacing-lg);
    min-height: 44px;
  }
  
  #whatsapp-button {
    width: 56px;
    height: 56px;
    font-size: 1.75rem;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  .section {
    padding: var(--spacing-xl) 0;
  }
  
  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    min-height: 40px;
    font-size: 0.875rem;
  }
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .flip-3d__inner {
    transition: none !important;
  }
  
  .animate-float,
  .animate-fade-in,
  .animate-slide-up {
    animation: none !important;
  }
}

/* ===== FOCUS VISIBLE ===== */
.btn:focus-visible,
.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== SKIP LINKS ===== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary);
  color: var(--text-white);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  z-index: var(--z-modal);
}

.skip-link:focus {
  top: 6px;
}

/* ===== LOADING STATES ===== */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ===== TOOLTIPS ===== */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: var(--bg-dark);
  color: var(--text-white);
  text-align: center;
  border-radius: var(--border-radius-md);
  padding: var(--spacing-sm);
  position: absolute;
  z-index: var(--z-tooltip);
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ===== SCROLLBAR PERSONALIZADA ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: var(--border-radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}
