/* --- CONFIGURACIÓN BASE --- */
:root {
    --black: #111111;
    --white: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Roboto Mono', monospace;
    color: var(--black);
    background-color: var(--white);
    line-height: 1.5;
    overflow-x: hidden;
}

h1, h2, h3, .brand-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -1px;
}

/* --- NAVEGACIÓN --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: var(--white);
    border-bottom: 3px solid var(--black);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand-container { display: flex; align-items: center; gap: 15px; }
.nav-logo { height: 40px; width: auto; }
.brand-name { font-size: 1.2rem; }

.nav-links { list-style: none; display: flex; align-items: center; gap: 30px; }
.nav-links a { text-decoration: none; color: var(--black); font-weight: 700; font-size: 0.9rem; }

/* Botón Navegación Corregido */
.btn-nav-fixed {
    display: inline-block; padding: 10px 20px;
    border: 3px solid var(--black); background: transparent;
    color: var(--black) !important; transition: all 0.3s ease; line-height: 1;
}
.btn-nav-fixed:hover { background: var(--black); color: var(--white) !important; }

/* --- HERO --- */
.hero {
    height: 85vh;
    display: flex; align-items: center; justify-content: center;
    position: relative; border-bottom: 3px solid var(--black); overflow: hidden;
}

.grid-background {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(0,0,0,0.1) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: 40px 40px; z-index: -1;
}

.hero-content {
    text-align: center; background: rgba(255, 255, 255, 0.95);
    padding: 50px; border: 3px solid var(--black);
    box-shadow: 15px 15px 0px var(--black); max-width: 900px;
}

.badge-tech { background: var(--black); color: var(--white); display: inline-block; padding: 5px 10px; font-weight: bold; margin-bottom: 15px; font-size: 0.8rem; }
.hero h1 { font-size: 3.5rem; line-height: 0.9; margin-bottom: 20px; }
.hero-buttons { margin-top: 30px; display: flex; justify-content: center; gap: 20px; }

/* Botones Generales */
.btn { padding: 15px 30px; text-decoration: none; font-weight: 700; border: 3px solid var(--black); text-transform: uppercase; transition: all 0.2s; display: inline-block; cursor: pointer; }
.primary { background: var(--black); color: var(--white); }
.primary:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0px var(--black); }
.secondary { background: transparent; color: var(--black); }
.secondary:hover { box-shadow: 5px 5px 0px var(--black); }

/* --- SECCIONES GENÉRICAS --- */
.section { padding: 80px 20px; position: relative; }
.container { max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 60px; }
.line-separator { width: 100px; height: 5px; background: var(--black); margin: 20px auto; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 40px; }

.card-3d { background: var(--white); border: 3px solid var(--black); padding: 40px; transition: 0.3s; }
.card-3d:hover { transform: translate(-5px, -5px); box-shadow: 10px 10px 0px var(--black); }
.icon { font-size: 3rem; margin-bottom: 20px; display: block; }

/* --- VISOR 3D (ATARDECER) --- */
.dark-bg { background: var(--black); color: var(--white); }
.dark-bg h2, .dark-bg .subtitle { text-align: center; color: var(--white); }

.viewer-container {
    display: grid;
    grid-template-columns: 3fr 1fr;
    background: #1a1a1a;
    border: 4px solid var(--white);
    margin-top: 40px;
    height: 600px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

model-viewer {
    width: 100%;
    height: 100%;
    /* DEGRADADO ATARDECER: Azul oscuro arriba, naranja abajo */
    background: linear-gradient(to bottom, #141e30, #243b55 70%, #603813);
}

.viewer-controls {
    background: #222;
    padding: 20px;
    border-left: 2px solid var(--white);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-header {
    font-weight: bold;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    margin-bottom: 10px;
    color: #ff9d00; /* Naranja acento */
}

/* Slider Style */
.control-group { display: flex; flex-direction: column; gap: 10px; color: #ccc; font-size: 0.9rem; }
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 16px; width: 16px; border-radius: 50%;
    background: #ff9d00; cursor: pointer; margin-top: -6px;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 4px; cursor: pointer; background: #555; border-radius: 2px;
}

/* Upload Button */
input[type="file"] { display: none; }
.custom-file-upload {
    border: 2px solid #555;
    background: rgba(255,255,255,0.05);
    color: var(--white);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
    display: block;
}
.custom-file-upload:hover { border-color: #ff9d00; color: #ff9d00; }
.instructions { margin-top: auto; color: #888; font-size: 0.75rem; }

/* Botón AR (Google Default override) */
#ar-button {
    background-color: white;
    position: absolute; left: 50%; transform: translateX(-50%); bottom: 20px;
    padding: 0 20px; height: 40px; border-radius: 20px; border: none;
    font-weight: bold; color: #333; cursor: pointer;
}

/* --- DESCARGAS --- */
.grid-paper-bg { background: #f8f8f8 radial-gradient(var(--black) 1px, transparent 1px) 0 0 / 20px 20px; }
.download-buttons-area { display: flex; justify-content: center; gap: 40px; margin-top: 50px; flex-wrap: wrap; }

.btn-block-3d {
    display: flex; align-items: center; background: var(--white);
    border: 4px solid var(--black); width: 350px; text-decoration: none; color: var(--black);
    transition: all 0.2s; box-shadow: 10px 10px 0px var(--black);
}
.btn-block-3d:hover { transform: translate(5px, 5px); box-shadow: 0px 0px 0px var(--black); }
.icon-area { background: var(--black); color: var(--white); padding: 20px; font-size: 2.5rem; width: 80px; text-align: center; }
.text-area { padding: 20px; display: flex; flex-direction: column; }
.text-area .small { font-size: 0.8rem; opacity: 0.6; font-weight: 700; }
.text-area .large { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 1.5rem; }

/* Footer */
footer { background: var(--black); color: var(--white); padding: 60px 20px; text-align: center; border-top: 5px solid #333; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .viewer-container { grid-template-columns: 1fr; height: auto; }
    model-viewer { height: 350px; }
    .hero h1 { font-size: 2.5rem; }
    .nav-links { display: none; }
}