/* ===================== HOME STYLES ===================== */

body {
    background: var(--white);
    overflow-x: hidden;
}

/* LOADER */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--green-500), var(--green-100));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* HAMBURGER MENU */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
    z-index: 1001;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background: var(--white);
    transition: all 0.3s;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(9px, 9px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(9px, -9px);
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 998;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* PARTICLES */
.particles-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 20s infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(100px); opacity: 0; }
}

/* HERO */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: url('../imagenes/Rio_santa_catarina_la_huasteca.jpg') center center / cover no-repeat;
    overflow: hidden;
    padding-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(55, 58, 57, 0.88) 0%, 
        rgba(0, 0, 0, 0.78) 50%,
        rgba(24, 27, 27, 0.82) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
    width: 100%;
}

.hero-title {
    font-size: clamp(3.5rem, 8vw, 8rem);
    font-weight: 900;
    color: var(--white);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 3rem;
    max-width: 800px;
    animation: fadeInUp 0.8s ease 0.2s both;
    line-height: 1.6;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--teal-100), var(--teal-200));
    color: var(--white);
    border: none;
    box-shadow: 0 10px 30px rgba(0, 137, 123, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 137, 123, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--white);
    transform: translateY(-3px);
}

/* SECTIONS BASE */
section {
    padding: 120px 5%;
    position: relative;
}

.section-header {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 80px;
}

.section-badge {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, rgba(0, 137, 123, 0.1), rgba(77, 182, 172, 0.1));
    color: var(--teal-100);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid rgba(0, 137, 123, 0.2);
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--gray-900);
    font-weight: 900;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.section-description {
    font-size: 1.2rem;
    color: var(--gray-600);
    line-height: 1.8;
}

/* VIDEO SECTION */
#video-proyecto {
    background: #ffffff;
}

.video-container {
    max-width: 1100px;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
    position: relative;
    background: #ffffff;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* CONTENIDO CARDS */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.info-card {
    background: linear-gradient(135deg, var(--white) 0%, var(--gray-50) 100%);
    padding: 40px 35px;
    border-radius: 20px;
    border: 2px solid var(--gray-200);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--teal-100), var(--teal-200));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s;
}

.info-card:hover::before {
    transform: scaleX(1);
}

.info-card:hover {
    transform: translateY(-10px);
    border-color: var(--teal-100);
    box-shadow: 0 25px 60px rgba(0, 137, 123, 0.15);
}

.card-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--teal-100), var(--teal-200));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    transition: all 0.4s;
    box-shadow: 0 8px 20px rgba(0, 137, 123, 0.25);
}

.info-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card-icon i {
    font-size: 2rem;
    color: var(--white);
}

.card-title {
    font-size: 1.6rem;
    color: var(--gray-900);
    margin-bottom: 20px;
    font-weight: 800;
}

.card-list {
    list-style: none;
    margin-bottom: 20px;
}

.card-list li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    color: var(--gray-600);
    line-height: 1.6;
    font-size: 1rem;
}

.card-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--teal-100);
    font-weight: bold;
    font-size: 1.2rem;
}

.card-description {
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.card-example {
    background: rgba(0, 137, 123, 0.05);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid var(--teal-100);
    color: var(--gray-700);
    font-size: 0.95rem;
    font-style: italic;
}

/* ARDUINO CAROUSEL */
#arduino {
    background: linear-gradient(135deg, var(--green-500), var(--green-100));
}

.carousel-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.carousel-slide {
    display: none;
    animation: fadeIn 0.5s;
}

.carousel-slide.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.carousel-content {
    padding-right: 20px;
}

.carousel-title {
    font-size: 2.5rem;
    color: var(--white);
    font-weight: 800;
    margin-bottom: 25px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.carousel-description {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.8;
    margin-bottom: 30px;
}

.carousel-features {
    list-style: none;
    margin-top: 25px;
}

.carousel-features li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 12px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-features li:last-child {
    border-bottom: none;
}

.carousel-features i {
    font-size: 1.3rem;
    color: var(--green-50);
    margin-top: 3px;
    min-width: 24px;
}

.carousel-image-wrapper {
    position: relative;
    background: rgba(0, 0, 0, 0.15);
    padding: 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    margin: 0 auto;
}

.carousel-slide img {
    width: 100%;
    max-width: 380px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: block;
    margin: 0 auto;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 50px;
}

.indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.5);
}

.indicator.active {
    background: var(--white);
    transform: scale(1.2);
    border-color: var(--green-50);
}

/* APP SECTION */
#app {
    background: var(--white);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.app-content h3 {
    font-size: 2.5rem;
    color: var(--gray-900);
    font-weight: 800;
    margin-bottom: 20px;
}

.app-content p {
    font-size: 1.1rem;
    color: var(--gray-600);
    margin-bottom: 15px;
    line-height: 1.7;
}

.app-features {
    list-style: none;
    margin: 30px 0;
}

.app-features li {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--gray-50);
    border-radius: 12px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.app-features li:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(0, 137, 123, 0.15);
}

.app-features i {
    font-size: 1.5rem;
    color: var(--teal-100);
}

