/* =========================================
   1. VARIABLES Y BASES
   ========================================= */
:root {
  --brand: #152533;
  --accent: #2F77FF;
  --bg: #F7F7F7;
  --text: #13202C;
  --muted: #5E6B76;
  --card: #FFFFFF;
  --soft: #D1D4D6;
  --ring: rgba(47, 119, 255, .35);
  --header-height: 70px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151b;
    --text: #E9EEF2;
    --muted: #A8B3BD;
    --card: #141C24;
    --soft: #243140;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

.container { width: min(1120px, 92%); margin: 0 auto; }

.section { padding: 80px 0; }
.section-alt { 
  background: color-mix(in oklab, var(--card) 95%, var(--bg)); 
  border-block: 1px solid var(--soft); 
}

/* =========================================
   2. HEADER (EFECTO CRISTAL)
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  height: var(--header-height);
  background: color-mix(in oklab, var(--card) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in oklab, var(--soft) 40%, transparent);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-name { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1.2rem; }

.site-nav ul {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.site-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.site-nav a:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle .bar {
  width: 28px;
  height: 3px;
  background: var(--text);
  border-radius: 4px;
  transition: 0.3s;
}

/* =========================================
   3. HERO (PORTADA)
   ========================================= */
.hero {
  padding: 100px 0;
  background: 
    radial-gradient(at 0% 0%, color-mix(in oklab, var(--accent) 15%, transparent) 0%, transparent 50%),
    radial-gradient(at 100% 100%, color-mix(in oklab, var(--brand) 10%, transparent) 0%, transparent 50%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.hero-copy h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-media img {
  width: 100%;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  transform: perspective(1000px) rotateY(-5deg);
}

/* =========================================
   4. PRODUCTOS (CATÁLOGO Y FILTROS)
   ========================================= */
.filter-card {
  background: var(--card);
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--soft);
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  margin-bottom: 40px;
}

.filter-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 15px;
  align-items: flex-end;
}

.filter-group { display: flex; flex-direction: column; gap: 8px; }

.price-range { display: flex; gap: 8px; }

.filter-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid color-mix(in oklab, var(--soft) 40%, transparent);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.product-card {
  background: var(--card);
  border: 1px solid color-mix(in oklab, var(--soft) 30%, transparent);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.product-media img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.product-body { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.product-title { font-family: 'Montserrat', sans-serif; margin: 0 0 10px; font-size: 1.1rem; }
.product-meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.price { font-weight: 700; font-size: 1.2rem; color: var(--accent); }

/* =========================================
   5. FORMULARIO STL (PRESUPUESTO)
   ========================================= */
.upload-card {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
  background: var(--card);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid var(--soft);
  box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.form-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; }

input, select, textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--soft);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

/* =========================================
   6. CONTACTO
   ========================================= */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 30px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 30px;
  background: var(--card);
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--soft);
  transition: all 0.3s ease;
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.contact-card .emoji { font-size: 2.5rem; }

/* =========================================
   7. FOOTER
   ========================================= */
.site-footer {
  background: color-mix(in oklab, var(--brand) 5%, var(--card));
  padding: 60px 0 30px;
  margin-top: 40px;
  border-top: 1px solid var(--soft);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
}

.copy {
  width: 100%;
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid color-mix(in oklab, var(--soft) 50%, transparent);
  color: var(--muted);
  font-size: 0.85rem;
}

/* =========================================
   8. BOTONES
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  text-align: center;
}

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 15px var(--ring); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px var(--ring); }

.btn-outline { border: 1px solid var(--soft); color: var(--text); background: transparent; }
.btn-outline:hover { background: var(--soft); }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* =========================================
   9. ADAPTACIÓN MÓVIL (RESPONSIVE)
   ========================================= */
@media (max-width: 768px) {
  .section { padding: 50px 0; }
  .nav-toggle { display: flex; }
  
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--card);
    flex-direction: column;
    padding: 30px;
    border-bottom: 1px solid var(--soft);
    box-shadow: 0 20px 30px rgba(0,0,0,0.1);
  }

  .site-nav.is-active { display: flex; animation: slideDown 0.3s ease-out; }
  .site-nav ul { flex-direction: column; width: 100%; gap: 20px; align-items: center; }

  .hero-inner { grid-template-columns: 1fr; text-align: center; gap: 30px; }
  .hero-media img { transform: none; max-width: 90%; margin: 0 auto; }
  .hero-ctas { display: flex; flex-direction: column; gap: 10px; }

  /* Filtros en móvil */
  .filter-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .filter-actions { flex-direction: column; }
  
  .upload-card {
    grid-template-columns: 1fr;
    padding: 24px;
    gap: 30px;
  }
  
  .upload-copy { text-align: center; }
  .form-row { grid-template-columns: 1fr; } 
  
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  
  .btn { width: 100%; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}