/* SISTEMA BASE - HEAVY DUTY PREMIUM */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

:root {
    --bg-dark: #02040a;
    --bg-surface: #0a0e17;
    --bg-surface-hover: #111827;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8; /* Contraste mejorado para Lighthouse 100 A11y */
    --accent-brand: #ff6b35; /* Un naranja fuerte, o el original */
    --accent-light: #ff9c7a;
    --border-dim: rgba(255, 255, 255, 0.08);
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    font-family: var(--font-body);
    /* Subtle blueprint grid */
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center;
    background-attachment: fixed;
}

a, button { text-decoration: none; cursor: pointer; }

/* TYPOGRAPHY */
.hd-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 6.5rem);
    text-transform: uppercase;
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.02em;
    margin: 0;
    color: #ffffff;
}
.hd-subtitle {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-light);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 700;
}

/* BUTTONS */
.hd-btn {
    display: inline-flex;
    align-items: center;
    padding: 1.2rem 3rem;
    background: var(--accent-brand);
    color: #000;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: none;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.3s ease;
    position: relative;
}
.hd-btn:hover {
    background: var(--text-main);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 107, 53, 0.2);
}
.hd-btn-outline {
    background: transparent;
    color: var(--accent-light);
    border: 2px solid var(--accent-brand);
    clip-path: none;
}
.hd-btn-outline:hover {
    background: var(--accent-brand);
    color: #000;
}

/* HERO SECTION */
.hd-hero {
    position: relative;
    min-height: 90vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--border-dim);
}
.hero-content {
    padding: 6rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--border-dim);
    position: relative;
    z-index: 2;
}
.hero-visual {
    position: relative;
    overflow: hidden;
    background: var(--bg-surface);
}
.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    mix-blend-mode: luminosity;
    transition: all 0.8s ease;
}
.hero-visual:hover img {
    mix-blend-mode: normal;
    opacity: 1;
    transform: scale(1.02);
}
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border-dim);
    background: rgba(2,4,10,0.8);
    backdrop-filter: blur(10px);
    position: absolute;
    bottom: 0;
    width: 100%;
    z-index: 3;
}
.stat-box {
    padding: 1.5rem;
    border-right: 1px solid var(--border-dim);
    text-align: center;
}
.stat-box:last-child { border-right: none; }
.stat-num { font-family: var(--font-display); font-size: 2rem; color: #fff; font-weight: 700; }
.stat-label { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }

@media (max-width: 1000px) {
    .hd-hero { grid-template-columns: 1fr; }
    .hero-content { border-right: none; padding: 4rem 2rem; }
    .hero-visual { display: none; }
    .hero-stats { position: relative; grid-template-columns: 1fr 1fr; }
    .stat-box:nth-child(2) { border-right: none; }
    .stat-box { border-bottom: 1px solid var(--border-dim); }
}

/* CARDS: GAVETAS DE ACERO */
.hd-section { padding: 8rem 0; border-bottom: 1px solid var(--border-dim); }
.hd-container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}
.cat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 4/3;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cat-card:hover {
    border-color: var(--accent-brand);
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
}
.cat-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    filter: grayscale(80%);
    transition: all 0.6s ease;
}
.cat-card:hover .cat-bg { opacity: 0.6; filter: grayscale(0%); transform: scale(1.05); }
.cat-content {
    position: relative;
    z-index: 2;
    padding: 1.5rem;
    background: linear-gradient(to top, var(--bg-dark) 0%, transparent 100%);
    transition: transform 0.4s ease;
}
.cat-num { font-family: var(--font-mono); font-size: 1rem; color: var(--accent-brand); margin-bottom: 0.5rem; }
.cat-title { font-family: var(--font-display); font-size: clamp(1.2rem, 1.8vw, 1.8rem); line-height: 1.1; color: #fff; margin: 0; text-transform: uppercase; font-weight: 700; }
.cat-meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }

