/* ===== VARIABLES GLOBALES DE COLOR MEJORADAS ===== */
:root {
    /* Colores Rojos */
    --color-primary-red: #dc2626;
    --color-primary-red-dark: #991b1b;
    --color-primary-red-light: #ef4444;
    
    /* Rojos con transparencia */
    --color-primary-red-90: rgba(220, 38, 38, 0.9);
    --color-primary-red-80: rgba(220, 38, 38, 0.8);
    --color-primary-red-30: rgba(220, 38, 38, 0.3);
    --color-primary-red-20: rgba(220, 38, 38, 0.2);
    --color-primary-red-10: rgba(220, 38, 38, 0.1);
    --color-primary-red-dark-80: rgba(153, 27, 27, 0.8);
    
    /* Colores Negros/Grises Oscuros */
    --color-black: #000000;
    --color-black-light: #1a1a1a;
    --color-gray-900: #111827;
    --color-gray-800: #1f2937;
    --color-gray-700: #374151;
    --color-gray-600: #4b5563;
    --color-gray-300: #d1d5db;
    
    /* Colores Blancos */
    --color-white: white;
    --color-white-95: rgba(255, 255, 255, 0.95);
    --color-white-98: rgba(255, 255, 255, 0.98);
    --color-white-30: rgba(255, 255, 255, 0.3);
    --color-white-20: rgba(255, 255, 255, 0.2);
    --color-white-15: rgba(255, 255, 255, 0.15);
    --color-white-10: rgba(255, 255, 255, 0.1);
    
    /* Colores Grises/Neutros para texto */
    --color-gray-light: #f9fafb;
    --color-gray-lighter: #f3f4f6;
    --color-gray-border: #374151;
    --color-gray-text: #e5e7eb;
    --color-gray-dark: #111827;
    
    /* Colores de Acento */
    --color-accent-orange: #f97316;
    --color-accent-yellow: #fbbf24;
    
    /* Gradientes */
    --gradient-primary: linear-gradient(45deg, var(--color-primary-red), var(--color-primary-red-dark));
    --gradient-accent: linear-gradient(45deg, var(--color-primary-red), var(--color-accent-orange));
    --gradient-hero: linear-gradient(135deg, var(--color-gray-900), var(--color-black-light));
    --gradient-section: linear-gradient(135deg, var(--color-gray-800), var(--color-gray-900));
    --gradient-dark: linear-gradient(135deg, var(--color-black), var(--color-gray-900));
    --gradient-overlay: linear-gradient(45deg, var(--color-primary-red-80), var(--color-primary-red-dark-80));
    
    /* Sombras y Efectos */
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.3);
    --shadow-hover: 0 20px 40px rgba(220, 38, 38, 0.4);
    --shadow-glow: 0 8px 25px rgba(220, 38, 38, 0.5);
    
    /* Transiciones */
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.3s ease;

    /* Variables para Before/After Modal */
    --ba-bg: #111;
    --ba-card: #1f1f1f;
    --ba-accent: #c3202f;
    --ba-handle-size: 36px;
}

/* ===== ESTILOS PRINCIPALES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--color-gray-text);
    background: var(--color-gray-900);
    overflow-x: hidden;
}

/* ===== LANGUAGE SWITCH - PROFESSIONAL DESIGN ===== */
.language-switch-container {
    display: flex !important;
    align-items: center !important;
    margin-left: 1rem !important;
}

.language-switch {
    position: relative !important;
    width: 90px !important;
    height: 40px !important;
    background: #1f2937 !important; /* gray-800 */
    border: 2px solid #374151 !important; /* gray-700 */
    border-radius: 25px !important;
    cursor: pointer !important;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    outline: none !important;
    overflow: hidden !important;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    padding: 0 !important;
    font-family: inherit !important;
}

.language-switch:hover {
    border-color: rgba(220, 38, 38, 0.3) !important;
    box-shadow: 
        0 6px 25px rgba(220, 38, 38, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-1px) !important;
}

.language-switch:focus-visible {
    box-shadow: 
        0 0 0 4px rgba(220, 38, 38, 0.2),
        0 6px 25px rgba(220, 38, 38, 0.2) !important;
}

.switch-track {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 8px !important;
}

