:root {
    --primary: #0057B8;
    --primary-light: #3A82DE;
    --primary-glow: rgba(0, 87, 184, 0.2);
    --accent: #F59D3F;
    --accent-glow: rgba(245, 157, 63, 0.3);
    --dark: #0a1118;
    --dark-accent: #111d2b;
    --light: #f8f9fa;
    --white: #ffffff;
    --text-dark: #1a2535;
    --text-muted: #5a6880;
    --bg-white: #ffffff;
    --bg-light: #f4f7fb;
    --bg-section: #eef2f9;
    --card-bg: #ffffff;
    --border-light: rgba(0, 87, 184, 0.12);
    --shadow-sm: 0 4px 15px rgba(0, 87, 184, 0.08);
    --shadow-md: 0 10px 40px rgba(0, 87, 184, 0.14);
    --shadow-lg: 0 20px 60px rgba(0, 87, 184, 0.18);
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 87, 184, 0.15);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box !important;
    font-family: 'Outfit', sans-serif;
}

img {
    max-width: 100%;
    height: auto;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden !important;
    position: relative;
    background-color: var(--bg-white);
    color: var(--text-dark);
}

body {
    line-height: 1.6;
    overflow-wrap: break-word;
}

h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

ul {
    list-style: none;
}

section {
    padding: 100px 5%;
    position: relative;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
    position: relative;
}

/* Ensure padding is handled by box-sizing everywhere */
* {
    box-sizing: border-box !important;
}

/* --- Decorative blobs (now blue-tinted for white bg) --- */
.blob {
    position: absolute;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: 0;
    filter: blur(100px);
    opacity: 0.6;
    pointer-events: none;
}

.blob-1 { top: -100px; right: -50%; }
.blob-2 { bottom: 500px; left: -50%; background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%); }

/* --- Header & Nav --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 18px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 2px 20px rgba(0, 87, 184, 0.07);
}

header.scrolled {
    padding: 12px 5%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 30px rgba(0, 87, 184, 0.12);
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dark);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links li a {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.nav-links li a:hover, .nav-links li a.active {
    color: var(--primary);
    opacity: 1;
}

.nav-btn {
    padding: 10px 25px;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-btn:hover {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.nav-btn .mobile-text { display: none; }

/* Hamburger: oculto en desktop */
.hamburger { display: none; }

/* --- Hero --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(
        to right,
        rgba(0, 15, 40, 0.85) 0%,
        rgba(0, 30, 80, 0.70) 50%,
        rgba(0, 15, 40, 0.40) 100%
    ), url('assets/hero.png');
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, transparent, var(--bg-white));
    pointer-events: none;
}

.hero-content {
    max-width: 700px;
    position: relative;
    z-index: 1;
}

.hero-content > p:first-child {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--accent);
    background: rgba(245, 157, 63, 0.15);
    border: 1px solid rgba(245, 157, 63, 0.3);
    display: inline-block;
    padding: 6px 18px;
    border-radius: 50px;
    margin-bottom: 25px;
}

.hero-content h1 {
    font-size: 3.8rem;
    line-height: 1.1;
    margin-bottom: 25px;
    color: var(--white);
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero-content h1 span {
    color: var(--accent);
}

.hero-content > p:last-of-type {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 40px;
    max-width: 580px;
    line-height: 1.7;
}

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

.btn {
    padding: 14px 36px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--accent);
    color: var(--dark);
    box-shadow: 0 10px 25px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 35px var(--accent-glow);
    background: #f5b05a;
}

.btn-secondary {
    border: 2px solid rgba(255,255,255,0.5);
    color: var(--white);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--white);
    transform: translateY(-4px);
}

/* --- Services --- */
#services {
    background: var(--dark);
    color: var(--light);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

/* Section-title on dark bg */
#services .section-title h2,
#services .service-card h3 {
    color: var(--light);
}

/* Section-title on white/light bg */
#products .section-title h2,
#about .section-title h2,
#partners .section-title h2,
#presence .section-title h2,
.section-title-dark h2 {
    color: var(--text-dark);
}

.section-title p {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.85rem;
    font-weight: 700;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
    position: relative;
    z-index: 1;
}

.service-card {
    background: rgba(255,255,255,0.04);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    opacity: 0;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 87, 184, 0.4);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.service-card:hover::before {
    opacity: 1;
}