/* PRODUCT CATALOGUE */
.prod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1px;
    background: var(--border-dim);
    border: 1px solid var(--border-dim);
}
.prod-card {
    background: var(--bg-dark);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background 0.3s ease;
}
.prod-card:hover { background: var(--bg-surface); }
.prod-img { height: 220px; display: flex; justify-content: center; align-items: center; margin-bottom: 2rem; }
.prod-img img { max-height: 100%; max-width: 100%; object-fit: contain; }
.prod-badge { position: absolute; top: 1.5rem; right: 1.5rem; background: var(--border-dim); color: var(--text-main); font-family: var(--font-mono); font-size: 0.7rem; padding: 0.3rem 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; }
.prod-card:hover .prod-badge { background: var(--accent-brand); color: #000; }
.prod-vendor { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 0.5rem; }
.prod-title { font-size: 1.1rem; color: #fff; font-weight: 500; margin-bottom: 1rem; line-height: 1.4; }
.prod-price { font-family: var(--font-display); font-size: 1.5rem; color: var(--accent-light); font-weight: 700; margin-top: auto; }

/* BENEFITS & TESTIMONIALS (PLACAS DE ACERO) */
.placa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.placa-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    padding: 3rem;
    position: relative;
}
.placa-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-brand);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.4s ease;
}
.placa-card:hover::before { transform: scaleY(1); }
.placa-title { font-family: var(--font-display); font-size: 1.8rem; color: #fff; margin-bottom: 1rem; text-transform: uppercase; }

/* GSAP ANIMATION CLASSES */
@media (min-width: 768px) {
    .hd-reveal { opacity: 0; transform: translateY(30px); }
}

/* DISEÑO ULTRATRIFÁSICO - BUSTAMOLL X A LA OBRA */
.trifasico-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.4;
    display: flex;
    justify-content: center;
    align-items: center;
}
.glow-line {
    position: absolute;
    width: 150%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-brand), transparent);
    filter: drop-shadow(0 0 10px var(--accent-brand));
    animation: rotatePhase 20s linear infinite;
}
.glow-line.line-1 { transform: rotate(15deg); animation-duration: 25s; }
.glow-line.line-2 { transform: rotate(-10deg); animation-duration: 18s; animation-direction: reverse; background: linear-gradient(90deg, transparent, #3b82f6, transparent); filter: drop-shadow(0 0 10px #3b82f6); }
.glow-line.line-3 { transform: rotate(5deg); animation-duration: 22s; background: linear-gradient(90deg, transparent, var(--accent-light), transparent); filter: drop-shadow(0 0 10px var(--accent-light)); }

@keyframes rotatePhase {
    0% { transform: translateY(-50%) rotate(0deg); opacity: 0.2; }
    50% { opacity: 0.8; }
    100% { transform: translateY(-50%) rotate(360deg); opacity: 0.2; }
}

.matrix-connection {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 2rem 0;
}

.brand-node {
    position: relative;
    padding: 2rem;
    background: rgba(10, 14, 23, 0.7);
    border: 1px solid var(--border-dim);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(255,255,255,0.02);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.brand-node:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent-brand);
    box-shadow: 0 10px 40px rgba(255, 107, 53, 0.15), inset 0 0 20px rgba(255, 107, 53, 0.05);
}

.bustamoll-node:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.15), inset 0 0 20px rgba(59, 130, 246, 0.05);
}

.logo-container {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-container img {
    max-height: 100%;
    max-width: 200px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(255,255,255,0.1));
}

.energy-connector {
    position: relative;
    width: 120px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.energy-core {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 33.33%;
    background: linear-gradient(90deg, transparent, var(--accent-brand), #3b82f6, transparent);
    animation: flowEnergy 2s infinite linear;
    border-radius: 4px;
    box-shadow: 0 0 15px var(--accent-brand), 0 0 30px #3b82f6;
}

.energy-pulse, .energy-pulse-2 {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 20px var(--accent-brand), 0 0 40px var(--accent-brand);
    animation: pulseEnergy 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.energy-pulse-2 {
    background: #3b82f6;
    box-shadow: 0 0 20px #3b82f6, 0 0 40px #3b82f6;
    animation-delay: 1s;
}

@keyframes flowEnergy {
    0% { transform: translateX(0%); opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translateX(200%); opacity: 0; }
}

@keyframes pulseEnergy {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.5); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

.matrix-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #fff;
    padding: 0.3rem 0.8rem;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

@media (max-width: 768px) {
    .matrix-connection { flex-direction: column; gap: 3rem; }
    .energy-connector { width: 4px; height: 80px; }
    .energy-core { left: 0; top: 0; height: 33.33%; width: 100%; }
    @keyframes flowEnergy {
        0% { transform: translateY(0%); opacity: 0; }
        15% { opacity: 1; }
        85% { opacity: 1; }
        100% { transform: translateY(200%); opacity: 0; }
    }
}