.switch-thumb {
    position: absolute !important;
    top: 3px !important;
    left: 3px !important;
    width: 32px !important;
    height: 32px !important;
    background: linear-gradient(135deg, #ffffff, #d1d5db) !important;
    border-radius: 50% !important;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1) !important;
    z-index: 2 !important;
}

.switch-thumb::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 20px !important;
    height: 20px !important;
    background: linear-gradient(45deg, #dc2626, #991b1b) !important;
    border-radius: 50% !important;
    transform: translate(-50%, -50%) scale(0) !important;
    transition: transform 0.3s ease !important;
    opacity: 0.8 !important;
}

.switch-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #4b5563 !important; /* gray-600 */
    transition: all 0.3s ease !important;
    z-index: 1 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    letter-spacing: 0.5px !important;
    position: relative !important;
}

.switch-label-en {
    margin-left: 2px !important;
}

.switch-label-es {
    margin-right: 2px !important;
}

/* Default state - English selected (left position - OFF) */
.language-switch:not(.active) {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

.language-switch:not(.active) .switch-thumb {
    transform: translateX(0px) !important;
    background: linear-gradient(135deg, #ffffff, #d1d5db) !important;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.language-switch:not(.active) .switch-thumb::before {
    transform: translate(-50%, -50%) scale(0) !important;
}

.language-switch:not(.active) .switch-label-en {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3) !important;
}

.language-switch:not(.active) .switch-label-es {
    color: #4b5563 !important;
    text-shadow: none !important;
}

/* Active state - Spanish selected (right position - ON) */
.language-switch.active {
    background: linear-gradient(135deg, #1f2937, #374151) !important;
    border-color: rgba(220, 38, 38, 0.3) !important;
}

.language-switch.active .switch-thumb {
    transform: translateX(48px) !important;
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 
        0 6px 20px rgba(220, 38, 38, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.language-switch.active .switch-thumb::before {
    transform: translate(-50%, -50%) scale(1) !important;
}

.language-switch.active .switch-label-es {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(220, 38, 38, 0.5) !important;
}

.language-switch.active .switch-label-en {
    color: #4b5563 !important;
    text-shadow: none !important;
}

/* Responsive adjustments for language switch */
@media (max-width: 768px) {
    .language-switch {
        width: 80px !important;
        height: 36px !important;
    }
    
    .switch-thumb {
        width: 28px !important;
        height: 28px !important;
        top: 2px !important;
        left: 2px !important;
    }
    
    .switch-thumb::before {
        width: 16px !important;
        height: 16px !important;
    }
    
    .language-switch.active .switch-thumb {
        transform: translateX(42px) !important;
    }
    
    .switch-label {
        font-size: 10px !important;
    }
}

@media (max-width: 480px) {
    .language-switch-container {
        margin-left: 0.5rem !important;
    }
    
    .language-switch {
        width: 70px !important;
        height: 32px !important;
    }
    
    .switch-thumb {
        width: 24px !important;
        height: 24px !important;
        top: 2px !important;
        left: 2px !important;
    }
    
    .switch-thumb::before {
        width: 14px !important;
        height: 14px !important;
    }
    
    .language-switch.active .switch-thumb {
        transform: translateX(36px) !important;
    }
    
    .switch-label {
        font-size: 9px !important;
    }
}

/* Header - Corregido */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 20px rgba(220, 38, 38, 0.3);
    border-bottom: 1px solid var(--color-primary-red-10);
    height: 70px; /* Altura fija definida */
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0.6rem; /* Aumentado ligeramente el padding vertical */
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-primary-red);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--color-gray-text);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-menu a:hover {
    color: var(--color-primary-red);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--color-primary-red);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.lang-toggle {
    display: flex;
    gap: 0.5rem;
}

.lang-toggle a {
    padding: 0.5rem 1rem;
    background: var(--color-primary-red);
    color: var(--color-white);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.lang-toggle a:hover {
    background: var(--color-primary-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--color-primary-red-30);
}

.lang-toggle a.active {
    background: var(--gradient-accent);
}

/* Hero Section - Corregido */
.hero {
    min-height: 100vh; /* Cambiado de height a min-height */
    background: var(--gradient-hero), 
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect width="1200" height="600" fill="%23111827"/><path d="M0,300 C300,200 600,400 900,250 C1050,150 1200,350 1200,300 L1200,600 L0,600 Z" fill="%23374151"/></svg>');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    position: relative;
    padding-top: 80px; /* Agregado para compensar el header fijo */
}

.hero-content {
    max-width: 800px;
    padding: 2rem; /* Removido el padding-top inline del HTML */
    animation: fadeInUp 1s ease;
    width: 100%;
    box-sizing: border-box;
}

.hero h1 {
    font-size: clamp(2rem, 8vw, 3.5rem); /* Responsive font size */
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2; /* Agregado para mejor espaciado */
    word-wrap: break-word; /* Previene overflow */
    /* Fallback para navegadores que no soportan background-clip */
    color: var(--color-white);
    background: linear-gradient(45deg, var(--color-white), var(--color-gray-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Fallback para navegadores sin soporte de background-clip */
@supports not (-webkit-background-clip: text) {
    .hero h1 {
        color: var(--color-white);
        background: none;
    }
}

.hero p {
    font-size: clamp(1rem, 4vw, 1.5rem); /* Responsive font size */
    margin-bottom: 1rem;
    opacity: 0.9;
    color: var(--color-gray-300);
    line-height: 1.4;
}

.certified-badge {
    display: inline-grid; /* Cambiado de inline-grid a inline-flex */
    align-items: center;
    justify-content: center;
    background: var(--color-primary-red-10);
    padding: 0.8rem 2rem;
    border-radius: 30px;
    margin-bottom: 2rem;
    border: 2px solid var(--color-primary-red-30);
    backdrop-filter: blur(10px);
    font-size: clamp(1.5rem, 3vw, 1.1rem); /* Responsive font size */
    font-weight: 600;
    color: white;
    max-width: 90%;
    text-align: center;
}

.cta-button {
    display: inline-block;
    background: var(--gradient-accent);
    color: var(--color-white);
    padding: 1.2rem 3rem;
    text-decoration: none;
    border-radius: 50px;
    font-size: clamp(1rem, 3vw, 1.2rem); /* Responsive font size */
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
    max-width: 90%;
    text-align: center;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(220, 38, 38, 0.6);
}

/* Sections */
.section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-white);
    position: relative;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-accent);
    border-radius: 2px;
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: var(--color-gray-800);
    padding: 1.25rem 1rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    border: 1px solid var(--color-gray-700);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(220, 38, 38, 0.3);
    border-color: var(--color-primary-red-30);
}

.service-icon {
    font-size: 3.5rem;
    color: var(--color-primary-red);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-white);
    font-weight: 600;
}

.service-card p {
    color: var(--color-gray-300);
    line-height: 1.6;
    font-size: 1rem;
}

/* About */
.about {
    background: var(--gradient-section);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-gray-text);
}

.contact-info {
    background: var(--color-gray-800);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--color-gray-700);
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--color-primary-red);
    width: 30px;
    text-align: center;
}

