/* ============================================================
   3D TACT — V2 single-page components
   category chips · content bands · booking modal
   Loaded after style.css / responsive.css.
   ============================================================ */

/* ---------- Self-hosted Manrope (variable 700–800, latin subsets)
   Replaces the Google Fonts connection: zero third-party requests. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url("../assets/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url("../assets/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* ---------- Hero: entrance must not delay content ---------- */
.hero-content .hero-eyebrow {
  animation: heroFadeUp 0.5s ease both 0.05s;
}
.hero-content .hero-title {
  animation: heroTitleIn 0.55s ease both 0.1s;
}
.hero-content .hero-subtitle {
  animation: heroFadeUp 0.5s ease both 0.2s;
}
.hero-content .hero-actions {
  animation: heroFadeUp 0.5s ease both 0.28s;
}

/* ---------- Category chips ---------- */
.chip-bar {
  display: none; /* JS-gated: without JS the full grid is shown as-is */
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto 2.25rem;
}
.js .chip-bar {
  display: flex;
}

.chip {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5625rem 1.0625rem;
  transition:
    color var(--t),
    background var(--t),
    border-color var(--t),
    transform var(--t);
}
.chip:hover {
  color: var(--text);
  border-color: var(--border-2);
  transform: translateY(-1px);
}
.chip.active {
  color: #000;
  background: var(--yellow);
  border-color: var(--yellow);
}
.chip:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.product-card.is-hidden {
  display: none;
}

.chip-empty {
  text-align: center;
  color: var(--text-muted);
  margin-top: 1.5rem;
}
.chip-empty a {
  color: var(--yellow);
}

/* ---------- Content bands (robotics / footwear) ---------- */
.v2-band {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.band-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.band-grid-flip .band-media {
  order: 2;
}
.band-grid-flip .band-content {
  order: 1;
}

.band-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-2);
  background: var(--bg-3);
  box-shadow: var(--shadow);
}
.band-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.band-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #000;
  background: var(--yellow);
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
}

.band-content h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.band-content > p {
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.band-points {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: grid;
  gap: 0.625rem;
}
.band-points li {
  position: relative;
  padding-left: 1.625rem;
  color: var(--text-2);
  font-size: 0.9375rem;
}
.band-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3125rem;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--yellow-bg);
  border: 2px solid var(--yellow);
}

.band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

@media (max-width: 900px) {
  .band-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .band-grid-flip .band-media {
    order: 0;
  }
  .band-grid-flip .band-content {
    order: 0;
  }
}

/* ---------- Meeting booking section ---------- */
.meeting-booking-section {
  border-top: 1px solid var(--border);
}
.meeting-booking-section .section-header {
  margin-bottom: 2.5rem;
}
.meeting-booking-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 2.25rem;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-left: 3px solid var(--yellow);
  border-radius: var(--radius-md);
}
.meeting-booking-copy {
  min-width: 0;
}
.meeting-booking-eyebrow {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--yellow);
  font-size: 0.8125rem;
  font-weight: 700;
}
.meeting-booking-copy h3 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 700;
}
.meeting-booking-copy p {
  max-width: 42rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}
.meeting-booking-button {
  justify-content: center;
  min-width: 190px;
}
.meeting-booking-contact {
  margin: 1.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
}
.meeting-booking-contact a {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--yellow);
  text-underline-offset: 0.2em;
}

/* ---------- Booking modal (Microsoft Bookings iframe) ---------- */
.modal.booking-modal {
  position: fixed;
  inset: 0;
  z-index: 101;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.booking-modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: heroFadeUp 0.25s ease both;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-top: 0.25rem;
}
.booking-modal-copy .label {
  margin-bottom: 0.25rem;
}
.booking-modal-copy p {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}
.modal-close {
  appearance: none;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 1.5rem;
  line-height: 1;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    background var(--t),
    color var(--t);
  flex: none;
}
.modal-close:hover {
  background: var(--yellow);
  color: #000;
}

.booking-frame-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 420px;
  background: #fff;
}
.booking-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.booking-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  background: var(--bg-3);
}

.booking-fallback {
  padding: 1.75rem 1.5rem;
  color: var(--text-2);
}
.booking-fallback p {
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.booking-fallback p a[href^="tel:"] {
  color: var(--text);
  font-weight: 700;
}
.booking-fallback a {
  color: var(--yellow);
}
.booking-fallback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.booking-external {
  display: block;
  padding: 0.75rem 1.5rem 1.125rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  text-decoration: none;
}
.booking-external[hidden] {
  display: none;
}
.booking-external:hover {
  color: var(--yellow);
}

@media (max-width: 640px) {
  .meeting-booking-section .section-header {
    margin-bottom: 1.75rem;
  }
  .meeting-booking-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.5rem;
  }
  .meeting-booking-button {
    width: 100%;
  }
  .modal.booking-modal {
    padding: 0;
  }
  .booking-modal .modal-head {
    padding: 1rem;
  }
  .booking-modal-copy p {
    font-size: 0.8125rem;
  }
  .modal-panel {
    width: 100%;
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
    border: 0;
  }
  .booking-frame-wrap {
    min-height: 0;
  }
  .booking-external {
    padding: 0.75rem 1rem 1rem;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .chip {
    transition: none;
  }
  .modal-panel {
    animation: none;
  }
}

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Grid load more ---------- */
.grid-load-wrap {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

/* Band without an image: content spans the full width. */
.band-grid-text {
  grid-template-columns: 1fr;
}
.band-grid-text .band-content {
  max-width: 760px;
}

/* Image sits above the stretched card link: clicking it opens the lightbox,
   the rest of the card still opens WhatsApp. */
.product-card-img {
  position: relative;
  z-index: 2;
  cursor: zoom-in;
}

/* ---------- Product lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] {
  display: none;
}
.lb-figure {
  margin: 0;
  max-width: 92vw;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.lb-figure img {
  max-width: 88vw;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  cursor: zoom-in;
  transition: transform 0.18s ease;
  background: #111;
}
.lightbox.is-zoomed .lb-figure img {
  cursor: zoom-out;
}
.lb-figure img.zoomed {
  transform: scale(2.4);
}
.lb-figure figcaption {
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}
.lb-close {
  top: 1rem;
  right: 1.25rem;
  font-size: 2.2rem;
}
.lb-prev {
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
}
.lb-next {
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
}
.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
  color: #9ca3af;
}
.lb-hint {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: #9ca3af;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.lightbox.is-zoomed .lb-hint {
  display: none;
}
@media (max-width: 640px) {
  .lb-prev,
  .lb-next {
    font-size: 1.4rem;
  }
  .lb-figure img {
    max-height: 64vh;
  }
}
