/*
Theme Name: Khauta OTTM
Theme URI: https://khauta.com
Author: Khauta
Author URI: https://khauta.com
Description: Tema profesional para Khauta - Operador Tecnológico de Trazabilidad Minera (OTTM)
Version: 14.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: khauta-ottm
Tags: mining, traceability, corporate, startup
*/

/* ===== DESIGN SYSTEM ===== */
:root {
  /* Brand Colors */
  --kh-primary: #0f172a;
  --kh-primary-light: #1e293b;
  --kh-accent: #2563eb;
  --kh-accent-hover: #1d4ed8;
  --kh-accent-light: #3b82f6;
  --kh-accent-glow: rgba(37,99,235,0.15);
  --kh-success: #10b981;
  --kh-warning: #f59e0b;
  --kh-danger: #ef4444;
  
  /* Neutrals */
  --kh-white: #ffffff;
  --kh-gray-50: #f8fafc;
  --kh-gray-100: #f1f5f9;
  --kh-gray-200: #e2e8f0;
  --kh-gray-300: #cbd5e1;
  --kh-gray-400: #94a3b8;
  --kh-gray-500: #64748b;
  --kh-gray-600: #475569;
  --kh-gray-700: #334155;
  --kh-gray-800: #1e293b;
  --kh-gray-900: #0f172a;
  
  /* Typography */
  --kh-font-heading: 'Space Grotesk', sans-serif;
  --kh-font-body: 'Inter', sans-serif;
  
  /* Spacing */
  --kh-section-py: 80px;
  --kh-container-max: 1200px;
  
  /* Shadows */
  --kh-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --kh-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --kh-shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1);
  --kh-shadow-xl: 0 20px 50px -12px rgba(0,0,0,0.15);
  --kh-shadow-accent: 0 4px 14px rgba(37,99,235,0.35);
  
  /* Radius */
  --kh-radius-sm: 6px;
  --kh-radius-md: 10px;
  --kh-radius-lg: 16px;
  --kh-radius-xl: 24px;
  --kh-radius-full: 9999px;
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--kh-font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--kh-gray-700);
  background: var(--kh-white);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--kh-font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--kh-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

a { color: var(--kh-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--kh-accent-hover); }

img { max-width: 100%; height: auto; display: block; }

/* ===== CONTAINER ===== */
.kh-container {
  max-width: var(--kh-container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== BUTTONS ===== */
.kh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--kh-font-heading);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  border: none;
  border-radius: var(--kh-radius-md);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.kh-btn-sm { padding: 10px 20px; font-size: 14px; }
.kh-btn-md { padding: 12px 28px; }
.kh-btn-lg { padding: 16px 36px; font-size: 16px; }
.kh-btn-xl { padding: 18px 44px; font-size: 17px; min-height: 56px; }

.kh-btn-primary {
  background: var(--kh-accent);
  color: var(--kh-white);
  box-shadow: var(--kh-shadow-accent);
}
.kh-btn-primary:hover {
  background: var(--kh-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37,99,235,0.4);
  color: var(--kh-white);
}

.kh-btn-outline {
  background: transparent;
  color: var(--kh-white);
  border: 2px solid rgba(255,255,255,0.4);
}
.kh-btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--kh-white);
  color: var(--kh-white);
}

.kh-btn-ghost {
  background: transparent;
  color: var(--kh-accent);
  border: 2px solid var(--kh-accent);
}
.kh-btn-ghost:hover {
  background: var(--kh-accent);
  color: var(--kh-white);
}

/* Shimmer effect */
.kh-btn-shimmer { position: relative; overflow: hidden; }
.kh-btn-shimmer::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: kh-shimmer 3s infinite;
}
@keyframes kh-shimmer { to { left: 100%; } }

/* ===== HEADER ===== */
.kh-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: all 0.3s;
}

.kh-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 72px;
  max-width: var(--kh-container-max);
  margin: 0 auto;
}

.kh-logo img {
  height: 40px;
  max-width: 180px;
  width: auto;
  object-fit: contain;
}

