/* =========================================================
   Importadora Jaramillo — Estilos del sitio público
   Concepto: catálogo técnico tipo "placa de circuito impreso".
   Fondo neutro (color fibra de vidrio de PCB), acentos cobre/ámbar
   (color de soldadura y cable), tipografía técnica.
   ========================================================= */

:root {
  /* Color */
  --bg:            #F5F6F1;   /* fondo general, tono fibra de vidrio PCB */
  --surface:       #FFFFFF;   /* tarjetas */
  --ink:           #16212B;   /* texto principal, azul-negro tipo osciloscopio */
  --ink-soft:      #52606B;   /* texto secundario */
  --border:        #E1E4DC;
  --copper:        #C97A3D;   /* acento primario: cable de cobre / soldadura */
  --copper-dark:   #A55F28;
  --teal:          #2F6F62;   /* acento secundario: pista de PCB */
  --amber:         #E8A33D;   /* resaltes / hover */
  --whatsapp:      #25D366;
  --whatsapp-dark: #1DA851;
  --danger:        #C0392B;

  /* Tipografía */
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(20, 30, 40, 0.06);
  --shadow-hover: 0 8px 24px rgba(20, 30, 40, 0.12);
  --max-width: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Foco visible para accesibilidad */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

/* ---------- Trazo de circuito (elemento firma) ---------- */
.circuit-trace {
  width: 100%;
  height: 10px;
  display: block;
}
.circuit-trace path {
  stroke: var(--copper);
  stroke-width: 1.5;
  fill: none;
  opacity: 0.55;
}
.circuit-trace circle {
  fill: var(--copper);
  opacity: 0.85;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--ink);
  color: #fff;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: #fff;
}
.brand .chip {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--copper);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}
.main-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.main-nav a {
  color: #CBD3D9;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color .15s ease;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active {
  color: #fff;
  border-color: var(--copper);
}
.search-form {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 6px 6px 6px 16px;
  min-width: 220px;
}
.search-form input {
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  flex: 1;
  outline: none;
}
.search-form input::placeholder { color: #9AA5AC; }
.search-form button {
  background: var(--copper);
  border: none;
  color: var(--ink);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}

/* ---------- Hero / intro de página ---------- */
.page-hero {
  padding: 48px 0 28px;
}
.page-hero .eyebrow {
  font-family: var(--font-mono);
  color: var(--teal);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.page-hero h1 { font-size: 2rem; }
.page-hero p { color: var(--ink-soft); max-width: 620px; }

/* ---------- Grid de categorías ---------- */
.categorias-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding: 8px 0 56px;
}
.categoria-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.categoria-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--copper);
}
.categoria-card .icono {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: #FBF1E7;
  color: var(--copper-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.categoria-card .nombre {
  font-weight: 600;
  font-size: 0.95rem;
}
.categoria-card .conteo {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ---------- Grid de productos ---------- */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 8px 0 56px;
}
.producto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.producto-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.producto-card .foto {
  aspect-ratio: 4/3;
  background: #F0F1EC;
  overflow: hidden;
}
.producto-card .foto img { width: 100%; height: 100%; object-fit: cover; }
.producto-card .info {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.producto-card .nombre {
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.3;
}
.producto-card .precio {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--teal);
  font-size: 1.05rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 3px 9px;
  border-radius: 999px;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge.disponible { background: #E7F3EC; color: var(--teal); }
.badge.agotado { background: #FBEAE8; color: var(--danger); }

.btn-whatsapp {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--whatsapp);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: background .15s ease;
}
.btn-whatsapp:hover { background: var(--whatsapp-dark); color: #fff; }
.btn-whatsapp svg { width: 18px; height: 18px; fill: #fff; }

/* ---------- Botón flotante de WhatsApp ---------- */
.whatsapp-float {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--whatsapp);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  z-index: 50;
  transition: transform .15s ease;
}
.whatsapp-float:hover { transform: scale(1.06); }
.whatsapp-float svg { width: 30px; height: 30px; fill: #fff; }

/* ---------- Proyectos ---------- */
.proyectos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding: 8px 0 56px;
}
.proyecto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
}
.proyecto-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.proyecto-card .foto { aspect-ratio: 16/9; background: #F0F1EC; overflow: hidden; }
.proyecto-card .foto img { width: 100%; height: 100%; object-fit: cover; }
.proyecto-card .info { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.proyecto-card .titulo { font-family: var(--font-display); font-size: 1.1rem; }
.proyecto-card .resumen { color: var(--ink-soft); font-size: 0.9rem; flex: 1; }

.proyecto-detalle .contenido {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  line-height: 1.7;
}
.proyecto-detalle .contenido h2 { margin-top: 1.2em; }

/* ---------- Galería de detalle de producto ---------- */
.producto-detalle-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 40px;
  padding: 28px 0 60px;
  align-items: start;
}
.producto-detalle-imagen {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 1 / 1;
  max-width: 420px;
  background: #F0F1EC;
}
.producto-detalle-imagen img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.producto-detalle-miniaturas {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  max-width: 420px;
}
.producto-detalle-miniaturas img {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  background: #F0F1EC;
}
.producto-detalle-miniaturas img.activa { border-color: var(--copper); }

@media (max-width: 800px) {
  .producto-detalle-grid { grid-template-columns: 1fr; }
  .producto-detalle-imagen, .producto-detalle-miniaturas { max-width: 100%; }
}

/* ---------- Buscador (resultados) ---------- */
.no-resultados {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

/* ---------- Migas de pan ---------- */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding-top: 18px;
}
.breadcrumbs a:hover { color: var(--copper-dark); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #B9C2C8;
  margin-top: 40px;
  padding: 36px 0 24px;
}
.site-footer .footer-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.site-footer h4 { color: #fff; font-size: 0.95rem; }
.site-footer a { color: #B9C2C8; font-size: 0.88rem; }
.site-footer a:hover { color: var(--copper); }
.site-footer .copy {
  padding-top: 18px;
  font-size: 0.8rem;
  color: #7C8A91;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .categorias-grid { grid-template-columns: repeat(3, 1fr); }
  .productos-grid { grid-template-columns: repeat(3, 1fr); }
  .proyectos-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .categorias-grid { grid-template-columns: repeat(2, 1fr); }
  .productos-grid { grid-template-columns: repeat(2, 1fr); }
  .proyectos-grid { grid-template-columns: 1fr; }
  .header-top { flex-direction: column; align-items: flex-start; }
  .search-form { width: 100%; }
  .page-hero h1 { font-size: 1.5rem; }
}
