/*
Theme Name: KAP Theme
Theme URI: https://kapasesorias.cl
Author: Administrador
Description: Tema personalizado One-Page SaaS para KAP Asesorías
Version: 2.0
Text Domain: kap-theme
*/

:root {
  --primary: #0057B8;
  --primary-light: #e6f0fa;
  --secondary: #004b99;
  --text: #004085;
  --text-light: #335c85;
  --bg: rgba(255, 255, 255, 0.82);
  --bg-alt: rgba(235, 244, 255, 0.70);
  --border: #e2e8f0;
  --accent: #00b4d8;
  --footer-bg: #001529;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --radius: 12px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 { color: var(--secondary); font-weight: 600; line-height: 1.2; }
a { text-decoration: none; color: var(--primary); transition: all 0.3s ease; }
a:hover { color: var(--accent); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
.section-padding { padding: 100px 0; }
.bg-alt { background-color: var(--bg-alt); }
.tag { background: var(--primary-light); color: var(--primary); font-size: 0.8rem; font-weight: 600; padding: 6px 12px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px; }
.grid { display: grid; gap: 32px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px;}
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 32px;}

.animate-on-scroll { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.animate-visible { opacity: 1; transform: translateY(0); }

/* Header */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--bg);
  z-index: 1000;
  transition: all 0.3s ease;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.site-header.scrolled {
  padding: 15px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.site-header.scrolled .site-logo img {
  max-height: 45px;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.site-logo img { max-height: 75px; width: auto; object-fit: contain; transition: all 0.3s ease; }
.main-nav ul { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; align-items: center; }
.main-nav a { color: var(--text); font-weight: 500; font-size: 0.95rem; padding: 6px 14px; border-radius: 24px; transition: all 0.3s ease; white-space: nowrap; }
.main-nav a:hover, .main-nav a.active { background: var(--primary-light); color: var(--primary); }
.portal-btn {
  background: var(--primary);
  color: #fff !important;
  padding: 8px 24px;
  border-radius: 24px;
  font-weight: 600;
  margin-left: 10px;
  box-shadow: 0 4px 14px rgba(0,87,184,0.3);
  transition: all 0.3s ease;
}
.portal-btn:hover { background: var(--secondary); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,87,184,0.4); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 28px; border-radius: 8px; font-weight: 500; font-size: 1rem; transition: all 0.3s ease; cursor: pointer; border: none; }
.btn-primary { background: var(--primary); color: #fff !important; box-shadow: 0 4px 14px rgba(0,87,184,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,87,184,0.4); }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.btn-outline { border: 2px solid var(--border); color: var(--secondary) !important; background: transparent; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary) !important; }

/* Loader Spinner */
.spinner { animation: rotate 2s linear infinite; z-index: 2; width: 20px; height: 20px; vertical-align: middle; margin-right: 8px; }
.spinner .path { stroke: #ffffff; stroke-linecap: round; animation: dash 1.5s ease-in-out infinite; }
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash { 
  0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; } 
  50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; } 
  100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; } 
}
.btn-loader { display: inline-flex; align-items: center; }

/* Hero */
.hero { padding: 180px 0 100px; display: flex; align-items: center; min-height: 100vh; }
.hero-subtitle { display: inline-block; font-size: 1.5rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px; }
.hero h1 { font-size: 3.5rem; margin-bottom: 20px; letter-spacing: -1px; }
.hero h1 span { color: var(--primary); }
.hero p { font-size: 1.25rem; color: var(--text-light); margin-bottom: 40px; font-weight: 300; }
.hero-btns { display: flex; gap: 16px; }
.hero-image img { max-width: 90%; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); margin-left: auto; display: block; }

/* Sections */
.section-header { text-align: center; margin-bottom: 60px; max-width: 600px; margin-inline: auto; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 16px; }