.kh-nav { display: flex; align-items: center; gap: 32px; }
.kh-nav a {
  color: rgba(255,255,255,0.75);
  font-family: var(--kh-font-body);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.kh-nav a:hover { color: var(--kh-white); }

.kh-header-actions { display: flex; align-items: center; gap: 12px; }

/* Mobile menu */
.kh-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--kh-white);
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .kh-mobile-toggle { display: block; }
  .kh-nav { 
    display: none;
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: var(--kh-primary);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
  }
  .kh-nav.active { display: flex; }
  .kh-header-actions .kh-btn { display: none; }
}

/* ===== SECTIONS ===== */
.kh-section {
  padding: var(--kh-section-py) 0;
}

.kh-section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px;
}

.kh-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--kh-accent-glow);
  color: var(--kh-accent);
  font-family: var(--kh-font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--kh-radius-full);
  margin-bottom: 16px;
}

.kh-section-header h2 { margin-bottom: 16px; }

.kh-section-header p {
  font-size: 17px;
  color: var(--kh-gray-500);
  line-height: 1.7;
}

/* ===== HERO SLIDER ===== */
.kh-hero-slider {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
}
@media (min-width: 768px) { .kh-hero-slider { height: 600px; } }
@media (min-width: 1024px) { .kh-hero-slider { height: 700px; } }

.kh-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}
.kh-slide.active { opacity: 1; }
.kh-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 8s ease-out;
}
.kh-slide.active img { transform: scale(1.05); }

.kh-hero-slider .kh-slider-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.2) 100%);
  z-index: 1;
}

.kh-slider-content {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 2; text-align: center; padding: 0 16px;
}
.kh-slider-content h2 {
  font-size: 1.875rem; font-weight: 700; color: #fff;
  margin-bottom: 16px; text-shadow: 0 4px 12px rgba(0,0,0,0.5);
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.kh-slide.active .kh-slider-content h2 { opacity: 1; transform: translateY(0); }
@media (min-width: 768px) { .kh-slider-content h2 { font-size: 3rem; } }
@media (min-width: 1024px) { .kh-slider-content h2 { font-size: 3.75rem; } }

.kh-slider-content p {
  font-size: 1.125rem; color: rgba(255,255,255,0.9);
  margin-bottom: 32px; max-width: 768px; margin-left: auto; margin-right: auto;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.7s ease-out 0.1s, transform 0.7s ease-out 0.1s;
}
.kh-slide.active .kh-slider-content p { opacity: 1; transform: translateY(0); }
@media (min-width: 768px) { .kh-slider-content p { font-size: 1.25rem; } }
@media (min-width: 1024px) { .kh-slider-content p { font-size: 1.5rem; } }

.kh-slider-cta {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.7s ease-out 0.2s, transform 0.7s ease-out 0.2s;
}
.kh-slide.active .kh-slider-cta { opacity: 1; transform: translateY(0); }
.kh-slider-cta .kh-btn {
  font-size: 1.125rem; padding: 14px 32px;
}

/* Slider Navigation */
.kh-slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 10; background: transparent; border: none; color: #fff;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.kh-slider-arrow:hover { background: rgba(255,255,255,0.2); }
.kh-slider-arrow.prev { left: 16px; }
.kh-slider-arrow.next { right: 16px; }
.kh-slider-arrow svg { width: 24px; height: 24px; }

/* Dots */
.kh-slider-dots {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  z-index: 10; display: flex; gap: 4px; align-items: center;
}
.kh-slider-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.4); border: none; cursor: pointer;
  transition: background 0.5s;
}
.kh-slider-dot.active { background: #fff; }
.kh-slider-dot-progress {
  width: 24px; height: 2px; background: rgba(255,255,255,0.3);
  border-radius: 2px; overflow: hidden; margin-top: 4px;
}
.kh-slider-dot-progress-bar {
  height: 100%; background: #fff; border-radius: 2px; width: 0;
}
@keyframes kh-dot-progress { from { width: 0; } to { width: 100%; } }

/* Bottom progress bar */
.kh-slider-progress {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 4px; background: rgba(255,255,255,0.1); z-index: 10;
}
.kh-slider-progress-bar {
  height: 100%; background: var(--kh-primary, #1e3a5f);
  transition: width 0.5s ease-out;
}

/* ===== CARD GRID ===== */
.kh-grid { display: grid; gap: 24px; }
.kh-grid-2 { grid-template-columns: repeat(2, 1fr); }
.kh-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kh-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) { .kh-grid-3, .kh-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .kh-grid-2, .kh-grid-3, .kh-grid-4 { grid-template-columns: 1fr; } }

.kh-card {
  background: var(--kh-white);
  border: 1px solid var(--kh-gray-200);
  border-radius: var(--kh-radius-lg);
  padding: 32px;
  transition: all 0.3s;
}
.kh-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--kh-shadow-lg);
  border-color: var(--kh-accent);
}

