/* ============================================
   CSS VARIABLES (ROOT) - OPTIMIZED
   ============================================ */
:root {
    --primary-blue: #0066FF;
    --light-blue: #00A3FF;
    --sky-blue: #5CC5FF;
    --accent-yellow: #FFD700;
    --dark-blue: #003380;
    --text-dark: #0A1628;
    --text-light: #6B7280;
    --white: #FFFFFF;
    --light-gray: #F8FAFC;
    --dark-gray: #1a1a1a;
    
    /* Performance optimizations */
    --border-radius: 20px;
    --border-radius-small: 10px;
    --border-radius-full: 50px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s ease;
    --shadow-light: 0 4px 20px rgba(0, 102, 255, 0.08);
    --shadow-medium: 0 10px 30px rgba(0, 102, 255, 0.15);
    --shadow-heavy: 0 20px 60px rgba(0, 102, 255, 0.2);
    --gradient-primary: linear-gradient(135deg, var(--primary-blue), var(--light-blue));
    --gradient-bg: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
}

/* ============================================
   RESET & BASE OPTIMIZED
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   OPTIMIZED LOADER
   ============================================ */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-circle {
    width: 50px;
    height: 50px;
    border: 3px solid var(--light-blue);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    will-change: transform;
}

/* ============================================
   NAVIGATION OPTIMIZED WITH MOBILE MENU
   ============================================ */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    transition: all var(--transition-normal);
    border-bottom: 1px solid rgba(0, 102, 255, 0.1);
    will-change: transform, box-shadow;
}

nav.scrolled {
    box-shadow: var(--shadow-light);
    transform: translateZ(0);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem clamp(1rem, 3vw, 2rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 800;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--primary-blue);
    transition: transform var(--transition-normal);
    z-index: 1001;
}

.logo:hover {
    transform: scale(1.05) translateZ(0);
}

.logo img {
    height: clamp(60px, 8vw, 80px);
    width: auto;
    margin-right: 10px;
    object-fit: contain;
}

/* Hamburger Menu */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    z-index: 1001;
    transition: transform var(--transition-normal);
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-blue);
    transition: all var(--transition-normal);
    border-radius: 3px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
    margin: 0;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: color var(--transition-normal);
    padding: 0.5rem 0;
}

.nav-link.active {
    color: var(--primary-blue);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: width var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary-blue);
}

.cta-button {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius-full);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-light);
    will-change: transform;
    white-space: nowrap;
}

.cta-button:hover {
    transform: translateY(-2px) translateZ(0);
    box-shadow: var(--shadow-medium);
}

/* ============================================
   HERO SECTION OPTIMIZED - RESPONSIVE
   ============================================ */
.hero-nosotros {
    position: relative;
    background-image: url('../assets/images/QUELLAVECO/Nosotros-panelsolar.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    color: white;
    text-align: center;
    padding: clamp(100px, 15vw, 150px) clamp(1rem, 3vw, 2rem) clamp(2rem, 5vw, 4rem);
}

.hero-nosotros::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
}

.hero-nosotros > * {
    position: relative;
    z-index: 2;
}

.hero-nosotros h1 {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 900;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    animation: fadeInUp 0.8s ease;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    line-height: 1.1;
}