/* About */
.about-hybrid { align-items: center; }
.about-text h3 { font-size: 2rem; margin-bottom: 20px; }
.about-text p { text-align: justify; }
.mv-cards { display: flex; flex-direction: column; gap: 20px; }
.mv-card { background: var(--bg); border: 1px solid var(--border); padding: 32px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.mv-card h4 { display: flex; align-items: center; gap: 10px; color: var(--primary); font-size: 1.3rem; margin-top: 0; }
.mv-card p { text-align: justify; }
.values-grid { margin-top: 60px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; border-top: 1px solid var(--border); padding-top: 60px; }
.value-item h5 { margin: 0 0 8px 0; font-size: 1.1rem; color: var(--secondary); }

/* Why Choose Us (Stats) */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; text-align: center; }
.stat-card { padding: 32px; background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.stat-num { font-size: 2.5rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.stat-text { font-weight: 500; color: var(--secondary); margin-bottom: 8px; }

/* Services Cards */
.service-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; transition: all 0.3s ease; display: flex; flex-direction: column; }
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.service-icon { width: 48px; height: 48px; background: var(--primary-light); color: var(--primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; font-size: 24px; }
.service-card h3 { font-size: 1.25rem; margin-top: 0; margin-bottom: 12px; color: var(--secondary); }
.service-card p { color: var(--text-light); font-size: 0.95rem; flex: 1; margin-bottom: 24px; }
.service-card .btn { width: 100%; }

/* Modals */
dialog { border: none; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 0; max-width: 600px; width: 90%; margin: auto; backdrop-filter: blur(4px); }
dialog::backdrop { background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); }
.modal-content { padding: 40px; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.modal-header h3 { margin: 0; font-size: 1.5rem; color: var(--secondary); }
.btn-close-modal { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-light); transition: color 0.3s; }

/* Process Timeline */
.process-timeline { display: flex; flex-direction: column; gap: 20px; max-width: 800px; margin: 0 auto; }
.process-step { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; align-items: center; gap: 24px; }
.step-num { width: 50px; height: 50px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; font-weight: 700; flex-shrink: 0; }
.step-content h4 { margin: 0 0 8px 0; font-size: 1.2rem; }

/* Logos & Gallery */
.logos-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; align-items: center; margin-bottom: 60px; }
.logos-row img { max-width: 140px; max-height: 70px; width: auto; height: auto; object-fit: contain; opacity: 0.5; transition: all 0.3s ease; }
.logos-row img:hover { opacity: 1; }
.gallery-placeholder { background: var(--border); border-radius: var(--radius); padding: 60px; text-align: center; color: var(--text-light); border: 2px dashed #cbd5e1; }

/* Contact Section */
.contact-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; }
.contact-form { background: var(--bg); padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow-md); border: 1px solid var(--border); }
.form-group { margin-bottom: 24px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.95rem; }
.form-control { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 1rem; background: var(--bg-alt); }
.contact-card { background: var(--bg-alt); padding: 40px; border-radius: var(--radius); border: 1px solid var(--border); }
.profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.profile-img { width: 64px; height: 64px; border-radius: 50%; background: #ddd; object-fit: cover; }
.profile-info h4 { margin: 0 0 4px 0; font-size: 1.2rem; }
.contact-details { list-style: none; padding: 0; margin: 0 0 32px 0; }
.contact-details li { margin-bottom: 16px; display: flex; gap: 12px; }
.contact-details svg { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; margin-top: 4px; }
.btn-whatsapp { background: #25D366; color: white !important; width: 100%; border: none; }
.btn-whatsapp:hover { background: #1ebd5a; box-shadow: 0 4px 14px rgba(37,211,102,0.3); }

/* Gallery Carousel */
.gallery-carousel-wrapper { position: relative; max-width: 1000px; margin: 0 auto; }
.carousel-main-container { position: relative; display: flex; align-items: center; justify-content: center; background: #f4f7fb; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px; }
.carousel-track-container { overflow: hidden; width: 100%; max-height: 500px; }
.carousel-track { display: flex; transition: transform 0.4s ease-in-out; list-style: none; padding: 0; margin: 0; height: 100%; align-items: center; }
.carousel-slide { min-width: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.carousel-slide img { max-width: 100%; max-height: 500px; object-fit: contain; border-radius: 8px; box-shadow: var(--shadow); }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,87,184, 0.8); color: white; border: none; font-size: 1.5rem; width: 50px; height: 50px; cursor: pointer; z-index: 10; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background 0.3s; }
.carousel-btn:hover { background: var(--primary); }
.prev-btn { left: 10px; }
.next-btn { right: 10px; }

/* Thumbnails */
.carousel-thumbnails { display: flex; gap: 12px; overflow-x: auto; padding: 10px 4px; scrollbar-width: thin; scroll-behavior: smooth; }
.carousel-thumbnails::-webkit-scrollbar { height: 8px; }
.carousel-thumbnails::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.thumbnail-item { flex: 0 0 120px; height: 80px; cursor: pointer; border: 3px solid transparent; border-radius: 8px; overflow: hidden; opacity: 0.5; transition: all 0.3s; }
.thumbnail-item img { width: 100%; height: 100%; object-fit: cover; }
.thumbnail-item:hover, .thumbnail-item.active { opacity: 1; border-color: var(--secondary); }

/* Social Links */
.social-links { display: flex; gap: 12px; margin: 16px 0; }
.social-links a { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--primary-light); color: var(--primary); border-radius: 50%; transition: all 0.3s; }
.social-links a:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

.footer-social .social-links a { background: rgba(255,255,255,0.1); color: #fff; }
.footer-social .social-links a:hover { background: var(--accent); color: #fff; }

/* Floating WhatsApp */
.wa-floating { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background: #25D366; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); z-index: 1000; transition: transform 0.3s; }
.wa-floating:hover { transform: scale(1.1); }
.wa-floating svg { width: 32px; height: 32px; fill: currentColor; }

/* Footer */
.site-footer { background: var(--footer-bg); color: #fff; padding: 80px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 60px; }
.footer-brand p { color: #a0aec0; margin-top: 16px; max-width: 400px; }
.footer-links h4 { color: #fff; margin-top: 0; margin-bottom: 24px; font-size: 1.1rem; }
.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: #a0aec0; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; display: flex; justify-content: space-between; color: #a0aec0; font-size: 0.9rem; }

/* Nav Globo (Móvil) */
.nav-globo-wrapper { display: none; }
.nav-globo-btn { position: fixed; bottom: 30px; left: 30px; width: 60px; height: 60px; background: var(--primary); color: white; border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); z-index: 1001; cursor: pointer; transition: transform 0.3s, background 0.3s; }
.nav-globo-btn:hover, .nav-globo-btn.active { background: var(--secondary); transform: scale(1.05); }
.globo-menu { position: fixed; bottom: 100px; left: 30px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 0; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(20px) scale(0.95); transform-origin: bottom left; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 1000; min-width: 200px; }
.globo-menu.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.globo-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.globo-menu a { display: block; padding: 12px 24px; color: var(--text); font-weight: 500; font-size: 0.95rem; border-bottom: 1px solid var(--border); }
.globo-menu a:last-child { border-bottom: none; }
.globo-menu a:hover, .globo-menu a.active { background: var(--primary-light); color: var(--primary); padding-left: 30px; }

/* Responsive Adjustments */
@media (max-width: 992px) {
  .hero h1 { font-size: 2.8rem; }
  .grid-2, .grid-3, .grid-4 { gap: 24px; }
  .section-padding { padding: 80px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Ocultar menú normal y mostrar Globo */
  .main-nav { display: none; }
  .nav-globo-wrapper { display: block; }
  
  /* Ajustes Generales */
  .section-padding { padding: 60px 0; }
  .hero { flex-direction: column; text-align: center; padding-top: 120px; min-height: auto; }
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: 1.1rem; }
  .hero-btns { flex-direction: column; width: 100%; align-items: stretch; }
  .hero-btns .btn { width: 100%; margin-bottom: 12px; }
  .hero-image img { margin: 20px auto 0; }
  
  /* Grillas */
  .grid-2, .grid-3, .grid-4, .contact-grid, .footer-grid { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }
  
  /* Footer Mobile */
  .site-footer { padding-bottom: 120px; }
  .footer-grid { gap: 48px; text-align: center; }
  .footer-brand p { margin: 16px auto; }
  .footer-social .social-links { justify-content: center; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 16px; }
  
  /* Modal y utilidades */
  .modal-content { padding: 24px; }
  .logos-row { gap: 20px; }
  .logos-row img { max-width: 100px; max-height: 50px; }
  .carousel-slide img { max-height: 300px; }
}