.kh-card-icon {
  width: 52px; height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--kh-accent-glow);
  color: var(--kh-accent);
  border-radius: var(--kh-radius-md);
  font-size: 24px;
  margin-bottom: 20px;
}

.kh-card h4 { margin-bottom: 10px; }
.kh-card p { font-size: 15px; color: var(--kh-gray-500); margin: 0; }

/* ===== AUDIENCE SECTION ===== */
.kh-audience { background: var(--kh-gray-50); }

/* ===== PRICING ===== */
.kh-pricing-card {
  background: var(--kh-white);
  border: 2px solid var(--kh-gray-200);
  border-radius: var(--kh-radius-lg);
  padding: 40px 32px;
  text-align: center;
  transition: all 0.3s;
  position: relative;
}
.kh-pricing-card.featured {
  border-color: var(--kh-accent);
  transform: scale(1.03);
  box-shadow: var(--kh-shadow-xl);
}
.kh-pricing-card.featured::before {
  content: 'Más popular';
  position: absolute;
  top: -14px; left: 50%;
  transform: translateX(-50%);
  background: var(--kh-accent);
  color: var(--kh-white);
  padding: 4px 20px;
  border-radius: var(--kh-radius-full);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--kh-font-heading);
}

.kh-price {
  font-family: var(--kh-font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--kh-primary);
  margin: 16px 0 8px;
}
.kh-price-period {
  font-size: 14px;
  color: var(--kh-gray-400);
  font-weight: 400;
}

.kh-pricing-features {
  list-style: none;
  text-align: left;
  margin: 24px 0;
}
.kh-pricing-features li {
  padding: 8px 0;
  font-size: 14px;
  color: var(--kh-gray-600);
  display: flex;
  align-items: center;
  gap: 10px;
}
.kh-pricing-features li::before {
  content: '✓';
  color: var(--kh-success);
  font-weight: 700;
  font-size: 16px;
}

/* ===== TESTIMONIALS ===== */
.kh-testimonials { background: var(--kh-gray-50); }

.kh-testimonial-card {
  background: var(--kh-white);
  border: 1px solid var(--kh-gray-200);
  border-radius: var(--kh-radius-lg);
  padding: 32px;
}

.kh-testimonial-stars { color: var(--kh-warning); font-size: 18px; margin-bottom: 16px; }
.kh-testimonial-card blockquote {
  font-size: 15px;
  color: var(--kh-gray-600);
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 20px;
}
.kh-testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.kh-testimonial-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--kh-accent-glow);
  color: var(--kh-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--kh-font-heading);
  font-weight: 700;
  font-size: 16px;
}
.kh-testimonial-name { font-weight: 600; font-size: 14px; color: var(--kh-primary); }
.kh-testimonial-role { font-size: 13px; color: var(--kh-gray-400); }