.qr-container {
    background: var(--gray-50);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 3px dashed var(--gray-300);
}

.qr-placeholder {
    width: 300px;
    height: 300px;
    background: var(--white);
    border-radius: 15px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gray-200);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.qr-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.qr-placeholder i {
    position: absolute;
    font-size: 3rem;
    color: var(--gray-300);
    z-index: 0;
    pointer-events: none;
}

/* Ocultar icono cuando hay imagen */
.qr-placeholder:has(img) i {
    display: none;
}

.qr-text {
    font-size: 1.1rem;
    color: var(--gray-600);
    font-weight: 600;
}

/* SERVICIOS */
#servicios {
    background: #ffffff;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.service-card {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    padding: 50px 40px;
    border-radius: 24px;
    border: 2px solid var(--gray-200);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--teal-100), var(--teal-200));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-15px);
    border-color: var(--teal-100);
    box-shadow: 0 30px 80px rgba(0, 137, 123, 0.2);
}

.service-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--teal-100), var(--teal-200));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    transition: all 0.4s;
    box-shadow: 0 10px 30px rgba(0, 137, 123, 0.3);
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

.service-icon i {
    font-size: 2.5rem;
    color: var(--white);
}

.service-title {
    font-size: 1.8rem;
    color: var(--gray-900);
    margin-bottom: 20px;
    font-weight: 800;
}

.service-description {
    color: var(--gray-600);
    line-height: 1.8;
    margin-bottom: 30px;
    font-size: 1.05rem;
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--teal-100);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1.05rem;
}

.service-link:hover {
    gap: 15px;
    color: var(--teal-200);
}

/* CTA */
#cta {
    background: linear-gradient(135deg, var(--green-500), var(--green-100));
    text-align: center;
    position: relative;
    overflow: hidden;
}

#cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveGrid 20s linear infinite;
}

@keyframes moveGrid {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-content h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--white);
    margin-bottom: 1.5rem;
    font-weight: 900;
}

.cta-content p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-white {
    padding: 18px 45px;
    background: var(--white);
    color: var(--teal-100);
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.btn-white:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* FOOTER */
footer {
    background: #0a1f1a;
    color: #e0e0e0;
    padding: 80px 5% 30px;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--teal-100), transparent);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1.5fr;
    gap: 50px;
    max-width: 1400px;
    margin: 0 auto 50px;
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 25px;
    font-size: 1.4rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.footer-section p {
    font-size: 1rem;
    line-height: 1.9;
    margin-bottom: 25px;
    color: #d0d0d0;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 16px;
}

.footer-links a {
    color: #d0d0d0;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--green-50);
    padding-left: 8px;
}

.footer-links a i {
    color: var(--teal-100);
    font-size: 1.1rem;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 137, 123, 0.15);
    border: 2px solid rgba(0, 137, 123, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    text-decoration: none;
    color: #d0d0d0;
    font-size: 1.2rem;
}

.social-btn:hover {
    background: linear-gradient(135deg, var(--teal-100), var(--teal-200));
    color: var(--white);
    transform: translateY(-5px) rotate(360deg);
    border-color: var(--teal-200);
}

.footer-bottom {
    border-top: 1px solid rgba(0, 137, 123, 0.3);
    padding-top: 30px;
    text-align: center;
    font-size: 0.95rem;
    color: #b0b0b0;
}

/* SCROLL TOP */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--teal-100), var(--teal-200));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
    box-shadow: 0 5px 20px rgba(0, 137, 123, 0.4);
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-5px) scale(1.1);
}

.scroll-top i {
    color: var(--white);
    font-size: 1.2rem;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .footer-content, .app-container {
        grid-template-columns: 1fr 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 968px) {
    .header-actions {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 350px;
        height: 100vh;
        background: var(--green-500);
        flex-direction: column;
        padding: 100px 2rem;
        transition: right 0.4s;
        align-items: flex-start;
        gap: 1.2rem;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
        z-index: 999;
    }

    .header-actions.active {
        right: 0;
    }

    .header-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 15px 20px;
        font-size: 1.05rem;
    }

    .hamburger {
        display: flex;
    }

    .footer-content, .app-container {
        grid-template-columns: 1fr;
    }

    .carousel-slide.active {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .carousel-content {
        padding-right: 0;
    }

    .carousel-image-wrapper {
        order: -1;
    }

    section {
        padding: 80px 5%;
    }
}

@media (max-width: 640px) {
    body {
        padding-top: 50px;
    }

    .header-btn span {
        display: inline;
    }

    .header-btn {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .btn-white, .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    section {
        padding: 60px 5%;
    }

    .qr-placeholder {
        width: 250px;
        height: 250px;
    }

    .carousel-title {
        font-size: 2rem;
    }

    .carousel-description {
        font-size: 1rem;
    }

    .carousel-image-wrapper {
        padding: 20px;
        max-width: 280px;
    }
    
    .carousel-slide img {
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .carousel-image-wrapper {
        padding: 15px;
        max-width: 280px;
    }
    
    .carousel-slide img {
        max-width: 250px;
    }
}