/* ============================================================
   CHILE EXPORTA · Ropa Corporativa
   Paleta: petróleo (marca real del logo) / lino / hilo-cobre
   Tipos:  Archivo (display expandido) · Instrument Sans (texto)
           IBM Plex Mono (datos y etiquetas)
   Firma:  la línea de puntada (costura) + cotizador exprés
   ============================================================ */

:root {
  --petroleo: #164a5f;        /* azul del logo real */
  --petroleo-2: #0e3547;
  --lino: #f2f0eb;            /* fondo textil claro */
  --blanco: #fdfcfa;
  --hilo: #c0632a;            /* cobre: hilo de bordado */
  --hilo-claro: #de8c52;
  --tinta: #17262e;
  --gris: #5d6d75;
  --linea: #dcd8cf;

  --display: "Archivo", sans-serif;
  --texto: "Instrument Sans", sans-serif;
  --mono: "IBM Plex Mono", monospace;

  --ancho: 1120px;
  --radio: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--texto);
  color: var(--tinta);
  background: var(--lino);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.05;
  color: var(--petroleo);
}

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--hilo);
  outline-offset: 2px;
}

/* ---------- firma: línea de puntada ---------- */

.puntada {
  height: 0;
  margin-top: 2.6rem;
  border-top: 3px dashed var(--hilo);
  width: min(320px, 60%);
}

.puntada-clara { border-color: var(--hilo-claro); margin-top: 1.6rem; }

/* ---------- barra superior ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 5vw;
  background: color-mix(in srgb, var(--lino) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linea);
}

.brand {
  font-family: var(--display);
  font-stretch: 115%;
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--petroleo);
}

.brand b { font-weight: 900; }

.brand-ropa {
  font-family: var(--display);
  font-stretch: 115%;
  font-weight: 900;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.brand-logo { height: 22px; width: auto; display: block; }

.brand-mark {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, var(--hilo-claro), var(--hilo) 70%);
  box-shadow: inset 0 0 0 3px var(--lino), inset 0 0 0 4.5px var(--hilo);
}

.brand-tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hilo);
  border-left: 1px solid var(--linea);
  padding-left: 0.6rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav a { text-decoration: none; color: var(--gris); }
.nav a:hover { color: var(--petroleo); }

.nav-cta {
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--hilo);
  border-radius: 999px;
  color: var(--hilo) !important;
}

.nav-cta:hover { background: var(--hilo); color: var(--blanco) !important; }

/* ---------- hero ---------- */

.hero {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 5rem 5vw 4rem;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hilo);
  margin-bottom: 1.2rem;
}

.eyebrow-claro { color: var(--hilo-claro); }

.hero-title {
  font-stretch: 122%;
  font-weight: 900;
  font-size: clamp(2.3rem, 7.6vw, 5.6rem);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.hero-title .line { display: block; }
.hero-title .accent { color: var(--hilo); }

@media (prefers-reduced-motion: no-preference) {
  .hero-title .line {
    opacity: 0;
    transform: translateY(0.35em);
    animation: subir 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  }
  .hero-title .line:nth-child(2) { animation-delay: 0.08s; }
  .hero-title .line:nth-child(3) { animation-delay: 0.16s; }
  .hero-title .line:nth-child(4) { animation-delay: 0.24s; }

  /* la puntada se "cose" al cargar */
  .hero .puntada {
    width: 0;
    animation: coser 1s 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  }
}

@keyframes subir { to { opacity: 1; transform: none; } }
@keyframes coser { to { width: min(320px, 60%); } }

.hero-sub {
  max-width: 34rem;
  margin-top: 1.6rem;
  font-size: 1.12rem;
  color: var(--gris);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.btn {
  display: inline-block;
  font-family: var(--texto);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--hilo);
  color: var(--blanco);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--hilo) 35%, transparent);
}

.btn-primary:hover { transform: translateY(-2px); }

