/* ============================================================
   SILAB 3D · Home
   Usa las variables de base.css. Las tarjetas siguen las normas de
   carteles del proyecto: MÁRGENES (padding) > ESPACIADO (gap),
   contenido centrado y compensación óptica del interlineado.
   ============================================================ */

/* La base, las secciones y el contacto están en layout.css */

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding-top: calc(var(--s3d-header-h) + clamp(28px, 5vw, 64px));
  padding-bottom: clamp(32px, 4vw, 52px);
  background: var(--s3d-paper);
  overflow: hidden;
}
/* Líneas de capa: un guiño a cómo se imprime, a la derecha tras la imagen */
.hero::before {
  content: ""; position: absolute; inset: 0 0 0 52%;
  background: repeating-linear-gradient(to bottom, transparent 0 9px, rgba(188,85,109,.09) 9px 10px);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 30%);
  mask-image: linear-gradient(to right, transparent, #000 30%);
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center; gap: clamp(32px, 4vw, 44px) clamp(32px, 5vw, 72px);
}
.hero__copy { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.hero__title { display: flex; flex-direction: column; gap: 14px; }
.hero__kicker {
  font: 500 13px/1.2 var(--s3d-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--s3d-brand-ink);
  display: inline-flex; align-items: center; gap: 10px;
}
.hero__kicker::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: var(--s3d-brand); }
.hero__motto {
  font-size: clamp(46px, 6.6vw, 80px); font-weight: 800;
  line-height: 1; letter-spacing: -.035em; color: var(--s3d-ink);
}
.hero__motto em { font-style: normal; color: var(--s3d-brand); display: block; }
.hero__lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--s3d-muted); max-width: 46ch; }
.hero__lead strong { color: var(--s3d-ink); font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__actions .s3d-btn { min-height: 50px; padding: 0 26px; font-size: 16px; }
.hero__actions .s3d-btn--ghost { background: var(--s3d-white); }

/* Línea de confianza: franja bajo el texto y la imagen, en una sola línea */
.trust {
  grid-column: 1 / -1;
  list-style: none; margin: 0; padding: 20px 0 0;
  border-top: 1px solid var(--s3d-line);
  display: flex; flex-wrap: nowrap; gap: 10px clamp(24px, 4vw, 48px);
  font-size: 15px; color: var(--s3d-muted); white-space: nowrap;
}
.trust li { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 640px) {
  .trust { flex-wrap: wrap; white-space: normal; }
}
.trust .s3d-icon { width: 18px; height: 18px; color: var(--s3d-brand); }
.trust a { text-decoration: none; }
.trust a:hover { color: var(--s3d-brand-ink); }
.trust b { color: var(--s3d-ink); font-weight: 600; }
.trust .stars { color: #E0A11B; letter-spacing: 1px; font-size: 13px; }

.hero__media { position: relative; margin: 0; }
.hero__media img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 28px;
  box-shadow: 0 30px 60px -20px rgba(142,59,80,.35), 0 0 0 1px rgba(34,28,31,.04);
}
.hero__tag {
  position: absolute; left: -18px; bottom: 28px;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px 12px 14px;
  background: var(--s3d-white); border-radius: 16px;
  box-shadow: 0 12px 30px rgba(34,28,31,.12);
  font-size: 14px; line-height: 1.3; color: var(--s3d-muted);
}
.hero__tag b { display: block; color: var(--s3d-ink); font-size: 15px; }
.hero__tag-icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--s3d-mist-soft); color: var(--s3d-brand);
}
.hero__tag-icon .s3d-icon { width: 22px; height: 22px; }