/* ===== CTA SECTION ===== */
.kh-cta {
  background: linear-gradient(135deg, var(--kh-primary) 0%, #1a2744 100%);
  padding: 80px 0;
  text-align: center;
}
.kh-cta h2 { color: var(--kh-white); margin-bottom: 16px; }
.kh-cta p { color: rgba(255,255,255,0.7); font-size: 18px; max-width: 560px; margin: 0 auto 36px; }

/* ===== FOOTER ===== */
.kh-footer {
  background: var(--kh-primary);
  color: rgba(255,255,255,0.6);
  padding: 64px 0 0;
}

.kh-footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

@media (max-width: 768px) {
  .kh-footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

.kh-footer-brand p { font-size: 14px; line-height: 1.7; margin-top: 16px; }
.kh-footer-brand img { height: 36px; object-fit: contain; }

.kh-footer h4 {
  color: var(--kh-white);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.kh-footer ul { list-style: none; }
.kh-footer ul li { margin-bottom: 10px; }
.kh-footer ul a {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  transition: color 0.2s;
}
.kh-footer ul a:hover { color: var(--kh-accent-light); }

.kh-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

@media (max-width: 576px) {
  .kh-footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ===== LEGAL PAGES ===== */
.kh-legal {
  padding-top: 120px;
  padding-bottom: 80px;
}

.kh-legal-header {
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 2px solid var(--kh-gray-200);
}

.kh-legal-header h1 { margin-bottom: 12px; }

.kh-legal-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  color: var(--kh-gray-400);
  font-size: 14px;
}

.kh-legal-content {
  max-width: 800px;
  margin: 0 auto;
}

.kh-legal-content h2 {
  font-size: 1.5rem;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--kh-gray-200);
}

.kh-legal-content h3 {
  font-size: 1.15rem;
  margin-top: 28px;
  margin-bottom: 12px;
}

.kh-legal-content p,
.kh-legal-content li {
  font-size: 15px;
  color: var(--kh-gray-600);
  line-height: 1.8;
}

.kh-legal-content ul,
.kh-legal-content ol {
  margin: 12px 0 20px 24px;
}

.kh-legal-content li { margin-bottom: 8px; }

.kh-legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.kh-legal-content th,
.kh-legal-content td {
  border: 1px solid var(--kh-gray-200);
  padding: 12px 16px;
  text-align: left;
}

.kh-legal-content th {
  background: var(--kh-gray-50);
  font-weight: 600;
  color: var(--kh-primary);
}

/* ===== PARTNERS ===== */
.kh-partners-track {
  display: flex;
  gap: 48px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 20px 0;
}

.kh-partner-logo {
  height: 40px;
  opacity: 0.5;
  filter: grayscale(1);
  transition: all 0.3s;
}
.kh-partner-logo:hover { opacity: 1; filter: none; }

/* ===== EVENTS ===== */
.kh-event-card {
  background: var(--kh-white);
  border: 1px solid var(--kh-gray-200);
  border-radius: var(--kh-radius-lg);
  overflow: hidden;
  transition: all 0.3s;
}
.kh-event-card:hover { transform: translateY(-4px); box-shadow: var(--kh-shadow-lg); }

.kh-event-date {
  background: var(--kh-accent);
  color: var(--kh-white);
  padding: 16px;
  text-align: center;
  font-family: var(--kh-font-heading);
}
.kh-event-date .day { font-size: 2rem; font-weight: 800; line-height: 1; }
.kh-event-date .month { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }

.kh-event-info { padding: 20px; }
.kh-event-info h4 { font-size: 16px; margin-bottom: 6px; }
.kh-event-info p { font-size: 13px; color: var(--kh-gray-500); margin: 0; }

/* ===== ANIMATIONS ===== */
.kh-fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.kh-fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.kh-whatsapp-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: #25d366; width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(37,211,102,0.4); transition: transform 0.2s;
}
.kh-whatsapp-float:hover { transform: scale(1.1); }
.kh-partners-grid {
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; align-items: center;
}
.kh-partner-item {
  background: var(--kh-gray-50); border-radius: var(--kh-radius-md);
  padding: 16px 24px; display: flex; align-items: center; justify-content: center;
  min-height: 80px; min-width: 160px;
}
.kh-partner-item img { max-height: 48px; width: auto; filter: grayscale(100%); opacity: 0.7; transition: all 0.3s; }
.kh-partner-item:hover img { filter: grayscale(0%); opacity: 1; }
.kh-partner-name { font-family: var(--kh-font-heading); font-weight: 600; color: var(--kh-gray-500); }