.hero-nosotros p {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    max-width: 800px;
    margin: 0 auto clamp(2rem, 4vw, 3rem);
    opacity: 0.95;
    line-height: 1.6;
    animation: fadeInUp 0.8s ease 0.2s both;
    color: var(--white);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: clamp(2rem, 5vw, 4rem);
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.stat-item {
    text-align: center;
    flex: 1;
    min-width: clamp(100px, 20vw, 150px);
}

.stat-number {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    display: block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: var(--white);
}

.stat-label {
    opacity: 0.9;
    font-size: clamp(0.9rem, 2vw, 1rem);
    margin-top: 0.5rem;
    color: var(--white);
}

/* ============================================
   OPTIMIZED GLOBAL BUTTONS
   ============================================ */
.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    padding: clamp(0.8rem, 2vw, 1rem) clamp(1.5rem, 3vw, 2.5rem);
    border-radius: var(--border-radius-full);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-light);
    will-change: transform;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.btn-primary:hover {
    transform: translateY(-3px) translateZ(0);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    color: var(--primary-blue);
    padding: clamp(0.8rem, 2vw, 1rem) clamp(1.5rem, 3vw, 2.5rem);
    border-radius: var(--border-radius-full);
    text-decoration: none;
    font-weight: 600;
    border: 2px solid var(--primary-blue);
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    will-change: transform;
    background: transparent;
    white-space: nowrap;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.btn-secondary:hover {
    background: var(--primary-blue);
    color: var(--white);
    transform: translateY(-3px) translateZ(0);
}

.hero-buttons {
    margin-top: clamp(2rem, 5vw, 3rem);
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   SECTIONS GENERAL OPTIMIZED
   ============================================ */
.section {
    padding: clamp(3rem, 8vw, 5rem) 0;
    position: relative;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
}

.section-header {
    text-align: center;
    margin-bottom: clamp(2rem, 5vw, 4rem);
}

.section-title {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    color: var(--text-dark);
}

.section-title span {
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================
   TIMELINE OPTIMIZED FOR MOBILE
   ============================================ */
.timeline {
    position: relative;
    padding: clamp(1.5rem, 3vw, 2rem) 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: clamp(2rem, 5vw, 4rem);
    width: 45%;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 55%;
    text-align: left;
}

.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--primary-blue);
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 0 0 4px var(--primary-blue);
    top: 20px;
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -32px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -32px;
}

.timeline-content {
    background: white;
    padding: clamp(1.5rem, 3vw, 2rem);
    border-radius: var(--border-radius-small);
    box-shadow: var(--shadow-light);
    position: relative;
    transition: all var(--transition-normal);
    will-change: transform;
    border: 1px solid rgba(0, 102, 255, 0.1);
}

.timeline-content:hover {
    transform: translateY(-5px) translateZ(0);
    box-shadow: var(--shadow-medium);
    border-color: var(--light-blue);
}

.timeline-content h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: clamp(1.1rem, 2.5vw, 1.2rem);
    font-weight: 700;
}

.timeline-content h4 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: clamp(1rem, 2vw, 1.1rem);
}

.timeline-content p {
    color: var(--text-light);
    line-height: 1.7;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.timeline-item:nth-child(odd) .timeline-content::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 20px;
    border: 10px solid;
    border-color: transparent transparent transparent white;
}

.timeline-item:nth-child(even) .timeline-content::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 20px;
    border: 10px solid;
    border-color: transparent white transparent transparent;
}

/* ============================================
   LOCATION SECTION OPTIMIZED
   ============================================ */
.location-section {
    background: var(--light-gray);
    padding: clamp(3rem, 6vw, 5rem) 0;
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(1.5rem, 3vw, 2rem);
    margin-top: clamp(2rem, 4vw, 3rem);
}

.location-card {
    background: white;
    padding: clamp(2rem, 4vw, 2.5rem);
    border-radius: var(--border-radius);
    text-align: center;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-light);
    border: 2px solid transparent;
    will-change: transform;
}

.location-card:hover {
    transform: translateY(-10px) translateZ(0);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-blue);
}

.location-card.featured {
    background: var(--gradient-primary);
    color: white;
}

.location-icon {
    width: clamp(60px, 8vw, 80px);
    height: clamp(60px, 8vw, 80px);
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.1), rgba(0, 163, 255, 0.1));
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.location-card.featured .location-icon {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.location-icon i {
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--primary-blue);
}

.location-card.featured .location-icon i {
    color: white;
}

.location-card h3 {
    font-size: clamp(1.3rem, 3vw, 1.5rem);
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.location-card.featured h3 {
    color: white;
}

.location-card p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.location-card.featured p {
    color: rgba(255, 255, 255, 0.9);
}

.location-highlight {
    background: rgba(0, 102, 255, 0.1);
    color: var(--primary-blue);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-full);
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    font-weight: 600;
    margin-top: 1rem;
    display: inline-block;
}