.contact-item a {
    color: var(--color-primary-red-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: var(--color-primary-red);
}

/* Contact Form */
.contact-form {
    background: var(--color-gray-800);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 3rem;
    border: 1px solid var(--color-gray-700);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-white);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--color-gray-600);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: var(--color-gray-700);
    color: var(--color-white);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary-red);
    box-shadow: 0 0 0 3px var(--color-primary-red-10);
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.submit-btn {
    background: var(--gradient-primary);
    color: var(--color-white);
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--color-primary-red-30);
}

/* Success/Error Messages */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    animation: slideInDown 0.5s ease;
}

.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 2px solid rgba(34, 197, 94, 0.3);
}

.error {
    background: var(--color-primary-red-10);
    color: var(--color-primary-red-light);
    border: 2px solid var(--color-primary-red-30);
}

/* Stats Section */
.stats-section {
    background: var(--gradient-dark);
    color: var(--color-white);
    text-align: center;
}

.stats-content {
    max-width: 1000px;
    margin: 0 auto;
}

/* General Stats Cards */
.general-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--color-white-10);
    padding: 2rem 1.5rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-white-20);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(220, 38, 38, 0.3);
    border-color: var(--color-primary-red-30);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-primary-red-light);
    margin-bottom: 0.5rem;
    display: block;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--color-primary-red);
}

