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

body {
    background-color: #000;
    font-family: 'Manrope', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* ===== NAVEGACIÓN ===== */
.navbar {
    width: 100%;
    max-width: 100vw;
    background: linear-gradient(90deg, #040404 0%, #171717 100%);
    padding: 1rem 5%;
    position: fixed;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
}

.navbar.scrolled {
    background: rgba(4, 4, 4, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo img {
    height: 60px;
    width: auto;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 3rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    text-shadow: 0 0 8px white;
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(90deg, #fff, #888);
    transition: width 0.3s ease;
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* ===== HERO SECTION ===== */
.hero {
    background-image: url('Assets/hero.png');
    background-size: cover;
    background-position: center;
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 80px;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: black;
    animation: fadeOutBlack 2.5s ease-out forwards;
    z-index: 2;
}

.lamp {
    position: absolute;
    top: 14%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lamp img {
    max-width: 100%;
    height: auto;
    animation: lampFlicker 3s ease-out forwards;
    transform-origin: center bottom;
    z-index: 5;
    position: relative;
}

.hero-text {
    position: absolute;
    top: 75%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 6rem 2rem;
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    z-index: 4;
    text-align: center;
    animation: lampFlicker 3s ease-out forwards;
    line-height: 140%;
    letter-spacing: 0.2em;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    background: linear-gradient(45deg, #ffffff, #e0e0e0, #ffffff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: lampFlicker 3s ease-out forwards, textGlow 4s ease-in-out infinite;
    transition: all 0.3s ease;
    cursor: default;
}

.hero-text:hover {
    transform: translate(-50%, -50%) scale(1.05);
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.8);
    animation: lampFlicker 3s ease-out forwards, textGlow 2s ease-in-out infinite;
}

/* ===== NOSOTROS SECTION ===== */
.nosotros {
    background-color: #000;
    padding: 6rem 5%;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.nosotros-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 4rem;
}

.nosotros-content {
    flex: 1;
    color: white;
    max-width: 600px;
}

.nosotros-content h2 {
    font-size: clamp(32px, 6vw, 48px);
    font-weight: 500;
    letter-spacing: 0.16em;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.nosotros-content p {
    font-size: clamp(14px, 2.5vw, 16px);
    font-weight: 400;
    line-height: 1.6;
}

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

.nosotros-image img {
    max-height: 80vh;
    width: auto;
    max-width: 100%;
}

/* ===== SOLUCIONES SECTION ===== */
.soluciones {
    padding: 6rem 2rem;
    text-align: center;
    background: #000;
    color: white;
    min-height: auto;
}

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

.soluciones h2 {
    font-size: clamp(32px, 6vw, 48px);
    font-weight: 500;
    letter-spacing: 0.16em;
    margin-bottom: 4rem;
    text-transform: uppercase;
}

/* ===== SERVICIOS SECTION ===== */
.servicios {
    background-color: #000;
    padding: 6rem 2rem;
    min-height: 100vh;
}

.servicios-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 2rem 0;
}

.servicios h2 {
    font-size: clamp(32px, 6vw, 48px);
    font-weight: 500;
    letter-spacing: 0.16em;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 0;
}

.card {
    background-color: #E8E8E8;
    border-radius: 24px;
    overflow: hidden;
    text-align: left;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(40px);
    opacity: 0;
    transition: all 0.6s ease-out;
    position: relative;
}

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

.card-img {
    height: 200px;
    width: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(65%);
    transition: filter 0.3s ease;
}

.card-text {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-text h3 {
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #000;
}

.card-text p {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    margin: 0;
}

/* ===== RESPLANDOR EXTERIOR EN CARDS ===== */
.card::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: white;
    border-radius: 28px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.9), 0 0 60px rgba(255, 255, 255, 0.6);
}

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

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.card:hover .card-img {
    filter: brightness(100%);
}

/* ===== PROYECTOS SECTION ===== */
.proyectos-experiencia {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    padding: 6rem 2rem;
    color: white;
}

.proyectos-experiencia-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.proyectos-experiencia h2 {
    font-size: clamp(32px, 6vw, 48px);
    font-weight: 500;
    letter-spacing: 0.16em;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.proyectos-subtitle {
    font-family: 'Manrope', sans-serif;
    font-size: clamp(16px, 2.5vw, 18px);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.logos-container {
    width: 100%;
    position: relative;
    margin: 2rem 0;
}

.logos-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.logo-item {
    flex: 0 0 auto;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
}

.company-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
    opacity: 0.7;
    transform: scale(1);
}

.company-logo:hover {
    filter: brightness(1) invert(0);
    opacity: 1;
    transform: scale(1.1);
}

/* Ajuste específico para el logo de El Árbol */
.logo-el-arbol {
    transform: scale(1.2);
}

.logo-el-arbol:hover {
    transform: scale(1.3);
}

/* Estilos responsivos para los logos */
@media (max-width: 768px) {
    .logos-grid {
        gap: 2rem;
    }
    
    .logo-item {
        height: 120px;
        padding: 0 1rem;
    }
    
    .logo-el-arbol {
        transform: scale(1.1);
    }
    
    .logo-el-arbol:hover {
        transform: scale(1.2);
    }
}

/* ===== CONTACTO SECTION ===== */
.contacto {
    background-image: url('Assets/contacto.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 6rem 2rem;
    text-align: center;
    color: white;
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.contacto-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.contacto-container {
    position: relative;
    z-index: 2;
}

.contacto-container {
    max-width: 800px;
    margin: 0 auto;
}

.contacto h2 {
    font-size: clamp(32px, 6vw, 48px);
    font-weight: 500;
    letter-spacing: 0.16em;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.contacto-subtitle {
    font-family: 'Manrope', sans-serif;
    font-size: clamp(16px, 2.5vw, 18px);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.contacto > .contacto-container > p {
    font-size: clamp(16px, 2.5vw, 18px);
    margin-bottom: 3rem;
    opacity: 0.9;
}

.contacto-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.contacto-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.contacto-item:hover {
    transform: translateY(-2px);
}

.contacto-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.contacto-item:hover .contacto-icon {
    transform: scale(1.1);
}

.contacto-item h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #00ffff;
}

.contacto-item p {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 500;
}

.contacto-item p a {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.contacto-item p a:hover {
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* ===== ANIMACIONES ===== */
@keyframes fadeOutBlack {
    0% { opacity: 1; }
    40% { opacity: 1; }
    60% { opacity: 0.6; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes lampFlicker {
    0% { opacity: 0; }
    5% { opacity: 1; }
    10% { opacity: 0.1; }
    15% { opacity: 1; }
    20% { opacity: 0.3; }
    25% { opacity: 1; }
    30% { opacity: 0.2; }
    35% { opacity: 1; }
    40% { opacity: 0.4; }
    45% { opacity: 1; }
    50% { opacity: 0.3; }
    55% { opacity: 1; }
    60% { opacity: 0.2; }
    65% { opacity: 1; }
    70% { opacity: 0.5; }
    75% { opacity: 1; }
    80% { opacity: 1; }
    85% { opacity: 1; }
    90% { opacity: 1; }
    95% { opacity: 1; }
    100% { opacity: 1; }
}

@keyframes textGlow {
    0% { 
        background-position: 0% 50%;
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }
    50% { 
        background-position: 100% 50%;
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
    }
    100% { 
        background-position: 0% 50%;
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }
}

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

/* Tablets */
@media (max-width: 768px) {
    .hero {
        background-size: cover;
        background-position: center center;
        width: 100%;
        max-width: 100vw;
        overflow: hidden;
    }
    
    .lamp {
        top: 22%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .hero-text {
        top: 75%;
        font-size: 16px;
        letter-spacing: 0.18em;
        padding: 4rem 1rem;
    }
    
    .nav-menu {
        gap: 2rem;
    }
    
    .nosotros-container {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
    }
    
    .nosotros-content {
        order: 2;
    }
    
    .nosotros-image {
        order: 1;
    }
    
    .nosotros-image img {
        max-height: 60vh;
    }
    
    .servicios-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 2rem;
    }
    
    .hero-text {
        top: 75%;
        font-size: 16px;
        padding: 4rem 1rem;
    }
    
    .proyectos-experiencia .logos-grid {
        gap: 2rem;
    }
    
    .proyectos-experiencia .logo-item {
        height: 120px;
    }
    
    .contacto-info {
        gap: 2.5rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .navbar {
        padding: 1rem 3%;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: rgba(4, 4, 4, 0.95);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 1rem;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .hero {
        margin-top: 80px;
        background-attachment: scroll;
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center center;
        height: 70vh;
        width: 100%;
        max-width: 100vw;
        overflow: hidden;
    }
    
    .contacto {
        background-attachment: scroll;
    }
    
    .lamp {
        top: 20%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .hero-text {
        top: 85%;
        padding: 2rem 1rem;
        font-size: 14px;
        letter-spacing: 0.15em;
        line-height: 130%;
    }
    
    .nosotros {
        padding: 4rem 3%;
    }
    
    .nosotros-content h2 {
        font-size: clamp(24px, 8vw, 32px);
    }
    
    .soluciones {
        padding: 4rem 1rem;
    }
    
    .servicios {
        padding: 3rem 1rem;
    }
    
    .servicios-container {
        padding: 1rem 0;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .card {
        max-width: 100%;
    }
    
    .contacto {
        padding: 4rem 1rem;
    }
    
    .contacto-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .contacto-item {
        padding: 0.5rem 0.8rem;
    }
    
    .contacto-icon {
        width: 20px;
        height: 20px;
    }
    
    .proyectos-experiencia .logos-grid {
        gap: 1.5rem;
    }
    
    .proyectos-experiencia .logo-item {
        height: 100px;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .nav-container,
    .nosotros-container,
    .soluciones-container,
    .servicios-container,
    .contacto-container {
        max-width: 1400px;
    }
    
    .hero-text {
        font-size: 20px;
        letter-spacing: 0.25em;
    }
    
    .nosotros-content h2 {
        font-size: 56px;
    }
}

/* Ultra-wide screens */
@media (min-width: 1600px) {
    .nav-container,
    .nosotros-container,
    .soluciones-container,
    .servicios-container,
    .contacto-container {
        max-width: 1600px;
    }
    
    .hero-text {
        font-size: 22px;
        letter-spacing: 0.3em;
    }
    
    .nosotros-content h2 {
        font-size: 64px;
    }
}

/* Landscape orientation for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: 100vh;
        margin-top: 60px;
        background-size: contain;
        background-position: center center;
    }
    
    .lamp {
        top: 15%;
    }
    
    .lamp img {
        max-width: 60%;
    }
    
    .hero-text {
        top: 60%;
        font-size: clamp(12px, 3vw, 18px);
        letter-spacing: 0.15em;
    }
    
    .nosotros {
        padding: 3rem 5%;
    }
    
    .nosotros-container {
        gap: 2rem;
    }
}

/* ===== FOOTER ===== */
footer {
    background: linear-gradient(90deg, #040404 0%, #171717 100%);
    padding: 2rem 5%;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    margin: 0;
}

.footer-content a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: white;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Footer responsive */
@media (max-width: 768px) {
    footer {
        padding: 1.5rem 1rem;
    }
    
    .footer-content p {
        font-size: 12px;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .hero {
        height: 60vh;
        background-size: cover;
        background-position: center center;
        width: 100%;
        max-width: 100vw;
        overflow: hidden;
    }
    
    .lamp {
        top: 18%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .lamp img {
        max-width: 70%;
    }
    
    .hero-text {
        top: 80%;
        font-size: 12px;
        padding: 1.5rem 1rem;
    }
}

/* Very small devices */
@media (max-width: 360px) {
    .hero {
        height: 55vh;
        background-size: cover;
        background-position: center center;
        width: 100%;
        max-width: 100vw;
        overflow: hidden;
    }
    
    .lamp {
        top: 20%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .lamp img {
        max-width: 60%;
    }
    
    .hero-text {
        top: 75%;
        font-size: 11px;
        padding: 1rem 0.8rem;
        letter-spacing: 0.1em;
    }
}

/* Fix horizontal overflow for all mobile devices */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    .navbar,
    .hero,
    .nosotros,
    .soluciones,
    .proyectos-experiencia,
    .contacto,
    footer {
        width: 100%;
        max-width: 100vw;
        overflow: hidden;
    }
}

/* ===== BOTÓN FLOTANTE DE WHATSAPP ===== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(45deg, #25d366, #128c7e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
    transition: all 0.3s ease;
    z-index: 10000;
    overflow: hidden;
}

.whatsapp-float::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #128c7e, #25d366);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.whatsapp-float:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.4);
}

.whatsapp-float:hover::before {
    opacity: 1;
}

.whatsapp-float:active {
    transform: translateY(-2px) scale(1.05);
}

.whatsapp-icon {
    width: 35px;
    height: 35px;
    color: white;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.whatsapp-tooltip {
    position: absolute;
    right: 85px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 6px solid rgba(0, 0, 0, 0.9);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    right: 90px;
}

/* WhatsApp float responsive */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-icon {
        width: 30px;
        height: 30px;
    }
    
    .whatsapp-tooltip {
        right: 75px;
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .whatsapp-float:hover .whatsapp-tooltip {
        right: 80px;
    }
}

@media (max-width: 480px) {
    .whatsapp-float {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
    }
    
    .whatsapp-icon {
        width: 28px;
        height: 28px;
    }
    
    .whatsapp-tooltip {
        right: 70px;
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .whatsapp-float:hover .whatsapp-tooltip {
        right: 75px;
    }
}
