/**
 * Estilos del Frontend
 * Sistema de Venta de Cursos Online
 */

:root {
    /* Paleta cursostienda.com — primary morado oscuro + accent naranja del logo */
    --primary: #28036a;            /* Morado regio del logo (texto principal del logo) */
    --primary-dark: #1a0247;       /* Morado más oscuro (hover de primary) */
    --primary-soft: #f1ebff;       /* Morado muy claro para fondos sutiles */
    --secondary: #4a1a8c;          /* Morado intermedio (variante para gradients) */
    --accent: #ff6600;             /* Naranja del logo (CTAs, highlights, energía) */
    --accent-dark: #e55a00;        /* Hover del accent */
    --accent-soft: #fff0e6;        /* Naranja muy claro para fondos */

    --success: #22c55e;
    --danger:  #ef4444;
    --warning: #f59e0b;
    --info:    #0ea5e9;

    --dark:  #1a0247;
    --light: #f7f3fc;

    /* Grises tibios (con tinte morado muy sutil) */
    --gray-50:  #faf9fb;
    --gray-100: #f3f1f6;
    --gray-200: #e7e3ed;
    --gray-300: #cdc8d4;
    --gray-400: #9d96a8;
    --gray-500: #71697e;
    --gray-600: #524a5e;
    --gray-700: #38324a;
    --gray-800: #221b35;
    --gray-900: #120a26;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Gradients premium */
    --gradient-primary: linear-gradient(135deg, #28036a 0%, #4a1a8c 100%);
    --gradient-hero:    linear-gradient(135deg, #28036a 0%, #4a1a8c 50%, #ff6600 100%);
    --gradient-accent:  linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    --gradient-cta:     linear-gradient(135deg, #ff6600 0%, #e55a00 100%);

    /* Sombras refinadas (más sutiles que default Bootstrap) */
    --shadow-xs: 0 1px 2px rgba(40,3,106,0.04);
    --shadow-sm: 0 2px 4px rgba(40,3,106,0.06), 0 1px 2px rgba(40,3,106,0.04);
    --shadow:    0 4px 12px rgba(40,3,106,0.08), 0 2px 4px rgba(40,3,106,0.04);
    --shadow-md: 0 8px 24px rgba(40,3,106,0.10), 0 4px 8px rgba(40,3,106,0.05);
    --shadow-lg: 0 16px 40px rgba(40,3,106,0.12), 0 8px 16px rgba(40,3,106,0.06);
    --shadow-xl: 0 24px 56px rgba(40,3,106,0.18), 0 12px 24px rgba(40,3,106,0.08);
    --shadow-glow: 0 0 0 4px rgba(255,102,0,0.15);

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-700);
    background-color: #fff;
}

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

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

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

/* =====================================================
   HEADER
   ===================================================== */

.site-header {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 0 rgba(40,3,106,0.06);
    position: sticky;
    top: 0;
    z-index: 1030;       /* z-index estándar Bootstrap para sticky-top */
    transition: box-shadow 0.2s;
}
/* El dropdown del navbar debe quedar arriba de cualquier contenido del body */
.site-header .dropdown-menu { z-index: 1031; }
.site-header.scrolled {
    box-shadow: var(--shadow-sm);
}

.navbar {
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--dark) !important;
    transition: transform 0.2s;
}
.navbar-brand:hover { transform: translateY(-1px); }

.brand-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
}

.nav-link {
    color: var(--gray-700) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    position: relative;
    transition: color 0.15s;
}
/* Underline animado naranja al hover. EXCLUIR .dropdown-toggle (Bootstrap usa
   ::after para el caret triangulito; sobreescribirlo deja un punto visible). */
.nav-link:not(.dropdown-toggle)::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0.25rem;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.25s, left 0.25s;
    pointer-events: none;
}
.nav-link:hover {
    color: var(--primary) !important;
}
.nav-link:not(.dropdown-toggle):hover::after {
    width: calc(100% - 2rem);
    left: 1rem;
}

.dropdown-menu {
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-top: 0.5rem !important;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    color: var(--gray-700);
    font-weight: 500;
    transition: all 0.15s;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--primary-soft);
    color: var(--primary);
}

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