.service-card i {
    font-size: 2.2rem;
    color: var(--accent);
    margin-bottom: 22px;
    display: block;
}

.service-card h3 {
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.service-card p {
    opacity: 0.65;
    font-size: 0.93rem;
    line-height: 1.7;
}

/* --- Products (White bg) --- */
.products {
    background: var(--bg-light);
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 50px;
}

.tab-btn {
    padding: 10px 32px;
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 50px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 0.9rem;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.product-card {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid var(--border-light);
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.product-card h3 {
    color: var(--text-dark);
    margin-bottom: 8px;
}

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

.product-img {
    width: 100%;
    height: 180px;
    background: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--primary);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

/* --- About Us (White bg) --- */
#about {
    background: var(--bg-white);
}

.about {
    display: flex;
    align-items: center;
    gap: 80px;
}

.about-img {
    flex: 1;
    position: relative;
}

.about-img img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 20px 20px 0 var(--primary);
}

.about-content {
    flex: 1;
}

.about-content h2 {
    color: var(--text-dark);
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.about-content > p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 40px;
    padding: 30px;
    background: var(--bg-light);
    border-radius: 16px;
    border: 1px solid var(--border-light);
}

.stat-item h4 {
    font-size: 2.5rem;
    color: var(--primary);
}

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

/* --- Partners (Light bg) --- */
#partners {
    background: var(--bg-section);
    padding: 60px 5%;
}

#partners .section-title h2 {
    color: var(--text-dark);
}

.partners-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 30px 0;
    position: relative;
}

.partners-wrapper::before,
.partners-wrapper::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 120px;
    z-index: 2;
    pointer-events: none;
}

.partners-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-section), transparent);
}

.partners-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-section), transparent);
}

.partners-track {
    display: flex;
    gap: 70px;
    animation: scroll 40s linear infinite;
    width: max-content;
}

.partner-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    opacity: 0.45;
    transition: var(--transition);
    color: var(--text-dark);
    white-space: nowrap;
    padding: 14px 28px;
    border-radius: 50px;
    background: var(--white);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.partner-item i {
    font-size: 1.4rem;
    color: var(--primary);
    transition: var(--transition);
}

.partner-item:hover {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.partner-item:hover i {
    color: var(--accent);
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Presence (White bg) --- */
#presence {
    background: var(--bg-white) !important;
    border-top: 1px solid var(--border-light);
}

#presence .section-title h2 {
    color: var(--text-dark);
}

#presence h3 {
    color: var(--text-dark);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

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

.service-card.revealed:nth-child(1) { transition-delay: 0.1s; }
.service-card.revealed:nth-child(2) { transition-delay: 0.2s; }
.service-card.revealed:nth-child(3) { transition-delay: 0.3s; }
.service-card.revealed:nth-child(4) { transition-delay: 0.4s; }
.service-card.revealed:nth-child(5) { transition-delay: 0.5s; }
.service-card.revealed:nth-child(6) { transition-delay: 0.6s; }

/* Footer */
footer {
    background: var(--dark);
    color: var(--light);
    padding: 80px 5% 40px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-about p {
    margin: 20px 0;
    opacity: 0.6;
    font-size: 0.93rem;
    line-height: 1.7;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--light);
}