@media (max-width: 900px) {
  .hero::before { inset: 42% 0 0 0; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%); mask-image: linear-gradient(to bottom, transparent, #000 30%); }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { max-width: 520px; width: 100%; justify-self: center; }
  .hero__media img { aspect-ratio: 4 / 3; object-position: 50% 62%; border-radius: 22px; }
  .hero__tag { left: 12px; bottom: 12px; padding: 10px 14px 10px 10px; font-size: 13px; }
  .hero__tag-icon { width: 34px; height: 34px; border-radius: 10px; }
}
@media (max-width: 480px) {
  .hero__actions { width: 100%; }
  .hero__actions .s3d-btn { flex: 1 1 100%; }
  .trust { gap: 10px 18px; font-size: 14px; }
}

/* ============================================================
   PRODUCTOS
   ============================================================ */
.products { background: var(--s3d-white); }
.product-grid {
  --producto-margin: 22px; --producto-space: 16px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
/* Catálogo: imagen, nombre, texto y enlace alineados en fila entre tarjetas (subgrid) */
.product-card {
  grid-row: span 4;
  display: grid; grid-template-rows: subgrid; row-gap: var(--producto-space);
  justify-items: center; align-items: start;
  padding: var(--producto-margin);
  text-align: center; text-decoration: none;
  background: var(--s3d-white);
  border: 1px solid var(--s3d-line); border-radius: 18px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.product-card:hover { border-color: var(--s3d-mist); box-shadow: var(--s3d-shadow); transform: translateY(-3px); }
.product-card img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 12px; background: var(--s3d-mist-soft);
}
.product-card .more {
  font-size: 14.5px; font-weight: 600; line-height: 1.3; margin-block: -.15em;
  color: var(--s3d-brand-ink); display: inline-flex; align-items: center; gap: 6px;
}
.product-card .more .s3d-icon { width: 16px; height: 16px; transition: transform .2s; }
.product-card:hover .more .s3d-icon { transform: translateX(3px); }
.products__foot { margin-top: 36px; display: flex; justify-content: center; }

@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) {
  .product-grid { --producto-margin: 14px; --producto-space: 12px; gap: 12px; }
  .product-card h3 { font-size: 16.5px; }
  .product-card { grid-row: span 3; }
  .product-card p { display: none; }
}

/* ============================================================
   PROCESO
   ============================================================ */
.process { background: var(--s3d-paper); }
.process-grid {
  --proceso-gap: 24px; --proceso-margin: 26px; --proceso-space: 16px;
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--proceso-gap);
  counter-reset: paso;
}
.process-step {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--proceso-space); padding: var(--proceso-margin);
  text-align: center;
  background: var(--s3d-white); border: 1px solid var(--s3d-line); border-radius: 18px;
}
/* Unión entre pasos como una capa que continúa */
.process-step:not(:last-child)::after {
  content: ""; position: absolute; top: 50%; right: calc(-1 * var(--proceso-gap));
  width: var(--proceso-gap); height: 2px;
  background: repeating-linear-gradient(to right, var(--s3d-brand) 0 4px, transparent 4px 8px);
  opacity: .5;
}
.process-step .step-no { font: 500 12px/1.2 var(--s3d-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--s3d-brand-ink); }
.process-step .step-art {
  width: 76px; height: 76px; border-radius: 20px;
  display: grid; place-items: center; background: var(--s3d-mist-soft);
}
.process-step .step-art svg { width: 56px; height: 56px; }
.process__cta { margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.process__cta .s3d-btn { min-height: 50px; padding: 0 28px; font-size: 16px; }
.process__cta p { color: var(--s3d-muted); font-size: 15px; }

@media (max-width: 1024px) {
  .process-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process-step:nth-child(2)::after { display: none; }
}
@media (max-width: 560px) {
  .process-grid { grid-template-columns: 1fr; --proceso-gap: 20px; --proceso-margin: 20px; --proceso-space: 12px; }
  .process-step::after {
    display: block !important; top: auto; bottom: calc(-1 * var(--proceso-gap)); left: 50%; right: auto;
    width: 2px; height: var(--proceso-gap);
    background: repeating-linear-gradient(to bottom, var(--s3d-brand) 0 4px, transparent 4px 8px);
  }
  .process-step:last-child::after { display: none !important; }
}

/* ============================================================
   MATERIALES (franja rosa: textos oscurecidos a ≥ 4.5:1)
   ============================================================ */
.materials { background: var(--s3d-mist); }
.materials .eyebrow { color: #8E3B50; }
.materials .section-head p { color: #5A4750; }
.materials .section-head strong, .materials .section-head h2 { color: #1A1A1A; }
.material-grid {
  --material-margin: 26px; --material-space: 16px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px;
  max-width: 880px; margin-inline: auto;
}
.material-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--material-space); padding: var(--material-margin);
  text-align: center;
  background: var(--s3d-white); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(142,59,80,.08);
  --mat-color: var(--s3d-brand); --mat-tinta: #8E3B50; --mat-suave: #F8E9ED;
}
.material-card--petg { --mat-color: #0A9077; --mat-tinta: #076A57; --mat-suave: #E3F3EF; }
/* Franja superior con el color de cada material (el mismo que en Materiales) */
.material-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--mat-color); }
.material-card .mat-code {
  font: 500 12px/1.2 var(--s3d-mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--mat-tinta);
}
/* Hueco óptico compensado: line-height 1 → 0; 1.3 → -0.15em; 1.55 → -0.275em */
.material-card .mat-nombre { margin: 0; font-size: clamp(40px, 5vw, 52px); font-weight: 800; line-height: 1; letter-spacing: -.03em; color: #1A1A1A; }
.material-card .mat-lema { margin: 0; margin-block: -.15em; font-size: 18px; font-weight: 600; line-height: 1.3; color: #1A1A1A; }
.material-card p:not(.mat-lema) { margin: 0; margin-block: -.275em; font-size: 15px; line-height: 1.55; color: #5A4750; max-width: 34ch; }
.mat-usos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.mat-usos li { padding: 5px 12px; border-radius: 999px; background: var(--mat-suave); color: var(--mat-tinta); font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.mat-specs { width: 100%; max-width: 300px; display: flex; flex-direction: column; gap: 10px; }
.mat-spec { line-height: 1; display: grid; grid-template-columns: 92px minmax(0, 1fr) 28px; align-items: center; gap: 12px; font-size: 14px; color: #5A4750; text-align: left; }
.mat-spec b { font: 500 12.5px/1 var(--s3d-mono); color: #1A1A1A; text-align: right; }
.mat-spec__barra { height: 8px; border-radius: 99px; background: var(--mat-suave); overflow: hidden; }
.mat-spec__barra i { display: block; width: var(--v); height: 100%; border-radius: inherit; background: var(--mat-color); }
.mat-colores {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin-block: -12.5px; /* (15 px de letra − 40 px de zona táctil) / 2 */
  font-size: 15px; font-weight: 600; color: var(--mat-tinta); text-decoration: none;
}
.mat-colores .s3d-icon { width: 18px; height: 18px; transition: transform .2s; }
.mat-colores:hover .s3d-icon { transform: translateX(3px); }
.materials__foot { margin-top: 36px; display: flex; justify-content: center; }
.materials__foot .s3d-btn--ghost { background: var(--s3d-white); border-color: var(--s3d-white); }

@media (max-width: 700px) { .material-grid { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; } }
@media (max-width: 480px) { .material-grid { --material-margin: 20px; --material-space: 14px; } }

/* ============================================================
   OPINIONES
   ============================================================ */
.reviews { background: var(--s3d-white); }
.reviews__summary {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 28px;
  margin: 0 auto 32px; padding: 22px 28px; max-width: 720px;
  border: 1px solid var(--s3d-line); border-radius: 18px;
}
.rating { display: flex; align-items: center; gap: 14px; }
.rating__score { font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--s3d-ink); }
.rating__meta { display: flex; flex-direction: column; gap: 4px; font-size: 14.5px; color: var(--s3d-muted); }
.rating__stars { color: #E0A11B; font-size: 17px; letter-spacing: 2px; line-height: 1; }
.reviews__widget { min-height: 120px; }
.reviews__foot { margin-top: 28px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ============================================================
   PREGUNTAS FRECUENTES
   ============================================================ */
.faq { background: var(--s3d-paper); }
.faq-list { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--s3d-white); border: 1px solid var(--s3d-line); border-radius: 14px; }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 22px; font-size: 17px; font-weight: 600; color: var(--s3d-ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .s3d-icon { color: var(--s3d-brand); transition: transform .2s; }
.faq-item[open] summary .s3d-icon { transform: rotate(45deg); }
.faq-item .answer { padding: 0 22px 20px; color: var(--s3d-muted); font-size: 16px; max-width: 70ch; }
.faq-item .answer a { color: var(--s3d-brand-ink); font-weight: 600; }

/* Compensación óptica de las etiquetas en mono (line-height 1.2 → -0.1em) */
.process-step .step-no,
.material-card .mat-code { margin-block: -.1em; }

/* Móvil: hero y proceso más compactos (revisión 29/09) */
@media (max-width: 640px) {
  .hero__lead { font-size: 16px; }
  .hero__motto { font-size: 46px; }
  .process-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); --proceso-gap: 10px; --proceso-margin: 14px; --proceso-space: 10px; }
  .process-step::after, .process-step:last-child::after { display: none !important; }
  .process-step .step-art { width: 52px; height: 52px; border-radius: 14px; }
  .process-step .step-art svg { width: 38px; height: 38px; }
  .process-step h3 { font-size: 15.5px; }
  .process-step p { font-size: 13.5px; }
}

/* ============================================================
   CARRUSEL DE PEDIDOS (js/carrusel.js) · dentro de Opiniones
   ============================================================ */
.carrusel { position: relative; margin: 0 auto 36px; max-width: 1100px; }
.carrusel[hidden] { display: none; }
.carrusel__pista {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 4px 2px 8px; scrollbar-width: none;
}
.carrusel__pista:focus-visible { outline: 2px solid var(--s3d-brand); outline-offset: 2px; border-radius: 16px; }
.carrusel__pista::-webkit-scrollbar { display: none; }
.carrusel__foto {
  position: relative; flex: 0 0 calc((100% - 3 * 14px) / 4); scroll-snap-align: start;
  aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--s3d-mist-soft);
}
.carrusel__foto img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.carrusel__foto:hover img { transform: scale(1.04); }
.carrusel__foto span {
  position: absolute; inset: auto 0 0; padding: 26px 12px 10px;
  background: linear-gradient(to top, rgba(23,18,20,.85) 0%, rgba(23,18,20,.6) 55%, transparent);
  color: #fff; font-size: 13.5px; font-weight: 500; line-height: 1.3; text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.carrusel__btn {
  position: absolute; top: calc(50% - 26px); width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--s3d-line); background: rgba(255,255,255,.95);
  color: var(--s3d-ink); cursor: pointer; box-shadow: 0 6px 18px rgba(34,28,31,.12); transition: border-color .2s;
}
.carrusel__btn:hover { border-color: var(--s3d-brand); color: var(--s3d-brand-ink); }
.carrusel__btn--ant { left: -18px; }
.carrusel__btn--sig { right: -18px; }
@media (max-width: 1180px) { .carrusel__btn--ant { left: 6px; } .carrusel__btn--sig { right: 6px; } }
@media (max-width: 860px) { .carrusel__foto { flex-basis: calc((100% - 2 * 14px) / 3); } }
@media (max-width: 560px) {
  .carrusel { margin-inline: calc(-1 * var(--s3d-gutter)); margin-bottom: 28px; }
  .carrusel__pista { padding-inline: var(--s3d-gutter); scroll-padding-inline: var(--s3d-gutter); gap: 10px; }
  .carrusel__foto { flex-basis: 62%; border-radius: 14px; }
  .carrusel__btn { display: none; } /* en móvil se desliza con el dedo */
}

.carrusel.is-cabe .carrusel__btn { display: none; }
.carrusel.is-cabe .carrusel__foto:first-child { margin-left: auto; }
.carrusel.is-cabe .carrusel__foto:last-child { margin-right: auto; }
