/**
 * VELRUS - Estructura de Diseño y Layout
 * Header, navegación, pie de página corporativo y cuadrículas base.
 */

/* ==========================================================================
   Header Corporativo y Barra de Navegación
   ========================================================================== */
/* ==========================================================================
   Header Corporativo Ultra-Limpio (Inspirado en Microsoft / Zoom)
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background-color: #FFFFFF;
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.site-header.scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-bottom-color: #D1D5DB;
}

/* ==========================================================================
   Estructura Base Sticky Footer
   ========================================================================== */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#main-content,
.main-content {
    flex: 1 0 auto;
}

body:not(.page-inicio) #main-content {
    padding-top: var(--header-height);
}

body:not(.page-inicio) #main-content>.section:first-child {
    padding-top: clamp(2.5rem, 5vw, 4rem);
}

.header-container-wide {
    width: 100%;
    max-width: 1560px;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(1rem, 3.5vw, 2.5rem);
    padding-right: clamp(1rem, 3.5vw, 2.5rem);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Lado Izquierdo: Logotipo y Menú alineados contiguos */
.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 100%;
}

.brand-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 1002;
    padding-right: 0.5rem;
}

.logo-img {
    height: 32px;
    width: auto;
    max-height: 34px;
    display: block;
    object-fit: contain;
}

.logo-dark {
    display: block;
}

.logo-light {
    display: none;
}

/* Navegación Estilo Microsoft */
.desktop-nav {
    display: flex;
    align-items: center;
    height: 100%;
}

.ms-nav-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    height: 100%;
    margin: 0;
    padding: 0;
}

.ms-nav-list .nav-item {
    display: flex;
    align-items: center;
    height: 100%;
}

.ms-nav-list .nav-link {
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 400;
    color: #262626;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 0.85rem;
    position: relative;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.ms-nav-list .nav-link:hover {
    color: #000000;
    border-bottom-color: #262626;
}

.ms-nav-list .nav-link.active {
    color: #000000;
    font-weight: 600;
    border-bottom-color: var(--color-primary);
}

/* Acciones a la Derecha */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
}

/* Botón Carrito en Header (Píldora Moderna) */
.header-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #0f172a;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    text-decoration: none;
    cursor: pointer;
    padding: 0.38rem 0.95rem 0.38rem 0.42rem;
    font-size: 13.5px;
    font-family: var(--font-body);
    font-weight: 600;
    line-height: 1;
    border-radius: 9999px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-cart-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: rgba(32, 134, 254, 0.1);
    color: #2086fe;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.header-cart-text {
    font-size: 13.5px;
    color: #0f172a;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.cart-badge-counter {
    position: absolute;
    top: -5px;
    right: -6px;
    background: #ef4444;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 800;
    min-width: 15px;
    height: 15px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
}

.header-cart-btn:hover {
    color: #2086fe;
    border-color: #2086fe;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(32, 134, 254, 0.2);
    transform: translateY(-1.5px);
    text-decoration: none;
}

.header-cart-btn:hover .header-cart-text {
    color: #2086fe;
}

.header-cart-btn:hover .header-cart-icon-wrap {
    background-color: #2086fe;
    color: #ffffff;
    transform: scale(1.08);
}

.header-cart-btn:active {
    transform: translateY(0) scale(0.97);
}

/* Botón Iniciar Sesión en Header (Píldora Moderna) */
.header-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #0f172a;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    text-decoration: none;
    cursor: pointer;
    padding: 0.38rem 1.15rem 0.38rem 0.42rem;
    font-size: 13.5px;
    font-family: var(--font-body);
    font-weight: 600;
    line-height: 1;
    border-radius: 9999px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-user-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: rgba(32, 134, 254, 0.1);
    color: #2086fe;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.user-icon-svg {
    width: 13px;
    height: 13px;
    display: block;
    fill: currentColor;
    transition: transform 0.25s ease;
}

.header-user-text {
    font-size: 13.5px;
    color: #0f172a;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.header-user-btn:hover {
    color: #2086fe;
    border-color: #2086fe;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(32, 134, 254, 0.2);
    transform: translateY(-1.5px);
    text-decoration: none;
}

.header-user-btn:hover .header-user-text {
    color: #2086fe;
    text-decoration: none;
}

.header-user-btn:hover .header-user-icon-wrap {
    background-color: #2086fe;
    color: #ffffff;
    transform: scale(1.08);
}

.header-user-btn:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* Botón Hamburguesa en Fondo Blanco */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 36px;
    height: 36px;
    background: transparent;
    border-radius: var(--radius-sm);
    padding: 8px 7px;
    cursor: pointer;
    z-index: 1002;
    transition: background-color var(--transition-fast);
}

.mobile-toggle:hover {
    background: #F3F4F6;
}

.mobile-toggle .hamburger-bar {
    width: 100%;
    height: 2px;
    background-color: #262626;
    border-radius: 2px;
    transition: transform var(--transition-base), opacity var(--transition-base);
}

