/* ================= VARIABLES & UTILS ================= */
:root {
    --bg-white: #ffffff;
    --bg-black: #050505;
    --bg-light-gray: #f4f6f8;
    --bg-card: #ffffff;
    --text-black: #111;
    --text-white: #fff;
    --text-gray: #888;
    --accent:#e6321f;
    --border-color: #eee;
    --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
    --font-heading: 'Titillium Web', sans-serif;
    --font-primary: 'Inter', sans-serif;
}

body { background-color: var(--bg-white); color: var(--text-black); font-family: var(--font-primary); overflow-x: hidden; }

/* UTILS */
.bg-black { background-color: #050505 !important; color: var(--text-white); }
.bg-white { background-color: #ffffff !important; color: var(--text-black); }
.bg-light-gray { background-color: #f4f6f8 !important; }

.relative-z { position: relative; z-index: 5; }
.text-center { text-align: center; }
.text-orange { color: var(--accent); }
.text-gray { color: var(--text-gray); }
.text-white { color: #fff; }
.mb-60 { margin-bottom: 60px; }
.mb-40 { margin-bottom: 40px; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }

/* === SECCIONES MÁS GRANDES === */
.section-pad { padding: 180px 0; } /* AUMENTADO PARA MÁS ESPACIO */

::selection { background: var(--accent); color: #fff; text-shadow: none; }

/* TYPOGRAPHY */
h1, h2, h3, .headline-giant, .headline-giant-factory, .headline-lg, .headline-md { font-family: var(--font-heading); }

.headline-giant { 
    font-size: 8rem; font-weight: 300; line-height: 0.95; letter-spacing: -3px; 
    margin: 30px 0; text-align: left; 
}
.headline-giant-factory { font-size: 7rem; font-weight: 300; line-height: 0.9; letter-spacing: -2px; margin-bottom: 0; color: #fff; }
.headline-lg { font-size: 4rem; font-weight: 300; line-height: 1.1; }
.headline-md { font-size: 2.5rem; font-weight: 600; }
.body-lg { font-size: 1.3rem; line-height: 1.6; font-weight: 300; }
.body-sm { font-size: 1.1rem; line-height: 1.6; }
.hero-desc { font-size: 1.5rem; color: rgba(255,255,255,0.7); font-weight: 300; text-align: left; margin-top: 30px; }

/* PILLS */
.pill-badge { 
    display: inline-flex; align-items: center; justify-content: center; width: fit-content;
    padding: 8px 20px; border-radius: 50px; font-size: 0.75rem; font-weight: 700; 
    letter-spacing: 2px; text-transform: uppercase; 
    background-color: transparent; border: 1px solid currentColor; color: inherit; margin-bottom: 20px;
}
.pill-badge.grey { border-color: #999; color: #666; }
.pill-badge.orange { border-color: var(--accent); color: var(--accent); }
.pill-badge.white-outline { border-color: rgba(255,255,255,0.5); color: #fff; }
.pill-badge.white-bg { background-color: #fff; border: 1px solid #eee; color: #333; }

.pill-badge.glass-effect { 
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.2); 
    color: #fff; backdrop-filter: blur(5px); 
}
.pill-badge.glass-effect::before { content: ""; width: 6px; height: 6px; background: var(--accent); margin-right: 10px; border-radius: 50%; }

/* BOTONES */
.btn-cta { display: inline-flex; align-items: center; gap: 10px; padding: 12px 30px; border-radius: 50px; font-weight: 700; text-decoration: none; transition: 0.3s; width: fit-content; cursor: pointer; border: none; }
.btn-cta.orange { background: var(--accent); color: #fff; }
.btn-cta.orange:hover { background:#e6321f; transform: translateY(-3px); }
.btn-cta.white { background: #fff; color: #000; }
.btn-cta.white:hover { background: #ddd; }

.link-arrow { color: #000; font-weight: 600; display: inline-flex; align-items: center; gap: 10px; transition: 0.3s; width: fit-content; }
.link-arrow:hover { gap: 15px; color: var(--accent); }

/* ANIMATIONS */
.fade-section { opacity: 0; transform: translateY(20px); transition: 0.8s ease; }
.fade-section.visible { opacity: 1; transform: translateY(0); }
.slide-in-left { opacity: 0; transform: translateX(-60px); transition: 1s var(--ease-smooth); }
.slide-in-right { opacity: 0; transform: translateX(60px); transition: 1s var(--ease-smooth); }
.slide-in-up { opacity: 0; transform: translateY(60px); transition: 1s var(--ease-smooth); }
.fade-up { opacity: 0; transform: translateY(30px); animation: fadeUp 1s var(--ease-smooth) forwards; }
.delay-1 { transition-delay: 0.2s; animation-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; animation-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; animation-delay: 0.6s; }
.is-visible { opacity: 1; transform: translate(0,0); }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
.word-up { display: inline-block; opacity: 0; transform: translateY(80px); filter: blur(10px); animation: revealWord 1.2s cubic-bezier(0.2, 1, 0.3, 1) forwards; animation-delay: var(--d); margin-right: 0.1em; }
@keyframes revealWord { 0% { opacity: 0; transform: translateY(80px); filter: blur(10px); } 100% { opacity: 1; transform: translateY(0); filter: blur(0); } }

/* ================= HERO STICKY ================= */
.page-intro {
    position: sticky; top: 0; z-index: 0;
    background: radial-gradient(circle at 80% 50%, #1a1a1a 0%, #000 100%);
    color: #fff; height: 100vh; padding: 0;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    overflow: hidden;
}
#tech-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; opacity: 0.4; }
.hero-glow { position: absolute; top: 50%; right: -10%; width: 800px; height: 800px; background: radial-gradient(circle, rgba(255,255,255,0.02) 0%, transparent 70%); border-radius: 50%; pointer-events: none; z-index: 1; transform: translateY(-50%); }
.scroll-indicator { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.5); font-size: 0.8rem; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* ================= SMART FACTORY STICKY ================= */
.section-smart-factory {
    position: sticky; top: 0; z-index: 5;
    height: 100vh; background-color: #111111 !important; 
    display: flex; align-items: center; overflow: hidden;
    box-shadow: 0 -20px 50px rgba(0,0,0,0.5);
}
.factory-split { display: grid; grid-template-columns: 1fr 1fr; height: 100%; align-items: center; width: 100%; gap: 80px; }
.factory-col-left { border-right: 1px solid rgba(255,255,255,0.1); height: 100%; display: flex; flex-direction: column; justify-content: center; }
.factory-col-right { display: flex; flex-direction: column; justify-content: center; }

/* ================= CONTENT LAYER ================= */
.content-layer { position: relative; z-index: 10; background-color: #ffffff; box-shadow: 0 -50px 100px rgba(0,0,0,0.5); width: 100%; }

.partners-row { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; opacity: 0.6; filter: grayscale(100%); transition: 0.3s; }
.partners-row:hover { opacity: 1; filter: none; }
.partner-img { height: 30px; }
.about-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 60px; align-items: center; }
.about-desc { font-size: 1.1rem; color: #666; line-height: 1.6; }
.about-gallery { display: flex; gap: 20px; min-height: 400px; position: relative; }
.gallery-card { flex: 1; border-radius: 24px; overflow: hidden; position: relative; cursor: pointer; transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.gallery-card.active { flex: 2.5; cursor: default; }
.gallery-card.active img { transform: scale(1.05); }
.card-floating-badge { position: absolute; background: #fff; color: #000; padding: 8px 16px; border-radius: 30px; font-size: 0.8rem; font-weight: 700; z-index: 3; box-shadow: 0 4px 10px rgba(0,0,0,0.2); border: none; cursor: pointer; display: flex; align-items: center; gap: 6px; width: fit-content; }
.pos-top { top: 20px; left: 20px; cursor: default; }
.pos-bottom { bottom: 20px; left: 20px; transition: 0.2s; }
.pos-bottom:hover { background: var(--accent); color: #fff; }
.click-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.3); z-index: 2; transition: 0.3s; }
.gallery-card.active .click-overlay { opacity: 0; pointer-events: none; }
.alliance-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 60px; align-items: center; }
.video-container { position: relative; border-radius: 24px; overflow: hidden; border: 1px solid #333; width: 100%; aspect-ratio: 16/9; background: #000; }
.video-cover { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; cursor: pointer; background-color: #111; }
.video-cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; transition: 0.3s; }
.video-cover:hover img { opacity: 0.9; }
.play-btn { width: 70px; height: 70px; background: var(--accent); color: #fff; border: none; border-radius: 50%; font-size: 1.5rem; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.play-btn:hover { transform: scale(1.1); }
#main-video { width: 100%; height: 100%; display: none; object-fit: cover; }
.products-white-wrapper { background-color: #fff; border-radius: 40px; padding: 60px 40px; box-shadow: 0 10px 40px rgba(0,0,0,0.03); }
.pill-explore { display: inline-flex; align-items: center; gap: 8px; padding: 10px 24px; border-radius: 50px; border: 1px solid #eee; font-size: 0.9rem; font-weight: 500; color: #555; transition: 0.3s; text-decoration: none; width: fit-content; }
.pill-explore:hover { background: #000; color: #fff; border-color: #000; }
.products-grid-perfect { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.prod-card-clean { background: #fff; border-radius: 24px; border: 1px solid #f0f0f0; padding: 20px; display: flex; flex-direction: column; transition: transform 0.3s, box-shadow 0.3s; }
.prod-card-clean:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); }
.prod-badge { display: inline-flex; padding: 4px 12px; border-radius: 50px; border: 1px solid #ddd; font-size: 0.7rem; color: #555; font-weight: 700; width: fit-content; text-transform: uppercase; margin-bottom: 15px; }
.prod-img-wrapper { background-color: #eef0f5; border-radius: 16px; height: 180px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.prod-img-wrapper img { max-width: 90%; max-height: 90%; object-fit: contain; mix-blend-mode: multiply; }
.prod-info { margin-top: auto; }
.prod-category { font-size: 0.8rem; color: #888; }
.prod-name { font-size: 1.2rem; font-weight: 700; color: #000; margin: 0; }
.warranty-card { background: #1a1a1a; border-radius: 32px; padding: 60px; min-height: 350px; display: flex; align-items: center; justify-content: space-between; color: #fff; box-shadow: 0 20px 40px rgba(0,0,0,0.2); gap: 40px; }
.btn-pill-dark { display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px; background: #fff; color: #000; border-radius: 50px; font-weight: 600; text-transform: uppercase; font-size: 0.9rem; transition: 0.3s; width: fit-content; }
.btn-pill-dark:hover { background: #ddd; }
.warranty-img { max-width: 400px; height: auto; filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5)); }
.solutions-grid-square { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.sol-card-sq { border-radius: 30px; padding: 35px 30px; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,0.08); transition: transform 0.3s; background-color: #fff; height: 100%; }
.sol-card-sq:hover { transform: translateY(-8px); }
.sol-card-sq.black { background-color: #0b0b0d; color: #fff; }
.sol-card-sq.orange { background-color: var(--accent); color: #fff; }
.sol-content-sq { margin-top: 10px; margin-bottom: 30px; }
.sol-content-sq h4 { font-size: 1.6rem; margin-bottom: 10px; font-weight: 700; }
.btn-sol-icon { width: 50px; height: 50px; border-radius: 50%; border: 2px solid; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-top: auto; transition: 0.3s; }
.btn-sol-icon:hover { transform: scale(1.1); }

/* ================= CTA SEPARADO & FOOTER ================= */
.footer-pre-wrapper { 
    position: relative; 
    z-index: 15; 
    background-color: #111 !important; /* Ligeramente más claro que el footer real */
    
    /* EFECTO TARJETA FLOTANTE */
    margin: 0 20px 40px 20px; /* Separación de los bordes y del footer */
    border-radius: 40px; 
    padding: 100px 0;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.footer-solid { 
    position: relative; 
    z-index: 20; 
    background-color: #000000 !important; 
    padding-top: 20px; 
}

/* ================= ANIMACIÓN ESCALONADA (CARDS) ================= */
.prod-card-clean, .sol-card-sq { opacity: 0; transform: translateY(40px); transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1); }
.fade-section.visible .prod-card-clean, .fade-section.visible .sol-card-sq { opacity: 1; transform: translateY(0); }
.fade-section.visible .prod-card-clean:nth-child(1) { transition-delay: 0.1s; }
.fade-section.visible .prod-card-clean:nth-child(2) { transition-delay: 0.2s; }
.fade-section.visible .prod-card-clean:nth-child(3) { transition-delay: 0.3s; }
.fade-section.visible .prod-card-clean:nth-child(4) { transition-delay: 0.4s; }
.fade-section.visible .sol-card-sq:nth-child(1) { transition-delay: 0.1s; }
.fade-section.visible .sol-card-sq:nth-child(2) { transition-delay: 0.2s; }
.fade-section.visible .sol-card-sq:nth-child(3) { transition-delay: 0.3s; }
.prod-card-clean:hover, .sol-card-sq:hover { transition-delay: 0s; transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .headline-giant { font-size: 6rem; }
    .page-intro, .section-smart-factory { min-height: 80vh; height: auto; padding: 80px 0; }
    .factory-split, .about-grid, .alliance-grid, .products-grid-perfect, .solutions-grid-square { grid-template-columns: 1fr; gap: 40px; }
    .warranty-card { flex-direction: column; text-align: center; }
    .warranty-img { width: 80%; }
    .factory-col-left { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 40px; margin-bottom: 40px; }
    .footer-pre-wrapper { margin: 0; border-radius: 0; } /* En móvil vuelve a ser ancho completo */
}
@media (max-width: 768px) {
    .headline-giant { font-size: 4rem; letter-spacing: -2px; }
    .headline-giant-factory { font-size: 3.5rem; }
    .about-gallery { flex-direction: column; height: auto; }
    .gallery-card { min-height: 250px; }
    .products-grid-perfect { grid-template-columns: 1fr; }
    .section-pad { padding: 80px 0; } /* En móvil un poco menos para que no sea excesivo */
}