:root {
  --bg-page: #f1f3f5;
  --bg-card: #ffffff;
  --metal-dark: #16191d;
  --metal-mid: #2b3038;
  --metal-steel: #64748b;
  --metal-silver: #cbd5e1;
  --text-dark: #16191d;
  --text-muted: #4b5563;
  --border: #d1d5db;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg-page); color: var(--text-dark); line-height: 1.6; scroll-behavior: smooth; }

header { background: var(--metal-dark); border-bottom: 2px solid var(--metal-steel); position: sticky; top: 0; z-index: 100; }
.nav-wrap { max-width: 1150px; margin: 0 auto; padding: 0.8rem 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.nav-banner { height: 85px; max-width: 100%; border-radius: 4px; object-fit: contain; }
nav a { color: var(--metal-silver); text-decoration: none; margin-left: 1.5rem; font-size: 0.9rem; font-weight: 500; }
nav a:hover { color: #ffffff; }
.btn-cta { background: var(--metal-silver); color: var(--metal-dark) !important; padding: 0.5rem 1rem; border-radius: 4px; font-weight: 700; }

.hero { background: linear-gradient(135deg, #16191d 0%, #2b3038 100%); color: #fff; padding: 4rem 1.5rem; }
.hero-grid { max-width: 1150px; margin: 0 auto; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2.5rem; align-items: center; }
.badge { display: inline-block; background: rgba(255,255,255,0.1); border: 1px solid var(--metal-steel); color: var(--metal-silver); font-size: 0.78rem; padding: 0.3rem 0.8rem; border-radius: 4px; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }
.hero-quote { font-size: 1.45rem; font-style: italic; color: #fff; border-left: 3px solid var(--metal-silver); padding-left: 1rem; margin-bottom: 1.2rem; line-height: 1.4; }
.hero h1 { font-size: 2.1rem; line-height: 1.2; margin-bottom: 1rem; }
.hero p { color: var(--metal-silver); margin-bottom: 1.8rem; font-size: 1rem; }
.logo-video { width: 100%; border-radius: 8px; border: 1px solid var(--metal-steel); box-shadow: 0 12px 30px rgba(0,0,0,0.4); background: #000; }

.sec { max-width: 1150px; margin: 0 auto; padding: 4rem 1.5rem; }
.sec-title { font-size: 1.8rem; margin-bottom: 0.4rem; }
.sec-sub { color: var(--text-muted); margin-bottom: 2rem; }

.tabs { display: flex; gap: 0.6rem; margin-bottom: 1.8rem; flex-wrap: wrap; }
.tab-btn { background: var(--bg-card); border: 1px solid var(--border); padding: 0.7rem 1.2rem; border-radius: 4px; font-weight: 600; cursor: pointer; color: var(--text-muted); }
.tab-btn.active { background: var(--metal-dark); color: #fff; border-color: var(--metal-dark); }

.panel { display: none; }
.panel.active { display: block; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.2rem; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; padding: 1.5rem; }
.card h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.card p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.8rem; }
.card ul { list-style: none; border-top: 1px solid var(--border); padding-top: 0.7rem; font-size: 0.85rem; }
.card li::before { content: "▪ "; color: var(--metal-steel); }

/* GALERIA DE VÍDEOS ESTABILIDADE */
.gallery-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; margin-top: 2rem; }
.main-vid-wrap { background: #000; border-radius: 6px; overflow: hidden; margin-bottom: 1rem; }
.main-vid-wrap video { width: 100%; max-height: 460px; display: block; }
.thumbs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; }
.thumb-item { cursor: pointer; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: var(--metal-dark); transition: transform 0.2s; }
.thumb-item.active, .thumb-item:hover { border-color: var(--metal-dark); transform: translateY(-2px); }
.thumb-item video { width: 100%; height: 90px; object-fit: cover; display: block; pointer-events: none; }
.thumb-label { display: block; text-align: center; font-size: 0.8rem; font-weight: 600; color: #fff; padding: 0.35rem; background: var(--metal-mid); }

/* VISUALIZADOR 3D NATIVO & SELETOR BIM */
.viewer-3d-wrapper {
  max-width: 1150px;
  margin: 2rem auto;
  background: radial-gradient(circle at center, #2b3038 0%, #16191d 100%);
  border: 1px solid var(--metal-steel);
  border-radius: 8px;
  padding: 1.5rem;
}

model-viewer {
  width: 100%;
  height: 480px;
  display: block;
  background-color: transparent;
  --poster-color: transparent;
}

.progress-bar-3d {
  color: var(--metal-silver);
  font-size: 0.9rem;
  padding: 1rem;
  text-align: center;
}

.viewer-legenda {
  text-align: center;
  color: var(--metal-silver);
  font-size: 0.85rem;
  margin-top: 0.8rem;
}

.bim-selector-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.7rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(100, 116, 139, 0.35);
}

.bim-btn {
  background: var(--metal-mid);
  border: 1px solid var(--metal-steel);
  color: var(--metal-silver);
  padding: 0.65rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-family: inherit;
}

.bim-btn strong {
  display: block;
  font-size: 0.85rem;
  color: #fff;
}

.bim-btn span {
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
  margin-top: 0.15rem;
}

.bim-btn.active, .bim-btn:hover {
  background: var(--metal-silver);
  border-color: #fff;
  transform: translateY(-2px);
}

.bim-btn.active strong, .bim-btn:hover strong,
.bim-btn.active span, .bim-btn:hover span {
  color: var(--metal-dark);
}
.bim-thumbs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(100, 116, 139, 0.35);
}

.bim-thumb {
  background: var(--metal-mid);
  border: 1px solid var(--metal-steel);
  color: var(--metal-silver);
  padding: 0.7rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-family: inherit;
}

.bim-thumb strong { display: block; font-size: 0.85rem; color: #fff; }
.bim-thumb span { display: block; font-size: 0.75rem; opacity: 0.85; margin-top: 0.2rem; }

.bim-thumb.active, .bim-thumb:hover {
  background: var(--metal-silver);
  border-color: #fff;
  transform: translateY(-2px);
}

.bim-thumb.active strong, .bim-thumb:hover strong,
.bim-thumb.active span, .bim-thumb:hover span {
  color: var(--metal-dark);
}

@media (max-width: 850px) {
  .bim-thumbs-grid { grid-template-columns: repeat(2, 1fr); }
}


/* PERFIL & CONTACTO */
.about-box { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 2rem; align-items: center; }
.about-box img { width: 100%; border-radius: 6px; border: 1px solid var(--border); }
.creds { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.8rem; margin-top: 1.2rem; }
.cred { background: var(--bg-page); padding: 0.8rem; border-left: 3px solid var(--metal-dark); font-size: 0.82rem; }

.contact-box { background: var(--metal-dark); color: #fff; border-radius: 8px; padding: 2.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.contact-info { color: var(--metal-silver); font-size: 0.92rem; line-height: 1.9; margin-top: 1rem; }
form { display: flex; flex-direction: column; gap: 0.8rem; }
input, select, textarea { padding: 0.75rem; border-radius: 4px; border: 1px solid var(--metal-steel); background: var(--metal-mid); color: #fff; font-family: inherit; }
button[type="submit"] { background: var(--metal-silver); color: var(--metal-dark); border: none; padding: 0.85rem; border-radius: 4px; font-weight: 700; cursor: pointer; }
footer { text-align: center; padding: 1.5rem; font-size: 0.82rem; color: var(--text-muted); border-top: 1px solid var(--border); background: var(--bg-card); }

@media (max-width: 850px) {
  .hero-grid, .about-box, .contact-box { grid-template-columns: 1fr; }
  .thumbs-grid, .bim-selector-grid { grid-template-columns: repeat(2, 1fr); }
  nav { display: none; }
}

model-viewer[loaded] .progress-bar-3d {
  display: none;
}