.btn-ghost {
  border: 1.5px solid var(--linea);
  color: var(--petroleo);
  background: transparent;
}

.btn-ghost:hover { border-color: var(--petroleo); }

/* ---------- hero oscuro con trama textil ---------- */

.hero-oscuro {
  max-width: none;
  background:
    repeating-linear-gradient(0deg,  transparent 0 3px, rgba(255,255,255,0.016) 3px 4px),
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(255,255,255,0.016) 3px 4px),
    radial-gradient(120% 90% at 15% 0%, #1b586f 0%, var(--petroleo-2) 55%, #0a2836 100%);
  color: var(--lino);
  padding: 4.5rem 5vw 4rem;
}

.hero-grid {
  max-width: var(--ancho);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 3rem;
  align-items: center;
}

.hero-oscuro .hero-title { color: var(--lino); }
.hero-oscuro .hero-title .accent { color: var(--hilo-claro); }
.hero-oscuro .hero-sub { color: color-mix(in srgb, var(--lino) 72%, transparent); }

.btn-ghost-claro {
  border-color: color-mix(in srgb, var(--lino) 35%, transparent);
  color: var(--lino);
}

.btn-ghost-claro:hover { border-color: var(--lino); }

/* muestrario interactivo */

.muestrario {
  background: color-mix(in srgb, var(--lino) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--lino) 16%, transparent);
  border-radius: 14px;
  padding: 1.6rem;
  text-align: center;
  backdrop-filter: blur(4px);
}

.prenda {
  width: min(210px, 60vw);
  margin: 0 auto;
  display: block;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}

.prenda-cuerpo {
  fill: var(--prenda-color, #164a5f);
  stroke: rgba(0, 0, 0, 0.25);
  stroke-width: 1.5;
  transition: fill 0.3s ease;
}

.prenda-cuello {
  fill: color-mix(in srgb, var(--prenda-color, #164a5f) 70%, black);
  transition: fill 0.3s ease;
}

.prenda-costura {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
  fill: none;
}

.prenda-boton { fill: rgba(255, 255, 255, 0.75); }

.prenda-logo path { fill: var(--hilo-claro); }

.muestrario-titulo {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--lino) 70%, transparent);
  margin: 1.1rem 0 0.7rem;
}

.swatches {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid color-mix(in srgb, var(--lino) 30%, transparent);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.swatch:hover { transform: scale(1.12); }

.swatch.activo {
  border-color: var(--hilo-claro);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hilo-claro) 35%, transparent);
}

.muestrario-nota {
  margin-top: 0.9rem;
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--lino) 55%, transparent);
}

/* huincha de categorías (cinta métrica) */

.huincha {
  overflow: hidden;
  background: var(--hilo);
  border-block: 3px dashed color-mix(in srgb, var(--blanco) 45%, transparent);
  padding: 0.55rem 0;
}

.huincha-carro {
  display: flex;
  gap: 1.6rem;
  width: max-content;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--blanco);
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .huincha-carro { animation: correr 28s linear infinite; }
}

@keyframes correr {
  to { transform: translateX(-50%); }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ---------- secciones ---------- */

.section-head { margin-bottom: 2.4rem; }

.section-head h2 {
  font-stretch: 118%;
  font-weight: 800;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  text-transform: uppercase;
}

.catalogo, .servicios, .proceso {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 3.5rem 5vw;
}

/* ---------- catálogo (fichas textiles) ---------- */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.2rem;
}

.ficha {
  display: flex;
  gap: 1rem;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ficha:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(22, 74, 95, 0.10);
}

.ficha figure {
  flex: 0 0 86px;
  height: 96px;
  display: grid;
  place-items: center;
  background: var(--lino);
  border: 1px dashed var(--linea);
  border-radius: 6px;
  overflow: hidden;
}

.ficha img {
  max-width: 78px;
  max-height: 88px;
  image-rendering: auto;
  mix-blend-mode: multiply;
}