.location-card.featured .location-highlight {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ============================================
   WHY CHOOSE SECTION OPTIMIZED
   ============================================ */
.why-choose-section {
    padding: clamp(3rem, 6vw, 5rem) 0;
    background: var(--light-gray);
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: clamp(1.5rem, 3vw, 2rem);
    margin-top: clamp(2rem, 4vw, 3rem);
}

.advantage-item {
    background: white;
    padding: clamp(1.5rem, 3vw, 2rem);
    border-radius: var(--border-radius-small);
    text-align: center;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-light);
    border: 2px solid transparent;
    position: relative;
    will-change: transform;
}

.advantage-item:hover {
    transform: translateY(-8px) translateZ(0);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-blue);
}

.advantage-icon {
    width: clamp(60px, 8vw, 70px);
    height: clamp(60px, 8vw, 70px);
    background: linear-gradient(135deg, var(--accent-yellow), #FFA500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: all var(--transition-normal);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.advantage-item:hover .advantage-icon {
    transform: scale(1.1) rotate(5deg) translateZ(0);
    box-shadow: 0 12px 35px rgba(255, 215, 0, 0.4);
}

.advantage-icon i {
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    color: white;
}

.advantage-item h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.2rem);
    margin-bottom: 0.8rem;
    color: var(--text-dark);
    font-weight: 600;
}

.advantage-item p {
    color: var(--text-light);
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    line-height: 1.6;
}

/* ============================================
   COMMITMENT SECTION OPTIMIZED
   ============================================ */
.commitment-section {
    padding: clamp(3rem, 6vw, 5rem) 0;
}

.commitment-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.commitment-text h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.commitment-text p {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.8;
    font-size: clamp(1rem, 2vw, 1.1rem);
}

.commitment-highlights {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: clamp(0.8rem, 2vw, 1rem);
    background: rgba(0, 102, 255, 0.05);
    border-radius: var(--border-radius-small);
    border-left: 4px solid var(--primary-blue);
    transition: all var(--transition-fast);
}

.highlight-item:hover {
    background: rgba(0, 102, 255, 0.08);
    transform: translateX(5px);
}

.highlight-item i {
    font-size: clamp(1.3rem, 3vw, 1.5rem);
    color: var(--primary-blue);
    flex-shrink: 0;
}

.highlight-item span {
    font-weight: 600;
    color: var(--text-dark);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.commitment-visual {
    display: flex;
    justify-content: center;
}

.impact-card {
    background: var(--gradient-primary);
    color: white;
    padding: clamp(2rem, 4vw, 3rem);
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-heavy);
    max-width: 350px;
    width: 100%;
}

.impact-card h3 {
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: white;
}

.impact-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1rem, 3vw, 2rem);
}

.impact-stat {
    text-align: center;
}

.impact-number {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    display: block;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: white;
}

.impact-label {
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    opacity: 0.9;
    color: white;
}

/* ============================================
   CTA SECTION OPTIMIZED
   ============================================ */
.cta-section {
    background: var(--text-dark);
    color: white;
    text-align: center;
    padding: clamp(3rem, 6vw, 5rem) 0;
}

.cta-section h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
    color: white;
}

.cta-section p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Ajuste específico para botones en CTA section */
.cta-section .btn-primary {
    padding: clamp(1rem, 2vw, 1.2rem) clamp(2rem, 4vw, 3rem);
    font-size: clamp(1rem, 2vw, 1.1rem);
}

.cta-section .btn-secondary {
    background: transparent;
    color: white;
    padding: clamp(1rem, 2vw, 1.2rem) clamp(2rem, 4vw, 3rem);
    border: 2px solid white;
    font-size: clamp(1rem, 2vw, 1.1rem);
}

.cta-section .btn-secondary:hover {
    background: white;
    color: var(--text-dark);
}

/* ============================================
   FOOTER OPTIMIZED
   ============================================ */