.hero-section {
    background: var(--gradient-hero);
    position: relative;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
/* Patrón decorativo sutil de puntos en hero (defensa visual cuando no hay bg-image) */
.hero-section::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(40,3,106,0.78) 0%, rgba(26,2,71,0.92) 100%);
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.min-vh-75 { min-height: 75vh; }

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.20);
}
.hero-title .highlight {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.92);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* .hero-cta es WRAPPER (NO botón). align-items-start + display:inline-flex
   evitan que el botón se estire al ancho de la columna. */
.hero-cta {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
}
/* El anchor que TAMBIÉN viene con clase .hero-cta heredada del template
   no debe ser flex container (eso lo expandía). */
a.hero-cta { display: inline-flex !important; align-items: center; width: auto; }
/* No override-amos padding del btn-lg: dejamos el default de Bootstrap. */

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

.section-header {
    margin-bottom: 3rem;
}

.section-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.section-title .highlight {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.section-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
}

/* =====================================================
   CATEGORY CARDS
   ===================================================== */

.category-card {
    display: block;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
}
.category-card > * { position: relative; z-index: 1; transition: color 0.3s; }
.category-card:hover {
    border-color: transparent;
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px);
}
.category-card:hover::before { opacity: 1; }
.category-card:hover .category-name,
.category-card:hover .category-count { color: #fff; }

.category-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-soft);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
    color: var(--primary);
    transition: all 0.3s;
}
.category-card:hover .category-icon {
    background: rgba(255,255,255,0.18);
    color: #fff;
    transform: scale(1.1) rotate(-5deg);
}

.category-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.category-count {
    font-size: 0.875rem;
    color: var(--gray-500);
}

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

.product-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s, border-color 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}
/* Línea de acento naranja arriba al hover */
.product-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-accent);
    opacity: 0;
    transition: opacity 0.25s;
    z-index: 2;
}
.product-card:hover::before { opacity: 1; }
.product-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-soft);
    transform: translateY(-6px);
}

.product-image {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    display: block;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--gray-400);
}

.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--gradient-accent);
    color: #fff;
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 12px rgba(255,102,0,0.32);
    z-index: 2;
}

.product-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-title a {
    color: var(--dark);
}

.product-title a:hover {
    color: var(--primary);
}

.product-excerpt {
    font-size: 0.9375rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
    flex: 1;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.product-price {
    display: flex;
    flex-direction: column;
}

.price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
}

.price-original {
    font-size: 0.875rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

.product-card-sm .product-body {
    padding: 1rem;
}

.product-card-sm .product-title {
    font-size: 1rem;
}

/* =====================================================
   BLOG CARDS
   ===================================================== */

.blog-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.blog-card:hover {
    box-shadow: var(--shadow-lg);
}

.blog-image {
    display: block;
    padding-top: 56.25%;
    position: relative;
    overflow: hidden;
}

.blog-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-image img {
    transform: scale(1.05);
}

.blog-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--gray-400);
}

.blog-body {
    padding: 1.5rem;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
}

.blog-category {
    color: var(--primary);
    font-weight: 600;
}

.blog-date {
    color: var(--gray-500);
}

.blog-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.blog-title a {
    color: var(--dark);
}

.blog-title a:hover {
    color: var(--primary);
}

.blog-excerpt {
    font-size: 0.9375rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.blog-link {
    font-weight: 600;
    font-size: 0.875rem;
}

/* Blog List Page */
.blog-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-pill {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: #fff;
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.category-pill:hover,
.category-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* =====================================================
   CTA SECTION
   ===================================================== */

.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
}

.cta-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cta-text {
    opacity: 0.9;
    margin-bottom: 0;
}

/* =====================================================
   BLOG POST
   ===================================================== */

.post-header {
    text-align: center;
}

.post-category {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--gray-500);
    font-size: 0.9375rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.post-featured-image {
    margin: -2rem auto 0;
    max-width: 900px;
}

.post-featured-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.post-excerpt {
    font-size: 1.25rem;
    color: var(--gray-600);
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
}

.post-body {
    font-size: 1.0625rem;
    line-height: 1.8;
}

.post-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.post-body h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--dark);
}

.post-body p {
    margin-bottom: 1.5rem;
}

