:root {
    --neon-aqua: #00f3ff;
    --neon-green: #00ff9d;
    --dark-bg: #0a0a0a;
    --card-bg: rgba(20, 20, 20, 0.95);
    --header-height: 80px;
}

/* === RESET Y BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    background-color: var(--dark-bg);
    color: #fff;
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    text-decoration: underline;
}

/* === FONT AWESOME OPTIMIZADO === */
@font-face {
    font-family: 'Font Awesome 6 Free';
    font-display: swap;
    font-style: normal;
    font-weight: 900;
    src: url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/webfonts/fa-solid-900.woff2) format('woff2');
}

.fa-bolt:before { content: "\f0e7"; }
.fa-tools:before { content: "\f7d9"; }
.fa-solar-panel:before { content: "\f5ba"; }
.fa-phone:before { content: "\f095"; }
.fa-map-marker-alt:before { content: "\f3c5"; }
.fa-envelope:before { content: "\f0e0"; }
.fa-clock:before { content: "\f017"; }
.fa-facebook-f:before { content: "\f39e"; }
.fa-twitter:before { content: "\f099"; }
.fa-instagram:before { content: "\f16d"; }
.fa-linkedin-in:before { content: "\f0e1"; }

/* === FONDO HEXÁGONOS === */
.background-shape {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.hexagon {
    position: absolute;
    width: 600px;
    height: 346px;
    background: linear-gradient(135deg, var(--neon-aqua), var(--neon-green));
    opacity: 0.08;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation: float 20s infinite ease-in-out;
}

.hexagon:nth-child(1) {
    top: 10%;
    left: 5%;
    width: 300px;
    height: 173px;
    animation-delay: 0s;
}

.hexagon:nth-child(2) {
    top: 60%;
    right: 10%;
    width: 400px;
    height: 231px;
    animation-delay: 7s;
}

.hexagon:nth-child(3) {
    bottom: 20%;
    left: 20%;
    width: 500px;
    height: 289px;
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(10px) rotate(240deg); }
}

/* === HEADER FIXED (SOLUCIÓN CLS) === */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 15px var(--neon-aqua);
    background: transparent;
}

.title-container h1 {
    font-size: 2rem;
    background: linear-gradient(to right, var(--neon-aqua), var(--neon-green));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

/* === NAVEGACIÓN === */
nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    color: #fff;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

nav a:hover {
    color: var(--neon-aqua);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--neon-aqua), var(--neon-green));
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* === BOTONES DE TELÉFONO (44px mínimo - SOLUCIÓN ACCESIBILIDAD) === */
.contact-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.phone-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(0, 255, 157, 0.1);
    border: 2px solid var(--neon-green);
    border-radius: 8px;
    color: var(--neon-green);
    font-weight: 600;
    text-decoration: none;
    min-height: 44px;
    min-width: 44px;
    transition: all 0.3s ease;
}

.phone-button:hover {
    background: rgba(0, 255, 157, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 157, 0.3);
    text-decoration: none;
}

.phone-button i {
    font-size: 1.1rem;
}

/* === HERO SECTION (COMPENSADO POR HEADER FIXED) === */
.hero {
    padding: calc(var(--header-height) + 60px) 5% 60px;
    text-align: center;
    position: relative;
    background: linear-gradient(rgba(10, 10, 10, 0.7), rgba(10, 10, 10, 0.9));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(to right, var(--neon-aqua), var(--neon-green));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 15px rgba(0, 243, 255, 0.7);
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    color: #ccc;
}

/* === BOTONES CTA === */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    background: linear-gradient(to right, var(--neon-aqua), var(--neon-green));
    color: var(--dark-bg);
    font-weight: bold;
    border-radius: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
    margin: 5px;
    border: none;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.8);
    text-decoration: none;
}

.cta-button.secondary {
    background: transparent;
    border: 2px solid var(--neon-aqua);
    color: var(--neon-aqua);
}

.cta-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* === SERVICES SECTION === */
.services {
    padding: 80px 5%;
    background-color: rgba(15, 15, 15, 0.7);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
    background: linear-gradient(to right, var(--neon-aqua), var(--neon-green));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 30px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 243, 255, 0.1);
    text-align: center;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 243, 255, 0.3);
    border-color: var(--neon-aqua);
}

.service-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
}

.service-icon i {
    font-size: 3rem;
    color: var(--neon-aqua);
}

.service-card h3 {
    margin-bottom: 15px;
    color: var(--neon-aqua);
}

.service-card p {
    color: #ccc;
    font-size: 0.95rem;
}

/* === GALERÍAS CON ASPECT-RATIO FIXED (SOLUCIÓN CLS) === */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.project-gallery {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* CONTENEDOR CON ASPECT-RATIO FIJO */
.gallery-container {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    background: #1a1a1a;
    overflow: hidden;
    border-radius: 8px;
}

.gallery-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* IMÁGENES CON LAZY LOADING */
.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-image.lazyloaded,
.gallery-image.loaded {
    opacity: 1;
}

/* BOTONES DE NAVEGACIÓN TÁCTILES */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 243, 255, 0.85);
    color: var(--dark-bg);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.gallery-nav:hover {
    background: var(--neon-aqua);
    box-shadow: 0 0 15px var(--neon-aqua);
    transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
    left: 10px;
}

.gallery-next {
    right: 10px;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 243, 255, 0.1);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 243, 255, 0.3);
    border-color: var(--neon-aqua);
}

.project-info {
    padding: 20px;
}

