/* ============================================
   ESTILOS GLOBALES Y VARIABLES
   ============================================ */

:root {
    --primary: #13ec13;
    --primary-dark: #0bb90b;
    --primary-light: #4eff4e;
    --secondary: #10ad4a;
    --accent: #06d6d0;
    --dark: #1a2332;
    --light: #ffffff;
    --gray-100: #f8fafc;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-900: #0f172a;
    /* Stacking context variables */
    --z-base: 0;
    --z-hero-card: 40;
    --z-header: 90;
    --z-modal: 1000;
}

/* ============================================
   BACKGROUND NEURAL GRID
   ============================================ */

#grid-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 50%, #ffffff 100%);
    display: block;
    pointer-events: none;
}

/* Utility classes to reference stacking vars when needed */
.z-hero-card { z-index: var(--z-hero-card); }
.z-header { z-index: var(--z-header); }
.z-modal { z-index: var(--z-modal); }

body {
    background-color: #ffffff;
    scroll-behavior: smooth;
}

/* ============================================
   SCROLLBAR PERSONALIZADO
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ============================================
   AJUSTE DE TRANSPARENCIA PARA SECCIONES
   ============================================ */

.bg-white,
.bg-background-light {
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

@media (min-width: 1280px) {
    .banner-responsive {
        height: 150px !important;
    }
}

/* ============================================
   TIPOGRAFÍA Y TEXTOS
   ============================================ */

.text-white-force {
    color: #ffffff !important;
}

h1, h2, h3, h4, h5, h6 {
    position: relative;
    letter-spacing: -0.5px;
}

.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

/* ============================================
   BOTONES MEJORADOS
   ============================================ */

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--dark);
    font-weight: 700;
    padding: 12px 32px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(19, 236, 19, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(19, 236, 19, 0.4);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 100%);
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 700;
    padding: 12px 32px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(19, 236, 19, 0.2);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(19, 236, 19, 0.25);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    padding: 12px 32px;
    border-radius: 50px;
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: all 0.4s ease;
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(19, 236, 19, 0.3);
}

/* ============================================
   ANIMACIONES
   ============================================ */

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.animate-fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-right {
    animation: slideInRight 0.8s ease-out forwards;
}

/* ============================================
   SEPARADORES Y DECORADORES
   ============================================ */

.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 32px 0;
}

.decorative-element {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.1;
    z-index: -1;
}

.decorative-element-1 {
    width: 400px;
    height: 400px;
    top: -200px;
    right: -200px;
}

.decorative-element-2 {
    width: 300px;
    height: 300px;
    bottom: -150px;
    left: -150px;
}

/* ============================================
   CARDS Y CONTENEDOR
   ============================================ */

.card-hover {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(19, 236, 19, 0.15) !important;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    animation: fadeInUp 0.3s ease-out;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.4s ease-out;
}

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

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--gray-200);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--primary);
    color: var(--dark);
}

/* ============================================
   INPUTS MEJORADOS
   ============================================ */

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    transition: all 0.3s ease;
    border: 2px solid var(--gray-200) !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
    border: 2px solid var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(19, 236, 19, 0.1) !important;
}

/* ============================================
   GALLERÍAS DE IMÁGENES
   ============================================ */

.gallery-grid {
    display: grid;
    grid-auto-flow: dense;
}

.gallery-item {
    position: relative;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(0.95);
}

/* Galería responsive - 2 columnas en móvil, 3 en tablet, 4 en desktop */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1025px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   VIDEOS RESPONSIVOS
   ============================================ */

.video-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.video-vertical {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    aspect-ratio: 9 / 16;
}

video {
    max-width: 100%;
    height: auto;
    border-radius: inherit;
}

/* Controles de video mejorados */
video::cue {
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
}

/* ============================================
   RESPONSIVE DESIGN PARA VIDEOS Y GALERÍAS
   ============================================ */

@media (max-width: 640px) {
    .video-container {
        max-width: 100%;
        padding: 0;
    }
    
    .gallery-grid {
        gap: 12px !important;
    }
    
    .gallery-item {
        min-height: 140px;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .video-container {
        max-width: 350px;
    }
    
    .gallery-item {
        min-height: 160px;
    }
}

@media (min-width: 1025px) {
    .video-container {
        max-width: 400px;
    }
    
    .gallery-item {
        min-height: 180px;
    }
}
input[type="tel"]:focus,
textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(19, 236, 19, 0.1);
    outline: none;
}

/* ============================================
   TOOLTIPS
   ============================================ */

.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--dark);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

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

@media (max-width: 768px) {
    .btn-primary,
    .btn-secondary,
    .btn-outline {
        padding: 10px 24px;
        font-size: 14px;
    }
    
    h1 {
        font-size: 28px !important;
    }
    
    h2 {
        font-size: 24px !important;
    }
}
/* ============================================
   INSTITUTIONAL SPACING SYSTEM
   Compact, professional, consistent.
   ============================================ */

/* Reduce excessive vertical padding on generic section wrappers */
.section-compact { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.section-compact-lg { padding-top: 3.5rem; padding-bottom: 3.5rem; }
@media (min-width: 1024px) {
    .section-compact-lg { padding-top: 5rem; padding-bottom: 5rem; }
}

/* Tighten global h-spacing in subpages */
.subpage-main section,
.subpage-main > div > section {
    padding-top: 3rem;
    padding-bottom: 3rem;
}
@media (min-width: 1024px) {
    .subpage-main section,
    .subpage-main > div > section {
        padding-top: 4.5rem;
        padding-bottom: 4.5rem;
    }
}

/* Card groups: tighter gap on desktop */
.card-grid-compact { gap: 1.25rem; }
@media (min-width: 1024px) { .card-grid-compact { gap: 1.5rem; } }