.chart-container {
    position: relative;
    height: 450px;
    margin-top: 2rem;
    background: var(--color-white-10);
    border-radius: 15px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-white-20);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.stat-item {
    background: var(--color-white-10);
    padding: 0.5rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-white-10);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: var(--color-white-15);
    transform: translateY(-2px);
    border-color: var(--color-primary-red-20);
}

.stat-location {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.stat-percentage {
    font-size: 1.1rem;
    color: var(--color-primary-red-light);
    font-weight: bold;
}

.stat-visits {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 0.2rem;
}

/* Footer */
.footer {
    background: var(--color-black);
    color: var(--color-gray-300);
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--color-gray-800);
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-gray-text);
    cursor: pointer;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.3);
    z-index: 999;
    border-top: 1px solid var(--color-primary-red-10);
}

.mobile-menu.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.mobile-menu ul {
    flex-direction: column;
    padding: 1rem 0;
    margin: 0;
}

.mobile-menu li {
    margin: 0;
}

.mobile-menu a {
    display: block;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--color-gray-700);
    text-decoration: none;
    color: var(--color-gray-text);
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-menu a:hover {
    background: var(--color-primary-red-10);
    color: var(--color-primary-red);
}

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-gray-600);
    border-top: 4px solid var(--color-primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Redes sociales */
.social-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: 5px;
}

.social-icons img {
    width: 60px;
    height: 60px;
    transition: transform 0.3s ease;
}

.social-icons img:hover {
    transform: scale(1.1);
}

/* Contenedor de iconos de redes sociales */
.social-icons {
    display: flex;
    align-items: center;
}

/* Animación del latido */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Estilo para los iconos con la animación */
.social-icons a {
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}

/* Desfase de la animación entre los iconos para que se muevan de manera secuencial */
.social-icons a:nth-child(1) {
    animation-delay: 0s;
}

.social-icons a:nth-child(2) {
    animation-delay: 0.2s;
}

.social-icons a:nth-child(3) {
    animation-delay: 0.4s;
}

.social-icons a:nth-child(4) {
    animation-delay: 0.6s;
}

.social-icons a:nth-child(5) {
    animation-delay: 0.8s;
}

.social-icons a:nth-child(6) {
    animation-delay: 1s;
}

.social-icons a:nth-child(7) {
    animation-delay: 1.2s;
}

.social-icons a:nth-child(8) {
    animation-delay: 1.4s;
}

.social-icons a:nth-child(9) {
    animation-delay: 1.6s;
}

/* ===== GALLERY STYLES ACTUALIZADOS PARA MOSTRAR IMÁGENES COMPLETAS ===== */

/* Gallery Styles */
.form-containerGallery {
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    background: var(--gradient-section);
    border: 1px solid var(--color-gray-700);
    position: relative;
    overflow: hidden;
}

.form-containerGallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
    radial-gradient(circle at 20% 20%, var(--color-primary-red-10) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, var(--color-primary-red-10) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.form-containerGallery > * {
    position: relative;
    z-index: 1;
}

/* Gallery Toggle Buttons */
.gallery-toggle {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 3rem;
    background: var(--color-gray-800);
    border-radius: 50px;
    padding: 0.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-gray-700);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 3rem;
}

.toggle-btn {
    background: transparent;
    color: var(--color-gray-text);
    border: none;
    padding: 1rem 2rem;
    border-radius: 45px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 140px;
}

.toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 0;
    border-radius: 45px;
}

.toggle-btn i {
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 1;
    position: relative;
}

.toggle-btn span {
    z-index: 1;
    position: relative;
}

.toggle-btn:hover {
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--color-primary-red-30);
}

.toggle-btn:hover::before {
    opacity: 0.8;
}

.toggle-btn:hover i {
    transform: scale(1.2) rotate(5deg);
}

.toggle-btn.active {
    background: var(--gradient-primary);
    color: var(--color-white);
    box-shadow: 0 6px 20px var(--color-primary-red-30);
    transform: translateY(-1px);
}

.toggle-btn.active::before {
    opacity: 1;
}

.toggle-btn.active i {
    transform: scale(1.1);
    animation: pulse 2s infinite;
}

