/* ==================================
   VARIABLES Y TOKENS (Design System)
==================================== */
:root {
    --bg-dark: #ffffff; /* General background (Light) */
    --bg-card: #f8f9fa; /* Card background */
    --bg-card-hover: #e9ecef;
    --text-main: #0a192f; /* Dark navy text */
    --text-muted: #495057;
    --accent-color: #004aad; /* Blue */
    --accent-glow: rgba(0, 74, 173, 0.3);
    --accent-hover: #005ce6;
    
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.95);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Section backgrounds */
    --bg-stats: #f1f3f5;
    --bg-gallery: #f8f9fa;
    --bg-footer: #0a192f;
    
    --hero-overlay-start: rgba(255, 255, 255, 0.95);
    --hero-overlay-end: rgba(240, 245, 255, 0.85);
}

body.dark-mode {
    --bg-dark: #000000;
    --bg-card: rgba(0, 21, 48, 0.7);
    --bg-card-hover: rgba(0, 31, 70, 0.9);
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --accent-color: #004aad;
    --accent-glow: rgba(0, 74, 173, 0.5);
    
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(0, 0, 0, 0.8);

    --bg-stats: #000a1a;
    --bg-gallery: #00050f;
    --bg-footer: #000000;
    
    --hero-overlay-start: rgba(10, 10, 15, 0.9);
    --hero-overlay-end: rgba(10, 10, 15, 0.6);
}

/* ==================================
   RESET & GLOBAL STYLES
==================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

.section-title p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ==================================
   NAVBAR (Glassmorphism)
==================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 10px 0;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 130px; /* Increased from 75px */
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    margin-top: -10px; /* Adjust vertical alignment if it has baked-in padding */
}

.nav-menu ul {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.nav-link:not(.btn-contacto)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-color);
    transition: var(--transition);
}

.nav-link:not(.btn-contacto):hover::after {
    width: 100%;
    box-shadow: 0 0 10px var(--accent-glow);
}

.btn-contacto {
    background: var(--accent-color);
    color: #ffffff !important; /* Force white text on the dark blue button */
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-contacto:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
}

.theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main);
    margin-left: 15px;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--accent-color);
}

/* ==================================
   HERO SECTION
==================================== */
.hero {
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    position: relative;
    background-image: url('../images/portada logo mecatronic.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--hero-overlay-start) 0%, var(--hero-overlay-end) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero h1 span {
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--accent-glow);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 5px;
    font-family: var(--font-heading);
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 5px 25px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-main);
    transform: translateY(-3px);
}

/* ==================================
   STATS STRIP
==================================== */
.stats {
    background: var(--bg-stats);
    padding: 40px 0;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    z-index: 10;
    margin-top: -1px;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    text-align: center;
}

.stat-item i {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.stat-item h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.stat-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==================================
   SERVICES SECTION
==================================== */
.services {
    background: var(--bg-dark);
}

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

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 40px 30px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    background: var(--bg-card-hover);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    display: inline-block;
    padding: 15px;
    background: rgba(0, 74, 173, 0.1);
    border-radius: 10px;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.service-card p {
    color: var(--text-muted);
}

/* ==================================
   GALLERY SECTION
==================================== */
.gallery {
    background: var(--bg-gallery);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 1px solid var(--glass-border);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    backdrop-filter: blur(3px);
}

.gallery-overlay span {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    transform: translateY(20px);
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item:hover .gallery-overlay span {
    transform: translateY(0);
}

/* ==================================
   FOOTER
==================================== */
.footer {
    background: var(--bg-footer);
    padding: 80px 0 0;
    border-top: 1px solid var(--glass-border);
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
}

.footer-logo {
    height: 50px;
    margin-bottom: 20px;
}

.footer-info p {
    color: #a0a0b0;
    max-width: 350px;
}

.footer h3 {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: #fff;
}

.footer-links ul li, .footer-contact ul li {
    margin-bottom: 15px;
    color: #a0a0b0;
}

.footer-links ul li a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.footer-contact ul li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-contact ul li i {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding: 25px 0;
    border-top: 1px solid var(--glass-border);
    color: #666;
    font-size: 0.9rem;
}

/* ==================================
   WHATSAPP FLOATING BUTTON
==================================== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 35px;
    box-shadow: 0px 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    background-color: #1ebe57;
    transform: scale(1.1);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* ==================================
   ANIMATIONS & EFFECTS
==================================== */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* ==================================
   RESPONSIVE DESIGN (Media Queries)
==================================== */
@media (max-width: 992px) {
    .hero h1 { font-size: 3rem; }
    .stats-container { grid-template-columns: 1fr; }
    .footer-container { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--glass-bg);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        transition: var(--transition);
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu ul {
        flex-direction: column;
        gap: 40px;
        width: 100%;
        text-align: center;
    }
    
    .hero { 
        text-align: center; 
        background-attachment: scroll;
        background-position: center center;
    }
    .hero-content { display: flex; flex-direction: column; align-items: center; }
    .hero h1 { font-size: 2.5rem; }
    .hero-buttons { flex-direction: column; width: 100%; }
    .btn { justify-content: center; }
}

/* ==================================
   LASER GAG (Mouse Cursor & Sparks)
==================================== */
@media (hover: hover) and (pointer: fine) {
    body {
        cursor: crosshair; /* Industrial crosshair */
    }
    
    .laser-pointer {
        position: fixed;
        top: 0;
        left: 0;
        width: 8px;
        height: 8px;
        background-color: #ff0033; /* Red Laser */
        border-radius: 50%;
        box-shadow: 0 0 10px 4px rgba(255, 0, 51, 0.6), 0 0 20px 8px rgba(255, 0, 51, 0.4);
        pointer-events: none;
        z-index: 9999;
        transform: translate(-50%, -50%);
        transition: width 0.2s, height 0.2s;
        mix-blend-mode: screen;
        will-change: transform;
    }

    /* Simulate cutting intensity when clicking */
    body:active .laser-pointer {
        width: 12px;
        height: 12px;
        background-color: #ffffff;
        box-shadow: 0 0 15px 6px rgba(255, 255, 255, 0.8), 0 0 30px 15px rgba(255, 0, 51, 0.8);
    }
}