footer {
    background: var(--text-dark);
    color: var(--white);
    padding: clamp(3rem, 6vw, 4rem) 0 clamp(1.5rem, 3vw, 2rem);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: clamp(2rem, 4vw, 3rem);
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.footer-brand h3 {
    font-size: clamp(1.3rem, 3vw, 1.5rem);
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all var(--transition-normal);
    text-decoration: none;
    will-change: transform;
}

.social-link:hover {
    background: var(--primary-blue);
    transform: translateY(-3px) translateZ(0);
}

.footer-links h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: clamp(1.1rem, 2.5vw, 1.1rem);
}

.footer-links ul {
    list-style: none;
}

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

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition-normal);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.footer-links a:hover {
    color: var(--sky-blue);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(0.85rem, 1.5vw, 0.9rem);
}

/* ============================================
   ANIMATIONS OPTIMIZED
   ============================================ */
@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

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

/* ============================================
   SCROLL REVEAL OPTIMIZED
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Hardware acceleration for animated elements */
.timeline-content,
.location-card,
.advantage-item,
.social-link,
.btn-primary,
.btn-secondary,
.cta-button,
.logo,
.nav-toggle {
    will-change: transform;
    transform: translateZ(0);
}

/* Optimize font rendering */
body,
.section-title,
.hero-nosotros h1 {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   RESPONSIVE DESIGN OPTIMIZADO - MOBILE FIRST
   ============================================ */

/* TABLET GRANDE (1200px+) */
@media (min-width: 1200px) {
    .advantages-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .location-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* TABLET (768px - 1024px) */
@media (max-width: 1024px) {
    .commitment-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .impact-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .location-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        width: 100%;
        left: 0;
        text-align: left;
        padding-left: 70px;
    }

    .timeline-item:nth-child(odd) {
        text-align: left;
    }

    .timeline-dot {
        left: 20px !important;
    }

    .timeline-content::after {
        left: -10px !important;
        border-color: transparent white transparent transparent !important;
    }
}

/* MÓVIL GRANDE (481px - 768px) */
@media (max-width: 768px) {
    /* NAVEGACIÓN MÓVIL */
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        width: 100%;
        text-align: center;
        transition: left var(--transition-normal);
        box-shadow: var(--shadow-light);
        padding: 2rem 0;
        z-index: 999;
        gap: 1.5rem;
    }

    .nav-menu.active {
        left: 0;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 1rem 0;
    }
    
    .cta-button {
        margin-top: 1rem;
    }

    /* HERO MÓVIL */
    .hero-nosotros {
        background-attachment: scroll; /* Mejor rendimiento en móviles */
        min-height: 90vh;
        padding: 120px 1rem 2rem;
    }
    
    .hero-stats {
        gap: 2rem;
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        min-width: auto;
        width: 100%;
        max-width: 200px;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    /* TIMELINE MÓVIL */
    .timeline-item {
        padding-left: 60px;
    }
    
    .timeline-dot {
        left: 15px !important;
        width: 16px;
        height: 16px;
    }
    
    .timeline::before {
        left: 23px;
        width: 3px;
    }

    /* SECCIONES MÓVIL */
    .advantages-grid {
        grid-template-columns: 1fr;
    }
    
    .location-grid {
        grid-template-columns: 1fr;
    }
    
    .commitment-visual {
        order: -1;
    }
    
    .impact-card {
        max-width: 100%;
    }

    /* FOOTER MÓVIL */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }

    /* CTA BUTTONS MÓVIL */
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-section .btn-primary,
    .cta-section .btn-secondary {
        width: 100%;
        max-width: 300px;
    }
}