/* Animación para iconos activos */
@keyframes pulse {
    0%, 100% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ===== CONTENEDOR PRINCIPAL DE LA GALERÍA ===== */
.gallery {
    display: grid;
    gap: 15px;
    justify-content: center;
    padding: 1rem 0;
    width: 100%;
    /* Grid adaptable que se ajusta automáticamente */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ===== ESTILOS PARA IMÁGENES - COMPLETAMENTE ACTUALIZADOS ===== */
.gallery img {
    width: 100%;
    height: 250px; /* Altura fija uniforme */
    object-fit: contain; /* CLAVE: Muestra la imagen completa sin recortes */
    object-position: center;
    cursor: pointer;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid var(--color-gray-700);
    position: relative;
    overflow: hidden;
    background: var(--color-gray-800); /* Fondo para espacios vacíos */
    display: block;
    /* Compatibilidad mejorada */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Asegurar que se cargue correctamente */
    opacity: 0;
    animation: fadeInImage 0.6s ease forwards;
}

/* Efecto hover para las imágenes */
.gallery img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-overlay);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.gallery img:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(220, 38, 38, 0.4);
    border-color: var(--color-primary-red);
}

.gallery img:hover::before {
    opacity: 0.1;
}

/* Animación de carga suave */
@keyframes fadeInImage {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animación suave para el cambio de galería */
#images-gallery,
#videos-gallery {
    animation: fadeInGallery 0.6s ease-in-out;
    transition: opacity 0.3s ease-in-out;
}

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

/* ===== ESTILOS PARA VIDEO CONTAINERS ===== */
.video-container {
    background: var(--color-gray-800);
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid var(--color-gray-700);
    position: relative;
    overflow: hidden;
}

.video-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-container:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(220, 38, 38, 0.4);
    border-color: var(--color-primary-red);
}

.video-container:hover::before {
    opacity: 1;
}

/* Video wrapper para mantener tamaño fijo pero con aspect ratio correcto */
.video-wrapper {
    position: relative;
    width: 100%;
    height: 200px; /* Altura fija para mantener consistencia */
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-black);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Video con object-fit: contain para mantener proporción */
.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* CLAVE: Mantiene relación de aspecto original sin recortes */
    border-radius: 12px;
    background: var(--color-black);
    display: block;
}

/* Estilos para controles de video */
.video-container video::-webkit-media-controls-panel {
    background: linear-gradient(to bottom, 
    rgba(0,0,0,0) 0%, 
    rgba(0,0,0,0.3) 70%, 
    rgba(0,0,0,0.8) 100%);
}

.video-container video::-webkit-media-controls-play-button {
    background-color: var(--color-primary-red);
    border-radius: 50%;
    opacity: 0.9;
}

.video-container video::-webkit-media-controls-current-time-display,
.video-container video::-webkit-media-controls-time-remaining-display {
    color: var(--color-white);
    font-weight: 500;
}

.video-container video::-webkit-media-controls-timeline {
    background-color: var(--color-gray-600);
    border-radius: 10px;
    margin: 0 10px;
}

.video-container video::-webkit-media-controls-timeline::-webkit-slider-thumb {
    background-color: var(--color-primary-red);
    border-radius: 50%;
}

.video-title {
    text-align: center;
    color: var(--color-white);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem;
    background: var(--color-white-10);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-white-10);
    transition: all 0.3s ease;
}

.video-container:hover .video-title {
    background: var(--color-primary-red-20);
    border-color: var(--color-primary-red-30);
    color: var(--color-primary-red-light);
}

/* ===== BEFORE/AFTER MODAL STYLES ===== */
.before-after-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.before-after-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    font-size: 24px;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 10001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.before-after-close-btn:hover {
    background: var(--color-primary-red);
    color: white;
    transform: scale(1.1);
}

.ba-wrapper {
    width: 100%;
    max-width: 1100px;
    background: var(--ba-card);
    border-radius: 15px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--color-gray-700);
}

.ba-title {
    text-align: center;
    margin: 0 0 20px;
    font-size: 20px;
    color: white;
    font-weight: 600;
}