.ficha-cat {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hilo);
}

.ficha h3 {
  font-stretch: 110%;
  font-weight: 700;
  font-size: 1rem;
  margin: 0.25rem 0 0.3rem;
}

.ficha-info p { font-size: 0.85rem; color: var(--gris); }

/* fichas clickeables → galería */

.ficha { cursor: zoom-in; position: relative; }

.ficha::after {
  content: "";
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--lino) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23c0632a" stroke-width="2.4" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></svg>') center/12px no-repeat;
  border: 1px solid var(--linea);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ficha:hover::after, .ficha:focus-visible::after { opacity: 1; }

/* ---------- galería modal ---------- */

.galeria {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  background: color-mix(in srgb, var(--petroleo-2) 88%, black);
  padding: 4vh 4vw;
}

.galeria.abierta { display: grid; }

@media (prefers-reduced-motion: no-preference) {
  .galeria.abierta { animation: aparecer 0.2s ease; }
}

@keyframes aparecer { from { opacity: 0; } }

.galeria-panel {
  width: min(680px, 94vw);
  background: var(--blanco);
  border-radius: var(--radio);
  overflow: hidden;
  display: grid;
}

.galeria-visor {
  position: relative;
  height: min(52vh, 460px);
  display: grid;
  place-items: center;
  background:
    repeating-conic-gradient(var(--lino) 0% 25%, var(--blanco) 0% 50%) 0 0 / 24px 24px;
  overflow: hidden;
  touch-action: none;
}

.galeria-visor img {
  max-width: 80%;
  max-height: 80%;
  transform: translate(var(--gx, 0px), var(--gy, 0px)) scale(var(--gz, 1));
  transition: transform 0.15s ease;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}

.galeria-visor img.arrastrando { transition: none; cursor: grabbing; }

.galeria-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--linea);
  background: var(--blanco);
  color: var(--petroleo);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.galeria-nav:hover { border-color: var(--hilo); color: var(--hilo); }
.galeria-prev { left: 0.8rem; }
.galeria-next { right: 0.8rem; }

.galeria-zoom {
  position: absolute;
  bottom: 0.8rem;
  right: 0.8rem;
  display: flex;
  gap: 0.4rem;
}

.galeria-zoom button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--linea);
  background: var(--blanco);
  color: var(--petroleo);
  font-family: var(--mono);
  font-size: 1rem;
  cursor: pointer;
}

.galeria-zoom button:hover { border-color: var(--hilo); color: var(--hilo); }

.galeria-zoom .gz-nivel {
  min-width: 52px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--gris);
  background: var(--lino);
  border: 1px solid var(--linea);
  border-radius: 8px;
  padding: 0 0.5rem;
}

.galeria-cerrar {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--linea);
  background: var(--blanco);
  color: var(--petroleo);
  font-size: 1rem;
  cursor: pointer;
}

.galeria-cerrar:hover { border-color: var(--hilo); color: var(--hilo); }

.galeria-pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.3rem;
  border-top: 1px solid var(--linea);
}

.galeria-pie .ficha-cat { display: block; margin-bottom: 0.15rem; }

.galeria-pie h3 {
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.05rem;
}

.galeria-pie p { font-size: 0.85rem; color: var(--gris); }

.galeria-contador {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--gris);
  white-space: nowrap;
}

.galeria-hint {
  padding: 0 1.3rem 0.9rem;
  font-size: 0.72rem;
  color: var(--gris);
}

/* ---------- servicios ---------- */

.servicios { background: var(--blanco); }

.servicio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}

.servicio h3 {
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.1rem;
  padding-top: 0.9rem;
  border-top: 3px dashed var(--hilo);
  margin-bottom: 0.7rem;
}

.servicio p { color: var(--gris); font-size: 0.95rem; }

/* ---------- cotizador (firma funcional) ---------- */

.cotizador {
  background: var(--petroleo);
  color: var(--lino);
  padding: 4.5rem 5vw;
}

