/* ==========================================================================
   ui.css — Componentes UI reutilizables (botones, contacto, FAQ, filtros, etc.)
   ========================================================================== */

/* --- Botones --- */
.btn-primary {
  background: var(--sage);
  color: #fff;
  font-family: inherit;
  font-weight: var(--fw-emphasis);
  font-size: var(--fs-btn);
  line-height: 1;
  padding: 15px 28px;
  border-radius: 8px;
  border: none;
  transition: all .25s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  appearance: none;
  -webkit-appearance: none;
}

button.btn-primary {
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-text {
  font-family: inherit;
  font-weight: var(--fw-emphasis);
  font-size: var(--fs-btn);
  line-height: 1;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.btn-text .arrow {
  transition: transform .25s;
}

.btn-text:hover .arrow {
  transform: translateX(5px);
}

.btn-ghost {
  font-family: inherit;
  font-weight: var(--fw-emphasis);
  font-size: var(--fs-btn);
  line-height: 1;
  padding: 15px 26px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  transition: .25s;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  appearance: none;
  -webkit-appearance: none;
}

.btn-ghost:hover {
  background: var(--ink);
  color: #fff;
}

.sr-cta .btn-primary,
.sr-cta .btn-ghost {
  justify-content: center;
  text-align: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* --- Contacto "Hablemos" --- */
.contact {
  padding: 60px 0;
  text-align: center;
  background: var(--bg);
}

.contact .inner {
  max-width: 680px;
  margin: 0 auto;
}

.contact h2 {
  font-weight: var(--fw-section);
  font-size: var(--fs-h2-immersive);
  line-height: var(--lh-section);
  letter-spacing: var(--track-section);
  margin: 16px 0 20px;
}

.contact h2 b {
  font-weight: var(--fw-emphasis);
}

.contact p {
  font-size: var(--fs-lead);
  line-height: var(--lh-body);
  color: var(--ink-soft);
  margin-bottom: 38px;
}

.contact-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Botón flotante --- */
.float-wa {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--brand);
  color: #fff;
  padding: 11px 19px 11px 13px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: .9rem;
  transition: transform .25s, box-shadow .25s;
}

.float-wa:hover {
  transform: translateY(-2px);
}

.float-wa .dot {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .float-wa > span:not(.dot) {
    display: none;
  }

  .float-wa {
    padding: 12px;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    max-width: calc(100% - 24px);
    min-width: 48px;
    min-height: 48px;
    justify-content: center;
  }

  body.page-catalogo .float-wa {
    bottom: max(72px, calc(12px + env(safe-area-inset-bottom, 0px)));
  }
}

/* --- FAQ --- */
.faq {
  padding: 20px 0;
}

.faq .head {
  max-width: 620px;
  margin-bottom: 40px;
}

.faq .head h2 {
  font-weight: var(--fw-section);
  font-size: var(--fs-h2);
  line-height: var(--lh-section);
  letter-spacing: var(--track-section);
  margin: 12px 0;
}

details {
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}

summary {
  font-size: var(--fs-h3);
  font-weight: var(--fw-emphasis);
  line-height: var(--lh-heading);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

summary::-webkit-details-marker {
  display: none;
}

summary .ic {
  font-size: 1.4rem;
  font-weight: 300;
  transition: transform .25s;
  color: var(--ink-soft);
}

details[open] summary .ic {
  transform: rotate(45deg);
}

details p {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  max-width: 80ch;
}

/* --- Barra de filtros --- */
.filterbar {
  position: sticky;
  top: 76px;
  z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.filterbar.has-top-border {
  border-top: 1px solid var(--line-soft);
}

.filterbar .wrap {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.chip {
  font-family: inherit;
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink-mid);
  padding: 8px 16px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  appearance: none;
  -webkit-appearance: none;
}

.chip:hover {
  border-color: var(--ink);
  background: #f2f2f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
}

.chip:active {
  transform: translateY(0) scale(.97);
  box-shadow: none;
}

.chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.chip.active:hover {
  background: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
}

/* Toda la línea — Anzio, Livello */
.linea-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.linea-nav .chip {
  background: #E8E8E5;
  color: var(--brand-dark);
  font-size: var(--fs-btn);
  font-weight: 600;
  border-color: rgba(0, 0, 0, .08);
  padding: 10px 20px;
}

.linea-nav .chip:hover {
  background: #DEDEDA;
  border-color: var(--brand);
  color: var(--brand-dark);
}

.linea-nav .chip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.linea-nav .chip.active:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

/* Instrucción antes de un grupo de chips (Ambientes y Colecciones) */
.filter-label {
  flex: 0 0 100%;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 2px;
}

.count {
  margin-left: auto;
  font-size: .84rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .contact {
    padding: 80px 0;
  }

  .contact h2 {
    font-size: clamp(1.75rem, 5vw, 2.4rem);
  }

  .contact p {
    font-size: 1rem;
    margin-bottom: 28px;
  }

  .faq {
    padding: 72px 0;
  }

  .faq .head {
    margin-bottom: 28px;
  }

  .faq .head h2 {
    font-size: clamp(1.5rem, 4.5vw, 2rem);
  }

  details {
    padding: 18px 0;
  }

  summary {
    font-size: 1rem;
    gap: 14px;
  }

  details p {
    font-size: .95rem;
  }

  .filterbar {
    top: var(--header-h, 72px);
  }

  .filterbar .wrap {
    padding-top: 14px;
    padding-bottom: 14px;
  }
}

@media (max-width: 560px) {
  /* Chips de .linea-nav en fila pareja, mismo patrón que .filterbar
     (Ambientes): --chip-cols lo calcula global.js según cuántos chips haya. */
  .linea-nav {
    justify-content: center;
    gap: 6px;
  }

  .linea-nav .chip {
    flex: 0 0 calc((100% - (var(--chip-cols, 1) - 1) * 6px) / var(--chip-cols, 1));
    min-width: 0;
    justify-content: center;
    text-align: center;
    padding: 6px 2px;
    min-height: 32px;
    font-size: .52rem;
    line-height: 1.2;
    white-space: normal;
  }

  .contact {
    padding: 64px 0;
  }

  .contact p {
    font-size: .95rem;
    margin-bottom: 24px;
  }

  .contact-actions {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .contact-actions .btn-primary,
  .contact-actions .btn-ghost {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .cat-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  .cat-actions .btn-primary,
  .cat-actions .btn-text {
    width: 100%;
    justify-content: center;
  }

  .helper {
    padding: 28px 22px;
  }

  .helper h3 {
    font-size: clamp(1.35rem, 5vw, 1.65rem);
  }

  .faq {
    padding: 56px 0;
  }

  summary {
    font-size: .95rem;
  }

  details p {
    font-size: .9rem;
  }

  .btn-primary,
  .btn-ghost {
    font-size: var(--fs-btn);
    min-height: 44px;
    padding: 14px 22px;
  }

  .btn-text {
    font-size: var(--fs-btn);
    min-height: 44px;
  }

  .filterbar {
    top: var(--header-h, 68px);
  }
}