.social-links a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.footer-nav h4 {
    margin-bottom: 25px;
    color: var(--light);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-nav ul li {
    margin-bottom: 12px;
}

.footer-nav ul li a {
    opacity: 0.6;
    font-size: 0.92rem;
    color: var(--light);
}

.footer-nav ul li a:hover {
    opacity: 1;
    color: var(--accent);
}

.footer-contact h4 {
    margin-bottom: 25px;
    color: var(--light);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-contact p {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    opacity: 0.7;
    font-size: 0.92rem;
}

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

.footer-bottom {
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    justify-content: space-between;
    opacity: 0.45;
    font-size: 0.83rem;
}

/* --- Hero Layout (split) --- */
.hero-inner {
    display: flex;
    align-items: center;
    gap: 60px;
    width: 100%;
    max-width: 1200px;
    z-index: 1;
    position: relative;
}

.hero-inner .hero-content {
    flex: 1.1;
    max-width: 580px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.hero-image img {
    width: 100%;
    max-width: 520px;
    border-radius: 20px;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.1),
        0 30px 80px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(0, 87, 184, 0.3);
    object-fit: cover;
    aspect-ratio: 16/10;
    animation: floatImg 6s ease-in-out infinite;
}

@keyframes floatImg {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

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

/* --- Tablet (≤992px) --- */
@media (max-width: 992px) {
    section { padding: 70px 5%; }

    /* Hero split → stack */
    .hero-inner {
        flex-direction: column;
        gap: 30px;
        align-items: flex-start;
    }
    .hero-inner .hero-content { max-width: 100%; }
    .hero-image { display: none; }

    .hero-content h1 { font-size: 2.6rem; }

    /* About stack */
    .about { flex-direction: column; gap: 40px; }
    .about-img img { box-shadow: 10px 10px 0 var(--primary); }

    /* Services 2 cols */
    .services-grid { grid-template-columns: repeat(2, 1fr); }

    /* Products 2 cols */
    .products-grid { grid-template-columns: repeat(2, 1fr); }

    /* Footer 2 cols */
    .footer-top { grid-template-columns: 1fr 1fr; gap: 40px; }

    /* Presence cards flex-wrap */
    #presence .container > div:last-child {
        gap: 20px;
    }
}

/* --- Mobile (≤768px) --- */
@media (max-width: 768px) {
    section { padding: 40px 3%; }
    .container { padding: 0 4%; }
    
    .blob { display: none; } /* Remove blobs on mobile to prevent overflow */

    /* Header */
    header { 
        padding: 12px 4%; 
        width: 100%; 
        left: 0;
    }
    .logo-text { font-size: 1.2rem; }
    .nav-btn { 
        font-size: 0.8rem; 
        padding: 8px 12px;
    }
    
    nav { display: none !important; }
    .nav-links { display: none !important; }
    
    .nav-open nav { display: block !important; }
    .nav-open .nav-links { display: flex !important; }

    .nav-btn .desktop-text { display: none !important; }
    .nav-btn .mobile-text { display: inline !important; }

    /* Hamburger button */
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 6px;
        background: none;
        border: none;
    }
    .hamburger span {
        display: block;
        width: 24px;
        height: 2px;
        background: var(--text-dark);
        border-radius: 2px;
        transition: var(--transition);
    }

    /* Mobile nav open */
    .nav-open .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255,255,255,0.97);
        backdrop-filter: blur(20px);
        padding: 20px 4%;
        gap: 10px;
        border-bottom: 1px solid var(--border-light);
        box-shadow: 0 8px 30px rgba(0,87,184,0.12);
    }
    .nav-open .nav-links li a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-light);
        font-size: 1rem;
    }

    /* Hero */
    .hero { padding-top: 80px; }
    .hero-content h1 { font-size: 2rem; }
    .hero-content > p:first-child { font-size: 0.75rem; }
    .hero-btns { flex-direction: column; gap: 12px; }
    .btn { padding: 13px 28px; text-align: center; width: 100%; max-width: 280px; }

    /* Section titles */
    .section-title h2 { font-size: 1.9rem; }

    /* Services 1 col */
    .services-grid { grid-template-columns: 1fr; }
    .service-card { padding: 28px; }

    /* Products tabs wrap */
    .tabs { flex-wrap: wrap; gap: 8px; }
    .tab-btn { padding: 9px 22px; font-size: 0.85rem; }

    /* Products 1 col */
    .products-grid { grid-template-columns: 1fr; }

    /* About */
    .about { flex-direction: column; gap: 30px; }
    .about-content h2 { font-size: 1.7rem; }
    .about-stats { grid-template-columns: 1fr 1fr; padding: 20px; }
    .stat-item h4 { font-size: 2rem; }

    /* Partners */
    .partner-item { padding: 10px 18px; font-size: 1.1rem; }

    /* Presence: presencias en 2x2 */
    #presence .container > div:last-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    /* Footer */
    .footer-top { grid-template-columns: 1fr; gap: 30px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

    /* Overflow fix */
    body { overflow-x: hidden; }
    .partners-track { animation-duration: 25s; }
}

/* --- Small Mobile (≤420px) --- */
@media (max-width: 420px) {
    .hero-content h1 { font-size: 1.7rem; }
    .section-title h2 { font-size: 1.6rem; }
    .about-stats { grid-template-columns: 1fr; }
    .about-content h2 { font-size: 1.5rem; }
    #presence .container > div:last-child {
        grid-template-columns: 1fr !important;
    }
    .footer-top { gap: 24px; }
    .stat-item h4 { font-size: 1.8rem; }
}