.cot-inner {
  max-width: var(--ancho);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 3.5rem;
  align-items: start;
}

.cot-copy h2 {
  color: var(--lino);
  font-stretch: 118%;
  font-weight: 800;
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.cot-copy p { color: color-mix(in srgb, var(--lino) 78%, transparent); }

.cot-form {
  background: var(--petroleo-2);
  border: 1px solid color-mix(in srgb, var(--lino) 15%, transparent);
  border-radius: var(--radio);
  padding: 1.8rem;
  display: grid;
  gap: 1.1rem;
}

.cot-form label {
  font-size: 0.85rem;
  font-weight: 600;
  display: block;
}

.cot-form select,
.cot-form input[type="number"],
.cot-form input[type="text"],
.cot-form input[type="email"] {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--lino) 25%, transparent);
  background: var(--petroleo);
  color: var(--lino);
  font-family: var(--texto);
  font-size: 0.95rem;
}

.cot-form select:focus,
.cot-form input:focus {
  outline: 2px solid var(--hilo-claro);
  border-color: transparent;
}

.hint {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
  color: color-mix(in srgb, var(--lino) 55%, transparent);
  margin-top: 0.3rem;
}

.cot-pers {
  border: none;
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.cot-pers legend {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.radio {
  font-weight: 400 !important;
  font-size: 0.92rem !important;
  display: flex !important;
  align-items: center;
  gap: 0.4rem;
}

.radio input { accent-color: var(--hilo); }

/* .cot-form fija display: grid, que taparía el atributo hidden */
.cot-inner [hidden] { display: none; }

.cot-form button { cursor: pointer; }
.cot-form button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.cot-lista {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  background: var(--petroleo);
  border: 1px dashed color-mix(in srgb, var(--hilo-claro) 60%, transparent);
  border-radius: 8px;
  font-size: 0.9rem;
}

.cot-lista li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.cot-lista .cot-vacia { color: color-mix(in srgb, var(--lino) 60%, transparent); }

.cot-quitar {
  background: none;
  border: 1px solid color-mix(in srgb, var(--lino) 30%, transparent);
  border-radius: 999px;
  color: var(--lino);
  font-family: var(--texto);
  font-size: 0.75rem;
  padding: 0.2rem 0.7rem;
}

.cot-error {
  font-size: 0.85rem;
  color: #ffb4a8;
}

.cot-ok { align-content: start; }
.cot-ok p { font-size: 1.05rem; }

/* ---------- proceso ---------- */

.pasos {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.paso {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 1.4rem;
}

.paso-num {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--hilo);
  letter-spacing: 0.12em;
}

.paso h3 {
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0.5rem 0 0.4rem;
}

.paso p { font-size: 0.92rem; color: var(--gris); }

/* ---------- contacto ---------- */

.contacto {
  background: var(--blanco);
  border-top: 1px solid var(--linea);
  padding: 4rem 5vw;
}

.contacto-inner { max-width: var(--ancho); margin: 0 auto; }

.contacto h2 {
  font-stretch: 118%;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.contacto-inner > p { color: var(--gris); margin-bottom: 2rem; }

.contacto-datos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.dato {
  display: block;
  padding: 1.1rem 1.2rem;
  background: var(--lino);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--petroleo);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.dato:hover { border-color: var(--hilo); transform: translateY(-2px); }

.dato-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hilo);
  margin-bottom: 0.25rem;
}

/* ---------- footer ---------- */

.footer {
  padding: 1.6rem 5vw;
  background: var(--petroleo);
  color: color-mix(in srgb, var(--lino) 65%, transparent);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer b { color: var(--hilo-claro); }

.footer-note { font-size: 0.75rem; }

/* ---------- reveals ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(1.2rem);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .reveal.visto { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .cot-inner { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 720px) {
  .nav a:not(.nav-cta) { display: none; }
  .brand-tag { display: none; }
}