.before-after {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    width: 100%;
    height: 480px;
    max-height: 70vh;
    background: var(--color-gray-900);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--color-gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ba-left,
.ba-right {
    position: absolute;
    inset: 0;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: contain; /* CLAVE: Muestra la imagen completa en el modal también */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.ba-left {
    z-index: 2;
}

.ba-right {
    z-index: 4;
    -webkit-clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
    clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}

.ba-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    background: linear-gradient(180deg, #ffffff, #e5e7eb);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.ba-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6;
    width: var(--ba-handle-size);
    height: var(--ba-handle-size);
    border-radius: 50%;
    border: 4px solid rgba(0, 0, 0, 0.4);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ew-resize;
    user-select: none;
    touch-action: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.ba-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.ba-handle::before {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--ba-accent);
    display: block;
    border-radius: 3px;
    box-shadow: 0 0 0 4px rgba(195, 32, 47, 0.15);
}

.ba-label {
    position: absolute;
    top: 15px;
    z-index: 7;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.ba-label-left {
    left: 15px;
}

.ba-label-right {
    right: 15px;
}

/* ===== RESPONSIVE DESIGN COMPLETAMENTE ACTUALIZADO ===== */

/* Desktop grande (más de 1400px) */
@media (min-width: 1400px) {
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    
    .gallery img {
        height: 280px;
    }
}

/* Desktop (1200px - 1400px) */
@media (max-width: 1400px) {
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .gallery img {
        height: 260px;
    }
}

/* Laptop (1024px - 1200px) */
@media (max-width: 1200px) {
    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 12px;
    }
    
    .gallery img {
        height: 240px;
    }
}

/* Tablet grande (900px - 1024px) */
@media (max-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .gallery img {
        height: 220px;
    }
    
    /* Galería de videos en móvil pequeño */
    #videos-gallery.gallery {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .video-wrapper {
        min-height: 160px;
        max-height: 300px;
    }
    
    .video-container video {
        max-height: 280px;
        min-height: 140px;
    }
    
    .video-container.vertical video {
        max-height: 300px;
        width: 100%;
        max-width: 100%;
    }
    
    .video-container.horizontal video {
        width: 100%;
        max-height: 180px;
    }
}

/* Tablet (768px - 900px) */
@media (max-width: 900px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .gallery img {
        height: 200px;
    }
    
    .gallery-toggle {
        max-width: 320px;
        margin-bottom: 2rem;
    }
    
    .toggle-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        min-width: 120px;
    }
    
    .video-wrapper {
        height: 160px;
    }
    
    .form-containerGallery {
        padding: 1.5rem;
    }
}

