/* ============================================
   KITE-DM CUSTOM STYLES - Modern Design System
   ============================================ */

/* ================
   DESIGN TOKENS
   ================ */

:root {
  /* Primary Blues */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-300: #93c5fd;
  --blue-500: #0066cc;
  --blue-600: #0052a3;
  --blue-700: #004080;
  --blue-900: #002952;

  /* Warm Accent */
  --accent-400: #ff8c42;
  --accent-500: #ff6b35;
  --accent-600: #e65525;

  /* Neutral Grays */
  --gray-50: #fafbfc;
  --gray-100: #f5f7fa;
  --gray-200: #e8ecf1;
  --gray-300: #dce1e7;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Semantic Colors */
  --success: #10b981;
  --whatsapp: #25d366;

  /* Legacy Support */
  --primary-color: var(--blue-500);
  --secondary-color: var(--accent-500);
  --text-dark: var(--gray-800);
  --text-light: var(--gray-600);
  --bg-light: var(--gray-50);
  --border-color: var(--gray-200);

  /* Spacing Scale */
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.5rem;     /* 24px */
  --space-6: 2rem;       /* 32px */
  --space-8: 3rem;       /* 48px */
  --space-10: 4rem;      /* 64px */
  --space-12: 6rem;      /* 96px */

  /* Border Radius */
  --radius-sm: 0.375rem;   /* 6px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;

  /* Shadows (Elevation System) */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);

  /* Branded Shadows */
  --shadow-primary: 0 4px 14px rgba(0, 102, 204, 0.15);
  --shadow-primary-lg: 0 10px 25px rgba(0, 102, 204, 0.2);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */

  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 1.75;

  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ================
   BASE STYLES
   ================ */

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--gray-700);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Hierarchy */
h1, .h1 {
  font-size: clamp(2.5rem, 5vw, var(--text-5xl));
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--gray-900);
  margin-bottom: var(--space-4);
}

h2, .h2 {
  font-size: clamp(2rem, 4vw, var(--text-4xl));
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--gray-900);
  margin-bottom: var(--space-3);
}

h3, .h3 {
  font-size: clamp(1.5rem, 3vw, var(--text-3xl));
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  color: var(--gray-800);
  margin-bottom: var(--space-3);
}

h4, .h4 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  color: var(--gray-800);
}

h5, .h5 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--gray-700);
}

h6, .h6 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--gray-700);
}

.lead {
  font-size: var(--text-xl);
  line-height: var(--leading-loose);
  color: var(--gray-600);
}

/* ================
   MODULAR SECTIONS
   ================ */

.modular-section {
  scroll-margin-top: 80px;
  padding: var(--space-10) 0;
}

.modular-section:nth-child(even) {
  background-color: var(--gray-50);
}

/* ================
   HERO SECTION
   ================ */

.hero {
  position: relative;
  min-height: clamp(500px, 70vh, 900px);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  color: white;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 102, 204, 0.9) 0%,
    rgba(0, 61, 122, 0.85) 50%,
    rgba(0, 40, 80, 0.9) 100%
  );
  backdrop-filter: blur(2px);
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: var(--space-4);
}

.hero h2 {
  color: rgba(255, 255, 255, 0.95);
  font-weight: var(--font-normal);
  margin-bottom: var(--space-6);
}

/* ================
   HEADER & NAVIGATION
   ================ */

.top-bar {
  font-size: var(--text-sm);
  background: var(--gray-900);
}

.navbar-brand {
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  font-weight: var(--font-bold);
  color: var(--blue-600) !important;
  transition: transform var(--transition-fast);
}

.navbar-brand:hover {
  transform: scale(1.02);
}

.navbar-light .navbar-nav .nav-link {
  position: relative;
  color: var(--gray-700);
  font-weight: var(--font-medium);
  padding: var(--space-2) var(--space-4);
  transition: color var(--transition-base);
}

.navbar-light .navbar-nav .nav-link:not(.dropdown-toggle)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--blue-500);
  transition: width var(--transition-base);
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link.active {
  color: var(--blue-600);
}

.navbar-light .navbar-nav .nav-link:not(.dropdown-toggle):hover::after,
.navbar-light .navbar-nav .nav-link:not(.dropdown-toggle).active::after {
  width: 60%;
}