.post-body img {
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.post-body ul, .post-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.post-body li {
    margin-bottom: 0.5rem;
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    transition: var(--transition);
}

.share-facebook { background: #1877f2; }
.share-twitter { background: #000; }
.share-linkedin { background: #0a66c2; }
.share-whatsapp { background: #25d366; }

.share-btn:hover {
    transform: translateY(-3px);
    color: #fff;
}

/* =====================================================
   CATEGORY PAGE
   ===================================================== */

.category-header {
    background: var(--gray-100);
    position: relative;
}

.category-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.category-description {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

/* =====================================================
   PAGE CONTENT (páginas estáticas: contacto, legales, etc.)
   ===================================================== */
.page-content {
    max-width: 100%;
    color: var(--gray-700, #334155);
    line-height: 1.7;
    font-size: 1rem;
}
.page-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900, #0f172a);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary, #6366f1);
    display: inline-block;
}
.page-content h2:first-child { margin-top: 0; }
.page-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--gray-900, #0f172a);
}
.page-content p { margin-bottom: 1rem; }
.page-content ul, .page-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.page-content li { margin-bottom: 0.4rem; }
.page-content a {
    color: var(--color-primary, #6366f1);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.page-content a:hover { color: var(--color-secondary, #4f46e5); }
.page-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.page-content table th,
.page-content table td {
    padding: 0.6rem 0.85rem;
    border: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}
.page-content table thead th {
    background: var(--gray-100, #f1f5f9);
    font-weight: 600;
    color: var(--gray-900, #0f172a);
}
.page-content table tbody tr:nth-child(odd) {
    background: #fafbfc;
}
.page-content .lead {
    font-size: 1.15rem;
    color: var(--gray-600, #475569);
    margin-bottom: 1.5rem;
}
.page-content .card {
    border: 1px solid #e9e9e7;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* =====================================================
   LOGOS (header + footer)
   ===================================================== */
.site-logo {
    height: 36px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: block;
}
@media (min-width: 992px) {
    .site-logo { height: 42px; max-width: 240px; }
}
@media (max-width: 575.98px) {
    .site-logo { height: 32px; max-width: 160px; }
}
.footer-logo {
    height: 48px;
    width: auto;
    max-width: 260px;
    object-fit: contain;
    display: block;
}
@media (max-width: 575.98px) {
    .footer-logo { height: 40px; max-width: 200px; }
}

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

.site-footer {
    background: #0f172a;            /* slate-900 más oscuro para contraste */
    color: #cbd5e1;                  /* gray-300, contrast 8.7:1 sobre slate-900 */
}
.site-footer p,
.site-footer span,
.site-footer li,
.site-footer .footer-text {
    color: #cbd5e1;
}
.site-footer .text-muted,
.site-footer .text-white-50 {
    color: #94a3b8 !important;       /* gray-400, contrast 5.8:1, accesible */
}

.footer-title {
    color: #fff;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.55rem;
}

.footer-links a {
    color: #cbd5e1;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-links a:hover,
.footer-links a:focus {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}
/* Iconos de contacto en el footer: mismo color que el texto */
.contact-info li i {
    color: #cbd5e1;       /* mismo color que el texto del footer */
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.contact-info li a { color: #cbd5e1; }
.contact-info li a:hover { color: #fff; }
.contact-info li a:hover + i,
.contact-info li:hover i { color: #fff; }

/* Trust signals */
.footer-trust { color: #cbd5e1; }
.footer-trust li { margin-bottom: 0.4rem; }

/* Payments */
.footer-payments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.footer-payments-label {
    color: #94a3b8;
    font-size: 0.78rem;
    margin-right: 0.25rem;
}
.payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 4px;
    font-size: 0.75rem;
    color: #e2e8f0;
}

/* Social links */
.social-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.social-link {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.social-link:hover,
.social-link:focus {
    background: var(--color-primary, #6366f1);
    color: #fff;
    transform: translateY(-2px);
}

/* Newsletter band arriba del footer */
.footer-newsletter {
    background: linear-gradient(135deg, var(--color-primary, #6366f1) 0%, var(--color-secondary, #4f46e5) 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.10);
}
.footer-newsletter .form-control {
    border: none;
    height: 44px;
}
.footer-newsletter .btn-light {
    height: 44px;
    font-weight: 600;
    color: var(--color-primary, #6366f1);
}

/* Footer bottom (legal) */
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    color: #94a3b8;
}
.footer-bottom p { color: #94a3b8 !important; margin: 0; }
.footer-legal-links { gap: 0; }
.footer-legal-links a { color: #cbd5e1; text-decoration: none; }
.footer-legal-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-legal-links .list-inline-item { margin-right: 0.5rem; }

/* =====================================================
   WHATSAPP WIDGET FLOTANTE
   ===================================================== */
.wa-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1045;
}
.wa-button {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    border: none;
    box-shadow: 0 6px 20px rgba(37,211,102,0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}
.wa-button:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 26px rgba(37,211,102,0.55);
}
.wa-button:active { transform: scale(0.98); }
.wa-button:focus-visible {
    outline: 3px solid rgba(37,211,102,0.5);
    outline-offset: 3px;
}
/* Pulse */
.wa-button-pulse {
    position: absolute; inset: 0;
    border-radius: 50%;
    background: #25D366;
    z-index: -1;
    animation: waPulse 2s infinite;
    opacity: 0.7;
}
@keyframes waPulse {
    0%   { transform: scale(1);    opacity: 0.7; }
    70%  { transform: scale(1.55); opacity: 0; }
    100% { transform: scale(1.55); opacity: 0; }
}

/* Popup ventanita */
.wa-popup {
    position: absolute;
    bottom: calc(100% + 14px);
    right: 0;
    width: 320px;
    max-width: calc(100vw - 48px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), opacity 0.2s, visibility 0.25s;
}
.wa-widget.open .wa-popup {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}
.wa-widget.open .wa-button-pulse { display: none; }

.wa-popup-close {
    position: absolute;
    top: 8px; right: 10px;
    background: rgba(255,255,255,0.18);
    color: #fff;
    border: none;
    width: 28px; height: 28px;
    border-radius: 50%;
    font-size: 1.3rem; line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background 0.15s;
}
.wa-popup-close:hover { background: rgba(255,255,255,0.30); }

.wa-popup-header {
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
    color: #fff;
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.wa-popup-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.wa-popup-name {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
}
.wa-popup-status {
    font-size: 0.78rem;
    opacity: 0.9;
    display: flex; align-items: center; gap: 5px;
    margin-top: 2px;
}
.wa-online-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 2px rgba(74,222,128,0.30);
}

.wa-popup-body {
    padding: 1rem 1.25rem;
    background: #ECE5DD;       /* color de fondo de WhatsApp */
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='%23d4cdc1' fill-opacity='0.4'%3E%3Cpath d='M20 0L0 20l20 20 20-20z'/%3E%3C/g%3E%3C/svg%3E");
}
.wa-popup-message {
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.10);
    font-size: 0.92rem;
    color: #303030;
    position: relative;
}
.wa-popup-message::before {
    content: '';
    position: absolute;
    left: -7px; top: 0;
    border-style: solid;
    border-width: 0 8px 8px 0;
    border-color: transparent #fff transparent transparent;
}

.wa-popup-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25D366;
    color: #fff;
    padding: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.15s;
}
.wa-popup-cta:hover {
    background: #1fb858;
    color: #fff;
}
.wa-popup-cta i { font-size: 1.2rem; }

/* Mobile: ajustar tamaños y posición */
@media (max-width: 575.98px) {
    .wa-widget { bottom: 16px; right: 16px; }
    .wa-button { width: 54px; height: 54px; font-size: 1.6rem; }
    .wa-popup { width: 290px; }
}

/* =====================================================
   BACK TO TOP BUTTON
   ===================================================== */
.back-to-top {
    position: fixed;
    bottom: 100px;       /* deja lugar arriba del wa-widget cuando coexisten */
    right: 28px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--color-primary, #6366f1);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    z-index: 1040;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.25s, transform 0.25s, background 0.15s;
}
/* Si NO existe el wa-widget, el back-to-top vuelve a posición default */
body:not(:has(.wa-widget)) .back-to-top { bottom: 24px; }
.back-to-top:not([hidden]).visible {
    opacity: 0.95;
    transform: translateY(0);
}
.back-to-top:hover {
    opacity: 1;
    background: var(--color-secondary, #4f46e5);
}
.back-to-top:focus-visible {
    outline: 3px solid rgba(99,102,241,0.45);
    outline-offset: 2px;
}
@media (max-width: 575.98px) {
    .back-to-top { bottom: 90px; right: 16px; } /* deja lugar al mobile-cta */
}

/* =====================================================
   HONEYPOT (anti-spam) — invisible para humanos, visible para bots
   ===================================================== */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
}
.hp-field input { width: 1px; height: 1px; }

/* =====================================================
   COOKIE BANNER (RGPD)
   ===================================================== */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(8px);
    color: #e2e8f0;
    border-top: 2px solid var(--color-primary, #6366f1);
    padding: 1rem 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.18);
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.cookie-banner-text {
    flex: 1 1 380px;
    min-width: 0;
}
.cookie-banner-text p { color: #cbd5e1; }
.cookie-banner-text a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.cookie-banner #cookieAccept {
    min-width: 130px;
    font-weight: 600;
    letter-spacing: 0.05em;
}
@media (max-width: 575.98px) {
    .cookie-banner-actions { width: 100%; flex-direction: column; }
    .cookie-banner #cookieAccept { width: 100%; }
}

/* =====================================================
   ACCESIBILIDAD
   ===================================================== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    z-index: 9999;
    background: var(--color-primary, #6366f1);
    color: #fff;
    padding: 10px 16px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 8px;
    color: #fff;
}

*:focus-visible {
    outline: 3px solid rgba(255,102,0,0.45);
    outline-offset: 2px;
    border-radius: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(255,102,0,0.45);
    outline-offset: 2px;
}

/* =====================================================
   BOTONES PREMIUM (override Bootstrap)
   ===================================================== */
.btn {
    font-weight: 600;
    border-radius: var(--radius);
    padding: 0.65rem 1.25rem;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    letter-spacing: 0.01em;
    border-width: 1px;
}
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1.05rem; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }

.btn-primary {
    background: var(--gradient-primary) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(40,3,106,0.20);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(40,3,106,0.30);
    filter: brightness(1.1);
}
.btn-primary:active { transform: translateY(0); }

/* .btn-cta tiene gradient naranja por default, PERO si el HTML setea
   style="background-color: X" inline (color custom del producto), ese gana.
   Por eso NO usamos !important en background. */
.btn-accent, .btn-cta {
    background: var(--gradient-cta);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(255,102,0,0.22);
}
.btn-accent:hover, .btn-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255,102,0,0.32);
    color: #fff;
    filter: brightness(1.08);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-light {
    background: #fff;
    border-color: var(--gray-200);
    color: var(--gray-700);
    font-weight: 500;
}
.btn-light:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* =====================================================
   SOCIAL PROOF (home)
   ===================================================== */
.social-proof-section {
    background: var(--gradient-primary);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.social-proof-section::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}
.social-proof-section .container { position: relative; z-index: 1; }
.social-proof-section .sp-num {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    margin-bottom: 0.4rem;
}
.social-proof-section .sp-label {
    color: rgba(255,255,255,0.85);
    font-size: 0.92rem;
    font-weight: 500;
}
@media(max-width:575.98px){
    .social-proof-section .sp-num{font-size:2rem}
    .social-proof-section .sp-label{font-size:0.8rem}
}

/* =====================================================
   PAGINACIÓN (página /cursos)
   ===================================================== */
.pagination .page-link {
    color: var(--color-primary, #6366f1);
    border-color: var(--gray-200, #e9e9e7);
}
.pagination .page-item.active .page-link {
    background: var(--color-primary, #6366f1);
    border-color: var(--color-primary, #6366f1);
    color: #fff;
}

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

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* =====================================================
   BREADCRUMB
   ===================================================== */

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item a {
    color: var(--gray-500);
}

.breadcrumb-item.active {
    color: var(--gray-700);
}

/* =====================================================
   PAGINATION
   ===================================================== */

.pagination {
    gap: 0.25rem;
}

.page-link {
    border-radius: var(--radius);
    border: none;
    color: var(--gray-700);
    padding: 0.5rem 0.875rem;
}

.page-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.page-item.active .page-link {
    background: var(--primary);
    color: #fff;
}

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

@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2.25rem;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .post-title {
        font-size: 1.75rem;
    }

    .category-title {
        font-size: 1.75rem;
    }

    .cta-title {
        font-size: 1.5rem;
    }
}

/* =====================================================
   UTILITIES
   ===================================================== */

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

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