/* MÓVIL PEQUEÑO (320px - 480px) */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    .hero-nosotros {
        min-height: 80vh;
        padding: 100px 0.5rem 2rem;
    }
    
    .section {
        padding: 2.5rem 0;
    }
    
    .section-container {
        padding: 0 1rem;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-dot {
        left: 10px !important;
        width: 14px;
        height: 14px;
    }
    
    .timeline::before {
        left: 17px;
        width: 2px;
    }
    
    .timeline-content {
        padding: 1.5rem;
    }
    
    .advantage-item,
    .location-card {
        padding: 1.5rem;
    }
    
    .advantage-icon,
    .location-icon {
        width: 50px;
        height: 50px;
    }
    
    .advantage-icon i,
    .location-icon i {
        font-size: 1.5rem;
    }
    
    .impact-card {
        padding: 2rem 1.5rem;
    }
    
    .impact-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .highlight-item {
        padding: 0.8rem;
        gap: 0.8rem;
    }
    
    .highlight-item i {
        font-size: 1.2rem;
    }
}

/* MÓVIL MUY PEQUEÑO (hasta 360px) */
@media (max-width: 360px) {
    html {
        font-size: 13px;
    }
    
    .nav-container {
        padding: 0.8rem;
    }
    
    .logo img {
        height: 50px;
    }
    
    .hero-nosotros {
        padding: 90px 0.5rem 1.5rem;
    }
    
    .section-container {
        padding: 0 0.8rem;
    }
    
    .timeline-item {
        padding-left: 45px;
    }
    
    .timeline-content {
        padding: 1.2rem;
    }
    
    .advantage-item,
    .location-card {
        padding: 1.2rem;
    }
    
    .impact-card {
        padding: 1.5rem 1rem;
    }
    
    .highlight-item {
        padding: 0.6rem;
        gap: 0.6rem;
    }
}

/* LANDSCAPE MÓVIL */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-nosotros {
        min-height: auto;
        padding: 120px 1rem 2rem;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 2rem;
    }
    
    .stat-item {
        min-width: 120px;
    }
}

/* ============================================
   OPTIMIZACIONES ESPECÍFICAS PARA TOUCH
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Mejor experiencia táctil */
    .btn-primary,
    .btn-secondary,
    .cta-button,
    .nav-link,
    .social-link {
        min-height: 44px; /* Tamaño mínimo para touch */
    }
    
    /* Ajustar efectos hover en dispositivos táctiles */
    .timeline-content:hover,
    .location-card:hover,
    .advantage-item:hover {
        transform: none;
    }
    
    .highlight-item:hover {
        transform: none;
        background: rgba(0, 102, 255, 0.05);
    }
}

/* ============================================
   UTILIDADES RESPONSIVAS
   ============================================ */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    .mobile-center {
        text-align: center !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-stack {
        flex-direction: column !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    nav,
    .btn-primary,
    .btn-secondary,
    .hero-buttons,
    .cta-buttons {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    .timeline-item,
    .location-card,
    .advantage-item {
        page-break-inside: avoid;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-blue: #0000FF;
        --text-dark: #000000;
        --text-light: #333333;
    }
    
    .btn-primary,
    .cta-button {
        border: 2px solid var(--white);
    }
    
    .timeline-content,
    .location-card,
    .advantage-item {
        border: 2px solid var(--text-dark);
    }
}

/* Focus management for better accessibility */
*:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.btn-primary:focus,
.btn-secondary:focus,
.nav-link:focus,
.social-link:focus {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-blue);
    color: var(--white);
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   OPTIMIZACIONES ADICIONALES PARA MÓVILES
   ============================================ */

/* Prevenir zoom en inputs en iOS */
@media (max-width: 768px) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Mejoras para scroll suave en móviles */
@supports (scroll-behavior: smooth) {
    html {
        scroll-behavior: smooth;
    }
}

/* Optimización para pantallas con notch */
@supports (padding: max(0px)) {
    .nav-container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .section-container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Mejoras para dispositivos con densidad de píxeles alta */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-nosotros {
        background-image: url('../assets/images/QUELLAVECO/Nosotros-panelsolar@2x.jpeg');
    }
}

/* Optimización para conexiones lentas */
@media (prefers-reduced-data: reduce) {
    .hero-nosotros {
        background-image: none;
        background-color: var(--dark-gray);
    }
    
    .hero-nosotros::before {
        background: rgba(0, 102, 255, 0.8);
    }
}