.navbar-light .navbar-nav .nav-link:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* ================
   PRODUCT CARDS
   ================ */

.producto-card {
  height: 100%;
  border: none;
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-slow) cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
}

.producto-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-primary-lg), var(--shadow-md);
}

.card-img-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--gray-100);
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.producto-card:hover .card-img-wrapper img {
  transform: scale(1.08);
}

.placeholder-img {
  aspect-ratio: 4 / 3;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-badges {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.card-badges .badge {
  backdrop-filter: blur(12px) saturate(180%);
  background: rgba(255, 255, 255, 0.95);
  color: var(--gray-800);
  font-weight: var(--font-semibold);
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-badges .badge.bg-success {
  background: rgba(16, 185, 129, 0.95);
  color: white;
}

.card-badges .badge.bg-warning {
  background: rgba(245, 158, 11, 0.95);
  color: white;
}

.producto-card .card-body {
  padding: var(--space-5);
}

.producto-card .card-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--gray-900);
  margin-bottom: var(--space-2);
}

/* ================
   BUTTONS
   ================ */

.btn {
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  transition: all var(--transition-base);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
  color: white;
  box-shadow: var(--shadow-primary), var(--shadow-xs);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-700) 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary-lg), var(--shadow-sm);
  color: white;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-primary:focus-visible {
  outline: 3px solid rgba(0, 102, 204, 0.4);
  outline-offset: 2px;
}

.btn-success {
  background: linear-gradient(135deg, var(--whatsapp) 0%, #1fb855 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}

.btn-success:hover {
  background: linear-gradient(135deg, #1fb855 0%, #17a347 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
  color: white;
}

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

.btn-lg {
  padding: 1rem 2rem;
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

/* ================
   WHATSAPP FLOAT BUTTON
   ================ */

.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.whatsapp-float .btn {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--whatsapp);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  animation: pulse 3s infinite cubic-bezier(0.4, 0, 0.6, 1);
  transition: all var(--transition-base);
}

.whatsapp-float .btn:hover {
  background: #1fb855;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0),
                0 0 0 20px rgba(37, 211, 102, 0);
  }
}

/* ================
   FOOTER
   ================ */

.footer {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  position: relative;
  color: var(--gray-300);
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1) 50%,
    transparent
  );
}

.footer h5,
.footer h6 {
  color: #f8fafc;
  font-weight: var(--font-bold);
  letter-spacing: var(--tracking-wide);
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
}

.footer a {
  color: var(--gray-300);
  text-decoration: none;
  transition: all var(--transition-base);
  position: relative;
  display: inline-block;
}

.footer a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--blue-400);
  transition: width var(--transition-base);
}

.footer a:hover {
  color: var(--blue-400);
}

.footer a:hover::after {
  width: 100%;
}

/* ================
   UTILITY CLASSES
   ================ */

.text-primary {
  color: var(--blue-500) !important;
}

.bg-primary {
  background-color: var(--blue-500) !important;
}

.shadow-sm {
  box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
  box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
  box-shadow: var(--shadow-lg) !important;
}

/* ================
   ANIMATIONS
   ================ */

@media (prefers-reduced-motion: no-preference) {
  .fade-in {
    animation: fadeIn 0.6s ease-in;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================
   RESPONSIVE
   ================ */

@media (max-width: 1200px) {
  :root {
    --text-5xl: 2.5rem;
    --text-4xl: 2rem;
  }
}

@media (max-width: 992px) {
  .modular-section {
    padding: var(--space-8) 0;
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: clamp(400px, 60vh, 700px);
  }

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

  .hero h2 {
    font-size: 1.25rem;
  }

  .whatsapp-float .btn {
    width: 50px;
    height: 50px;
  }

  .navbar-brand {
    font-size: 1.5rem;
  }

  .btn {
    padding: 0.625rem 1.25rem;
  }

  .btn-lg {
    padding: 0.875rem 1.75rem;
  }
}

@media (max-width: 576px) {
  :root {
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
  }

  .modular-section {
    padding: var(--space-6) 0;
  }

  .producto-card .card-body {
    padding: var(--space-4);
  }
}

/* Touch devices - larger tap targets */
@media (pointer: coarse) {
  .btn,
  .nav-link,
  a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