.mobile-toggle.is-active .hamburger-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-toggle.is-active .hamburger-bar:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.is-active .hamburger-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ==========================================================================
   Pre-Footer CTA Banner
   ========================================================================== */
.pre-footer-cta {
    position: relative;
    background: linear-gradient(135deg, #06101E 0%, #0F2A52 50%, #07152A 100%);
    padding: 4.5rem 0;
    overflow: hidden;
    color: var(--color-white);
    border-top: 1px solid rgba(32, 134, 254, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cta-backdrop-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(32, 134, 254, 0.25) 0%, rgba(32, 134, 254, 0) 70%);
    pointer-events: none;
}

.cta-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.cta-title {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    color: var(--color-white);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.cta-subtitle {
    font-size: var(--fs-md);
    color: var(--color-slate-300);
    margin-bottom: 0;
}

.btn-cta-large {
    padding: 0.9rem 2rem;
    font-size: var(--fs-base);
    box-shadow: 0 8px 30px rgba(32, 134, 254, 0.45);
}

/* ==========================================================================
   Footer Corporativo (Limpio y Minimalista)
   ========================================================================== */
.site-footer {
    background-color: #F8F9FA;
    color: #4B5563;
    padding-top: 4.5rem;
    padding-bottom: 2.75rem;
    font-size: var(--fs-sm);
    margin-top: auto;
}

.footer-columns-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3.5rem;
}

.footer-nav-col {
    display: flex;
    flex-direction: column;
}

.footer-nav-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.35rem;
    letter-spacing: -0.01em;
}

.footer-links-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links-list a {
    color: #4B5563;
    font-size: 0.915rem;
    line-height: 1.4;
    transition: color var(--transition-fast), transform var(--transition-fast);
    display: inline-block;
}

.footer-links-list a:hover {
    color: var(--color-primary);
    transform: translateX(2px);
}

/* Columna de Noticias del Blog */
.footer-blog-articles {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.footer-blog-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-blog-link {
    font-size: 0.885rem;
    color: #1F2937;
    line-height: 1.45;
    font-weight: 500;
    transition: color var(--transition-fast);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.footer-blog-link:hover {
    color: var(--color-primary);
}

.footer-blog-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.15rem;
}

.footer-blog-date {
    font-size: 0.8rem;
    color: #6B7280;
}

.footer-blog-cta {
    font-size: 0.75rem;
    font-weight: 700;
    color: #111827;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    letter-spacing: 0.05em;
    transition: color var(--transition-fast);
}

.footer-blog-cta:hover {
    color: var(--color-primary);
}

.icon-blog-arrow {
    width: 12px;
    height: 12px;
    stroke-width: 2.5;
}

/* Fila Intermedia de Utilidades: Región, Resumen de IA y Redes */
.footer-utility-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding-bottom: 2.25rem;
    flex-wrap: wrap;
}

.footer-region-block {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.875rem;
    color: #111827;
}

.footer-region-label {
    font-weight: 500;
    color: #111827;
}

.footer-region-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.28rem 0.65rem;
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 0.825rem;
    font-weight: 600;
    color: #1F2937;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all var(--transition-fast);
}

.footer-region-badge:hover {
    background: #F3F4F6;
    border-color: #9CA3AF;
}

.icon-region {
    width: 15px;
    height: 15px;
    color: #4B5563;
}

.region-arrow {
    font-size: 0.75rem;
    margin-left: 2px;
    color: #6B7280;
}

/* Resumen de IA */
.footer-ai-summary-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #374151;
}

.ai-summary-text {
    font-weight: 500;
    color: #374151;
}

.ai-brand-icons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-icon-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    text-decoration: none;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.ai-icon-item svg {
    display: block;
    width: 21px;
    height: 20px;
}

.ai-icon-item:hover {
    transform: translateY(-2px) scale(1.12);
    opacity: 0.85;
}

.icon-ai-model {
    width: 20px;
    height: 20px;
}

/* Redes Sociales Limpias */
.footer-social-clean {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.clean-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #4B5563;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.clean-social-icon:hover {
    color: var(--color-primary);
    transform: translateY(-2px);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.icon-social-svg {
    width: 20px;
    height: 20px;
    aspect-ratio: 1;
    display: block;
}

/* Separador y Legal */
.footer-separator-line {
    width: 100%;
    height: 1px;
    background-color: #E5E7EB;
    margin-bottom: 1.75rem;
}

.footer-legal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: #6B7280;
    flex-wrap: wrap;
}

.footer-legal-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    flex-wrap: wrap;
}

.footer-legal-links a {
    color: #4B5563;
    transition: color var(--transition-fast);
}

.footer-legal-links a:hover {
    color: var(--color-primary);
}

.footer-copyright-note {
    color: #4B5563;
    font-size: 0.85rem;
}

/* Botón Volver Arriba Flotante */
.btn-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 990;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all var(--transition-base);
}

.btn-back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-back-to-top:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(32, 134, 254, 0.5);
}

.icon-top {
    width: 1.25rem;
    height: 1.25rem;
}