.project-info h3 {
    margin-bottom: 10px;
    color: var(--neon-aqua);
}

.project-info p {
    color: #ccc;
    font-size: 0.9rem;
}

/* === ABOUT SECTION === */
.about {
    padding: 80px 5%;
    background-color: rgba(15, 15, 15, 0.7);
}

.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-text h3 {
    color: var(--neon-green);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.about-text p {
    margin-bottom: 15px;
    color: #ccc;
    line-height: 1.6;
}

.about-image {
    flex: 1;
    min-width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--neon-aqua), var(--neon-green));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-bg);
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
}

/* === TESTIMONIALS === */
.testimonials {
    padding: 80px 5%;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 30px;
    border: 1px solid rgba(0, 243, 255, 0.1);
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 20px;
    color: #ccc;
    line-height: 1.6;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-aqua), var(--neon-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-bg);
    font-weight: bold;
}

.author-info .author-name {
    color: var(--neon-aqua);
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.author-info p {
    color: #999;
    font-size: 0.9rem;
}

/* === CONTACT SECTION === */
.contact {
    padding: 80px 5%;
    background-color: rgba(15, 15, 15, 0.7);
}

.contact-container {
    display: flex;
    gap: 50px;
    flex-wrap: wrap;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-info h3 {
    color: var(--neon-green);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.contact-details {
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    color: #ccc;
}

.contact-item i {
    color: var(--neon-aqua);
    font-size: 1.2rem;
    width: 20px;
    flex-shrink: 0;
    margin-top: 3px;
}

.contact-item a {
    color: #ccc;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: var(--neon-aqua);
    text-decoration: underline;
}

.contact-form {
    flex: 1;
    min-width: 300px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background-color: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: #fff;
    font-size: 1rem;
    transition: border 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--neon-aqua);
    box-shadow: 0 0 0 3px rgba(0, 243, 255, 0.1);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
    min-height: 100px;
}

/* === MENSAJES DE FORMULARIO === */
.form-message {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    display: none;
    animation: slideIn 0.3s ease;
}

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

.form-message.success {
    background-color: rgba(0, 255, 157, 0.1);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    display: block;
}

.form-message.error {
    background-color: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    display: block;
}

/* === FOOTER CON CONTRASTE MEJORADO === */
footer {
    padding: 50px 5% 30px;
    background-color: rgba(5, 5, 5, 0.98) !important;
    border-top: 1px solid rgba(0, 243, 255, 0.2);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-column {
    flex: 1;
    min-width: 200px;
}

.footer-column h3 {
    margin-bottom: 20px;
    color: var(--neon-green);
    font-size: 1.2rem;
}

.footer-column p,
.footer-column a {
    color: #cccccc !important;
    margin-bottom: 10px;
    display: block;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: var(--neon-aqua) !important;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #fff;
    text-decoration: none;
    min-width: 40px;
    min-height: 40px;
}

.social-icon:hover {
    background-color: var(--neon-aqua);
    transform: translateY(-3px);
    color: var(--dark-bg);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #cccccc !important;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* === LIGHTBOX === */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border: 2px solid var(--neon-aqua);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.5);
    border-radius: 10px;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 2001;
    transition: var(--transition);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    color: var(--neon-aqua);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 243, 255, 0.85);
    color: var(--dark-bg);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 2001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    min-height: 50px;
}

.lightbox-nav:hover {
    background: var(--neon-aqua);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
    .gallery-container {
        padding-top: 66.67%; /* 3:2 para tablet */
    }
    
    .hero h2 {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    /* Header en columna */
    header {
        flex-direction: column;
        height: auto;
        padding: 15px 5%;
        position: relative;
        gap: 15px;
    }
    
    /* Compensar hero */
    .hero {
        padding: 40px 5% 40px;
        min-height: auto;
    }
    
    /* Aspect ratio móvil */
    .gallery-container {
        padding-top: 56.25%; /* 16:9 para móvil */
    }
    
    /* Navegación centrada */
    nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Títulos más pequeños */
    .hero h2 {
        font-size: 2.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* Botones de teléfono en columna */
    .contact-header {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .phone-button {
        width: 100%;
        justify-content: center;
        margin: 5px 0;
    }
    
    /* Footer en columna */
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
    
    /* Logo más pequeño */
    .logo-image {
        width: 50px;
        height: 50px;
    }
    
    /* Lightbox buttons más pequeños */
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .services-grid,
    .testimonial-grid,
    .gallery {
        grid-template-columns: 1fr;
    }
    
    .gallery-container {
        padding-top: 75%; /* Volver a 4:3 para móvil pequeño */
    }
    
    .phone-button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .cta-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* === ACCESSIBILITY: REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .hexagon {
        animation: none;
    }
    
    .lightbox-content {
        animation: none;
    }
}

/* === PERFORMANCE: CONTENT-VISIBILITY === */
section {
    content-visibility: auto;
    contain-intrinsic-size: 1000px;
}

.project-gallery {
    content-visibility: auto;
    contain-intrinsic-size: 300px;
}

/* === PRINT STYLES === */
@media print {
    .background-shape,
    .hexagon,
    .gallery-nav,
    .lightbox,
    .social-icons,
    .phone-button:hover,
    .cta-button:hover {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline;
    }
    
    .hero, section {
        padding: 2rem 0 !important;
        min-height: auto !important;
    }
    
    header {
        position: relative !important;
        background: white !important;
        color: black !important;
    }
    
    .logo-image {
        filter: grayscale(100%) !important;
    }
}