/* Móvil grande (481px - 768px) */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-container {
        padding: 0.5rem;
        position: relative;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .section {
        padding: 3rem 1rem;
    }

    .chart-container {
        height: 300px;
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .general-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero {
        padding-top: 90px;
        min-height: 100vh;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .hero h1 {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
        margin-bottom: 0.8rem;
    }
    
    .hero p {
        font-size: clamp(1rem, 4vw, 1.2rem);
        margin-bottom: 1rem;
    }
    
    .certified-badge {
        padding: 0.6rem 1.5rem;
        font-size: clamp(1.5rem, 3vw, 1rem);
        margin-bottom: 1.5rem;
    }
    
    .cta-button {
        padding: 1rem 2rem;
        font-size: clamp(0.9rem, 3vw, 1.1rem);
    }
    
    .header {
        height: 60px;
    }

    /* Galería en móvil grande */
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .gallery img {
        height: 180px;
    }
    
    .video-wrapper {
        height: 150px;
    }
    
    .before-after {
        height: 320px;
    }
}

/* Móvil mediano (320px - 480px) */
@media (max-width: 480px) {
    .hero {
        padding-top: 70px;
    }
    
    .hero h1 {
        font-size: clamp(1.5rem, 8vw, 2rem);
        line-height: 1.1;
    }
    
    .hero p {
        font-size: clamp(0.9rem, 4vw, 1.1rem);
    }
    
    .certified-badge {
        padding: 0.5rem 1rem;
        font-size: clamp(1.5rem, 3vw, 0.9rem);
    }
    
    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: clamp(0.85rem, 3vw, 1rem);
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .general-stats {
        grid-template-columns: 1fr;
    }

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

    /* Galería en móvil mediano - UNA COLUMNA */
    .gallery {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 0.5rem 0;
    }
    
    .gallery img {
        height: 220px; /* Altura mayor para una sola imagen */
        max-width: 100%;
    }
    
    .video-container {
        width: 100%;
    }
    
    .video-wrapper {
        height: 180px;
    }

    .gallery-toggle {
        max-width: 280px;
        padding: 0.3rem;
        flex-direction: column;
        gap: 0.3rem;
        border-radius: 15px;
    }

    .toggle-btn {
        width: 100%;
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
        border-radius: 12px;
    }

    .toggle-btn::before {
        border-radius: 12px;
    }

    .video-title {
        font-size: 0.85rem;
    }

    .form-containerGallery {
        padding: 1rem;
    }

    /* Before/After Modal en móvil */
    .ba-wrapper {
        padding: 12px;
        margin: 5px;
    }

    .before-after {
        height: 280px;
    }

    .ba-handle {
        width: 28px;
        height: 28px;
    }

    .ba-handle::before {
        width: 8px;
        height: 8px;
    }

    .ba-title {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .ba-label {
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .before-after-close-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Móvil muy pequeño (menos de 360px) */
@media (max-width: 360px) {
    .gallery img {
        height: 200px;
    }
    
    .gallery {
        gap: 6px;
    }
    
    .video-wrapper {
        height: 160px;
    }
}

/* ===== ORIENTACIÓN LANDSCAPE EN MÓVILES ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding-top: 60px;
    }
    
    .hero-content {
        padding: 0.5rem 2rem;
    }
    
    .hero h1 {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
        margin-bottom: 0.5rem;
    }
    
    .hero p {
        font-size: clamp(0.9rem, 3vw, 1.2rem);
        margin-bottom: 0.5rem;
    }
    
    .certified-badge {
        margin-bottom: 1rem;
        padding: 0.5rem 1.5rem;
    }

    /* Galería en landscape móvil */
    .gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .gallery img {
        height: 140px;
    }
    
    .video-wrapper {
        height: 120px;
    }

    .before-after {
        height: 60vh;
    }

    .ba-wrapper {
        padding: 15px;
    }
}

/* Landscape en móviles muy pequeños */
@media (max-height: 400px) and (orientation: landscape) {
    .gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .gallery img {
        height: 120px;
    }
    
    .video-wrapper {
        height: 100px;
    }
}

/* ===== MEJORAS ADICIONALES PARA COMPATIBILIDAD ===== */

/* Para navegadores que no soportan object-fit */
@supports not (object-fit: cover) {
    .gallery img {
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center;
    }
}

/* Para dispositivos con alta densidad de píxeles */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .gallery img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Loading states y fallbacks */
.gallery img {
    background-image: linear-gradient(45deg, 
        var(--color-gray-800) 25%, 
        transparent 25%, 
        transparent 75%, 
        var(--color-gray-800) 75%, 
        var(--color-gray-800)), 
        linear-gradient(45deg, 
        var(--color-gray-800) 25%, 
        transparent 25%, 
        transparent 75%, 
        var(--color-gray-800) 75%, 
        var(--color-gray-800));
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

/* Una vez cargada la imagen, ocultar el patrón de fondo */
.gallery img[src]:not([src=""]) {
    background-image: none;
    background: var(--color-gray-800);
}

/* Error state para imágenes que no cargan */
.gallery img[alt]:empty::after {
    content: attr(alt);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-gray-300);
    text-align: center;
    font-size: 0.9rem;
    padding: 1rem;
}

/* ===== ANIMACIONES PROFESIONALES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* High resolution displays */
@media (min-width: 1400px) {
    .nav-container {
        max-width: 1400px;
    }

    .section {
        max-width: 1400px;
    }
}

/* Scroll animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
    margin-bottom: 1.5rem;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.stat-card.visible {
    animation: countUp 0.8s ease forwards;
}

/* ===== EFECTOS ADICIONALES PROFESIONALES ===== */

/* Efectos de profundidad para elementos importantes */
.service-card,
.stat-card {
    will-change: transform;
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states para accesibilidad */
.cta-button:focus,
.submit-btn:focus,
.ba-handle:focus {
    outline: 3px solid var(--color-primary-red-30);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .mobile-menu,
    .before-after-modal {
        display: none !important;
    }
    
    .section {
        page-break-inside: avoid;
    }
}

