/* Fuentes: Poppins (Títulos) e Inter (Textos) */
:root {
    /* --- Light Theme --- */
    --bg-main: #f8fafc;
    --bg-alt: #ffffff;
    --bg-card: #ffffff;
    --bg-header: transparent; 
    
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --card-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --brand-primary: #3b82f6;
    --brand-primary-hover: #2563eb;
    --brand-accent: #d9167e;
    --warning: #f59e0b;
    
    --search-bg: #f1f5f9;
    --search-text: #111827;
    
    --hero-gradient: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
    
    --tab-inactive-bg: #e2e8f0;
    --tab-inactive-text: #4b5563;
    --tab-active-bg: linear-gradient(90deg, #3b82f6, #6366f1);
}

body.dark-theme {
    /* --- Dark Theme --- */
    --bg-main: #181f2b;
    --bg-alt: #181f2b;
    --bg-card: #212a39;
    --bg-header: #181f2b; 
    
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: transparent;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    --card-hover: 0 10px 30px rgba(0, 0, 0, 0.4);
    
    --brand-primary: #3b82f6;
    --brand-primary-hover: #60a5fa;
    
    --search-bg: #1e293b;
    --search-text: #ffffff;
    
    --hero-gradient: radial-gradient(circle at top center, #1e2b42 0%, var(--bg-main) 70%);
    
    --tab-inactive-bg: #263243;
    --tab-inactive-text: #64748b;
    --tab-active-bg: linear-gradient(90deg, #4b83fb, #685cfb);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: background-color 0.4s, color 0.4s;
    line-height: 1.5;
    padding-top: 72px; 
}

h1, h2, h3, h4, .logo-text, .btn-primary, .btn-ghost, .netzun-tab { font-family: 'Poppins', sans-serif; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* --- Header --- */
header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
}
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 72px; }
.nav-left { display: flex; align-items: center; gap: 32px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 800; color: var(--text-primary); text-decoration: none; letter-spacing: -0.5px; }

.main-nav { display: flex; gap: 24px; margin-left: 20px; }
.main-nav a { color: var(--text-primary); text-decoration: none; font-weight: 500; font-size: 15px; transition: color 0.3s ease, transform 0.2s; }
.main-nav a:hover { color: var(--brand-primary); transform: translateY(-2px); }

/* --- Buscador Predictivo --- */
.search-bar {
    background: var(--search-bg);
    border-radius: 8px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1; 
    margin: 0 30px; 
    max-width: 400px;
    border: 1px solid rgba(255,255,255,0.05);
    position: relative;
}
.search-bar input { background: transparent; border: none; outline: none; color: var(--search-text); width: 100%; font-size: 14px; font-family: 'Inter', sans-serif; }

.search-results-dropdown { position: absolute; top: calc(100% + 8px); left: 0; width: 100%; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--card-hover); z-index: 1001; display: none; flex-direction: column; overflow: hidden; }
.search-results-dropdown.active { display: flex; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; text-decoration: none; color: var(--text-primary); transition: background 0.2s ease; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
body.light-theme .search-item { border-bottom-color: var(--border-color); }
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--search-bg); }
.search-item-img { width: 45px; height: 45px; border-radius: 8px; object-fit: cover; background-color: var(--search-bg); }
.search-item-info { flex: 1; overflow: hidden; }
.search-item-info h4 { font-size: 13px; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item-info span { font-size: 10px; font-weight: 800; color: var(--brand-primary); text-transform: uppercase; letter-spacing: 0.5px; }
.no-results { padding: 16px; text-align: center; font-size: 13px; color: var(--text-secondary); }

.nav-right { display: flex; align-items: center; gap: 20px; }
.theme-btn, .cart-btn { background: none; border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer; transition: color 0.3s; }
.theme-btn:hover, .cart-btn:hover { color: var(--brand-primary); }

.btn-primary { background: var(--brand-primary); color: white; padding: 10px 24px; border-radius: 6px; font-weight: 600; font-size: 14px; text-decoration: none; transition: all 0.3s; display: inline-block; text-align: center; }
.btn-primary:hover { background: var(--brand-primary-hover); }
.btn-ghost { color: var(--text-primary); font-weight: 600; font-size: 14px; text-decoration: none; }
.menu-toggle { display: none; font-size: 24px; cursor: pointer; color: var(--text-primary); }

/* --- Hero --- */
.hero { padding: 80px 0; background: var(--hero-gradient); }
.hero-container { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.badge-new { display: inline-block; background: rgba(59, 130, 246, 0.1); color: var(--brand-primary); padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; margin-bottom: 20px; border: 1px solid rgba(59, 130, 246, 0.2); }
.hero-title { font-size: 48px; font-weight: 800; line-height: 1.15; margin-bottom: 20px; }
.hero-title span { color: var(--brand-primary); }
.hero-subtitle { color: var(--text-secondary); font-size: 18px; margin-bottom: 40px; }
.hero-actions { display: flex; align-items: center; gap: 24px; }
.hero-stats { display: flex; gap: 16px; font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.stat i { color: #fbbf24; }

.hero-image { background-image: url('assets/picture/profesionales.jpeg'); background-size: cover; background-position: center; height: 400px; border-radius: 24px; position: relative; box-shadow: var(--card-shadow); overflow: hidden; }

@keyframes floatAnimation { 0% { transform: translateY(0px); } 50% { transform: translateY(-12px); } 100% { transform: translateY(0px); } }
.floating-card { position: absolute; background: rgba(33, 42, 57, 0.9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 14px 18px; border-radius: 12px; display: flex; align-items: center; gap: 14px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.05); z-index: 10; animation: floatAnimation 4s ease-in-out infinite; transition: all 0.3s ease; }
body.light-theme .floating-card { background: rgba(255, 255, 255, 0.9); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08); }
.floating-card h4 { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px; }
.floating-card p { font-size: 11px; color: var(--text-secondary); }
.floating-card:hover { transform: scale(1.05) translateY(-5px) !important; box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3); animation-play-state: paused; z-index: 20; }
.icon-wrapper { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 20px; }

.card-1 { top: 10%; left: -25px; animation-delay: 0s; }
.card-2 { bottom: 15%; right: -25px; animation-delay: 1.5s; }
.card-3 { bottom: 10%; left: -15px; animation-delay: 0.7s; }
.card-4 { top: 20%; right: -15px; animation-delay: 2.2s; }

/* --- Cursos --- */
.courses-section { padding: 80px 0; }
.section-header { margin-bottom: 40px; }
.section-header h2 { font-size: 32px; font-weight: 700; margin-bottom: 10px; }
.center-header { text-align: center; margin-bottom: 50px; }
.center-header h2 { font-size: 36px; margin-bottom: 30px; }

.netzun-tabs { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap;}
.netzun-tab { background: var(--tab-inactive-bg); color: var(--tab-inactive-text); border: none; padding: 14px 40px; border-radius: 100px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.netzun-tab:hover { color: var(--text-primary); }
.netzun-tab.active { background: var(--tab-active-bg); color: white; box-shadow: 0 4px 15px rgba(75, 131, 251, 0.4); }

.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.course-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; transition: all 0.3s; box-shadow: var(--card-shadow); display: flex; flex-direction: column; cursor: pointer;}
.course-card:hover { transform: translateY(-8px); box-shadow: var(--card-hover); }

.course-img { height: 180px; position: relative; background-size: cover; background-position: center; }
.badge-tag { position: absolute; top: 0; left: 0; color: white; font-size: 10px; font-weight: 800; padding: 6px 12px; border-bottom-right-radius: 10px; letter-spacing: 0.5px; z-index: 2;}
.pink-tag { background: #ff2a70; }
.gold-tag { background: #f59e0b; }

.course-body { padding: 24px 20px; display: flex; flex-direction: column; flex-grow: 1; }

.category-tag { font-size: 11px; font-weight: 700; padding: 6px 12px; border-radius: 6px; display: inline-block; margin-bottom: 16px; color: white; align-self: flex-start; text-transform: uppercase; letter-spacing: 0.5px; }
.category-tag.blue { background: #3b82f6; }
.category-tag.teal { background: #14b8a6; }
.category-tag.purple { background: #8b5cf6; } 
.category-tag.orange { background: #f97316; }

.course-title { font-size: 22px; font-weight: 800; margin-bottom: 16px; color: var(--text-primary); line-height: 1.25; font-family: 'Poppins', sans-serif; }
.course-description { font-size: 15px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; font-weight: 400; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }

.course-footer-info { margin-top: auto; display: flex; justify-content: space-between; align-items: center; color: var(--text-secondary); font-size: 13px; font-weight: 500; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.05); }
body.light-theme .course-footer-info { border-top-color: #e2e8f0; }
.course-rating i { color: #fbbf24; margin-right: 4px; }

/* --- Estilos de Precio y Botón Mágico --- */
.course-price-container { margin-top: 16px; padding-top: 16px; border-top: 1px dashed rgba(255, 255, 255, 0.1); display: flex; flex-direction: column; gap: 10px; }
body.light-theme .course-price-container { border-top-color: var(--border-color); }
.price-original { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.old-price { color: var(--text-muted); text-decoration: line-through; }
.discount { color: #ef4444; font-weight: 700; }

.btn-buy-course { 
    width: 100%; 
    background-color: #6a74f4; 
    color: white; border: none; padding: 10px; border-radius: 8px; 
    font-size: 16px; font-weight: 700; cursor: pointer; 
    display: flex; justify-content: center; align-items: center; gap: 8px; 
    transition: all 0.3s ease; font-family: 'Poppins', sans-serif; 
}

/* Configuramos el texto a cambiar */
.btn-text-hover { display: none; }

/* HOVER EFFECT: Cuando se pasa el mouse por la tarjeta, el botón se pone verde */
.course-card:hover .btn-buy-course,
.btn-buy-course:hover { 
    background-color: #25D366 !important; 
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.course-card:hover .btn-text-default,
.btn-buy-course:hover .btn-text-default { 
    display: none; 
}

.course-card:hover .btn-text-hover,
.btn-buy-course:hover .btn-text-hover { 
    display: inline !important; 
}

/* --- CTA --- */
.cta-section { padding: 80px 0; background: var(--bg-main); }
.cta-container { background-image: linear-gradient(90deg, rgb(7 30 63 / 80%) 0%, rgb(40 43 175 / 80%) 100%), url(assets/picture/profesionales-cta.jpeg); background-size: cover; background-position: center; background-repeat: no-repeat; border-radius: 24px; padding: 80px 40px; text-align: center; color: white; box-shadow: var(--card-shadow); }
.cta-content h2 { font-size: 36px; margin-bottom: 20px; color: white; }
.cta-content p { font-size: 18px; margin-bottom: 40px; opacity: 0.95; max-width: 650px; margin-left: auto; margin-right: auto; }
.btn-orange { background-color: var(--warning); border: 1px solid var(--warning); color: white; padding: 10px 24px; border-radius: 6px; transition: background-color 0.3s ease, border-color 0.3s ease; }
.btn-orange:hover, .cta-container .btn-ghost.btn-orange:hover { background-color: #d18706; border-color: #d18706; color: white; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* --- Contacto Vertical --- */
.contact-section { padding: 100px 0; background-color: var(--bg-alt); }
.contact-container-vertical { max-width: 800px; margin: 0 auto; text-align: center; }
.contact-header-centered h2 { font-size: 36px; font-weight: 800; margin-bottom: 16px; }
.contact-header-centered p { color: var(--text-secondary); font-size: 18px; margin-bottom: 40px; }
.contact-main-image { width: 100%; max-height: 400px; border-radius: 24px; overflow: hidden; margin-bottom: 30px; box-shadow: var(--card-shadow); border: 1px solid var(--border-color); }
.support-img-large { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.contact-main-image:hover .support-img-large { transform: scale(1.05); }
.contact-chat-action { background: var(--bg-card); padding: 40px; border-radius: 24px; box-shadow: var(--card-shadow); border: 1px solid var(--border-color); }
.contact-phones { display: flex; justify-content: center; gap: 30px; margin-bottom: 25px; flex-wrap: wrap; }
.phone-item { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text-primary); }
.phone-item i { color: var(--brand-primary); }
.btn-whatsapp-large { display: inline-flex; align-items: center; justify-content: center; gap: 15px; background-color: #25D366; color: white; padding: 18px 45px; border-radius: 12px; font-size: 20px; font-weight: 700; text-decoration: none; transition: all 0.3s ease; box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3); width: 100%; max-width: 500px; }
.btn-whatsapp-large:hover { background-color: #1ebe57; transform: translateY(-5px); box-shadow: 0 15px 30px rgba(37, 211, 102, 0.4); color: white; }
.contact-meta { margin-top: 15px; font-size: 14px; color: var(--text-muted); font-style: italic; }

/* --- MODAL ESTRECHO --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px);
    display: none; justify-content: center; align-items: center;
    z-index: 2000; padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal-container {
    background: var(--bg-card);
    width: 100%; max-width: 380px; 
    max-height: 95vh;
    border-radius: 16px; position: relative;
    overflow-y: auto; overflow-x: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalAppear 0.3s ease-out; padding: 0; 
}

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

.close-modal {
    position: absolute; top: 15px; right: 15px;
    background: rgba(33, 42, 57, 0.8); backdrop-filter: blur(4px);
    border: none; font-size: 22px; color: white;
    width: 36px; height: 36px; border-radius: 50%;
    cursor: pointer; z-index: 100; display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.close-modal:hover { background: #ef4444; }

.modal-header-img { width: 100%; height: 220px; background-size: cover; background-position: center; position: relative; }
.modal-info { padding: 24px; }
.modal-info h2 { font-size: 26px; font-weight: 800; margin-bottom: 16px; line-height: 1.2; }
.modal-info .full-description { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; }

.modal-footer-stats {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 0; border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px dashed rgba(255,255,255,0.1); margin-bottom: 20px;
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
}
body.light-theme .modal-footer-stats { border-top-color: var(--border-color); border-bottom-color: var(--border-color); }

/* --- Footer --- */
footer { background: var(--bg-main); padding: 60px 0 20px; border-top: 1px solid rgba(255,255,255,0.05); }
body.light-theme footer { border-top-color: #e2e8f0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand p { color: var(--text-secondary); margin-top: 15px; font-size: 14px;}
.footer-links h4 { margin-bottom: 20px; font-size: 16px;}
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: var(--text-secondary); text-decoration: none; font-size: 14px; transition: color 0.2s;}
.footer-links a:hover { color: var(--brand-primary); }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 20px; font-size: 14px; color: var(--text-muted); }
body.light-theme .footer-bottom { border-top-color: #e2e8f0; }

/* --- Lógica de Logos --- */
.img-logo-dark { display: none; }
.img-logo-light { display: block; max-height: 50px; width: auto; }
body.dark-theme .img-logo-light { display: none; }
body.dark-theme .img-logo-dark { display: block; max-height: 50px; width: auto; }

/* --- Responsive Mejorado --- */
@media (max-width: 1024px) {
    .main-nav { display: none; position: absolute; top: 72px; left: 0; width: 100%; background: var(--bg-header); flex-direction: column; padding: 20px; border-bottom: 1px solid var(--border-color); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
    .main-nav.active { display: flex; }
    .menu-toggle { display: block; }
    .hide-mobile { display: none; }
    .search-bar { margin: 0 10px; }
    .card-1 { top: -20px; left: 10px; }
    .card-2 { bottom: -20px; right: 10px; }
    .card-3, .card-4 { display: none; }
}
@media (max-width: 768px) {
    .search-bar { display: none; }
    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-actions { justify-content: center; flex-direction: column; }
    .netzun-tabs { flex-direction: column; padding: 0 20px; }
    .contact-grid { grid-template-columns: 1fr; gap: 40px; }
    .footer-grid { grid-template-columns: 1fr; }
    .floating-card { display: none; }
}