/*
 * TapLenx Premium Visual System v3
 * Final refinement layer for typography, product media, galleries and visual rhythm.
 * This file intentionally contains only design-system refinements; legacy hotfix rules are not used.
 */

:root {
  --pv3-ink: #081b33;
  --pv3-text: #122842;
  --pv3-muted: #5b6f86;
  --pv3-blue: #1267e8;
  --pv3-blue-strong: #0d56c8;
  --pv3-line: #d9e4ef;
  --pv3-soft: #f5f8fc;
  --pv3-card: #ffffff;
  --pv3-radius: 20px;
  --pv3-radius-lg: 28px;
  --pv3-shadow: 0 18px 50px rgba(7, 27, 51, .08);
  --pv3-shadow-hover: 0 24px 62px rgba(7, 27, 51, .13);
}

html {
  text-rendering: optimizeLegibility;
}

body {
  color: var(--pv3-text);
  font-family: "Segoe UI Variable Text", "Segoe UI Variable", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-kerning: normal;
  font-synthesis: none;
  letter-spacing: -.006em;
}

h1, h2, h3, h4,
.brand-main,
.btn {
  font-family: "Segoe UI Variable Display", "Segoe UI Variable", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

::selection {
  color: #fff;
  background: var(--pv3-blue);
}

/* Premium type scale */
.rb-title {
  max-width: 760px;
  font-size: clamp(46px, 4.15vw, 60px);
  line-height: 1.035;
  font-weight: 720;
  letter-spacing: -.046em;
}

.catalog-hero-copy h1,
.rb-quote-intro h1 {
  font-size: clamp(44px, 3.9vw, 56px);
  line-height: 1.045;
  font-weight: 720;
  letter-spacing: -.044em;
}

.rb-head h2,
.rb-section-title,
.rb-cta h2 {
  font-size: clamp(34px, 3vw, 42px);
  line-height: 1.09;
  font-weight: 700;
  letter-spacing: -.035em;
}

.rb-lead,
.catalog-lead {
  max-width: 650px;
  font-size: 17px;
  line-height: 1.72;
  letter-spacing: -.006em;
}

.rb-head > p {
  font-size: 16px;
  line-height: 1.72;
}

.rb-kicker {
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}

/* Global rhythm */
.rb-home-hero,
.rb-hero {
  padding: 72px 0 76px;
}

.catalog-hero {
  padding: 72px 0 68px;
}

.rb-section,
.catalog-products {
  padding: 76px 0;
}

.rb-head {
  grid-template-columns: minmax(0, 1fr) minmax(300px, .62fr);
  gap: 64px;
  align-items: end;
  margin-bottom: 34px;
}

.rb-hero-grid,
.catalog-hero-grid {
  gap: 64px;
}

.rb-card,
.rb-tech,
.usecase-card,
.qt-summary,
.qt-assurance,
.qt-form {
  border-color: var(--pv3-line);
  border-radius: var(--pv3-radius);
}

.rb-card,
.rb-tech,
.usecase-card {
  box-shadow: 0 8px 26px rgba(7, 27, 51, .035);
}

/* Header polish */
.site-header {
  border-bottom-color: rgba(217, 228, 239, .92);
  box-shadow: 0 1px 0 rgba(7, 27, 51, .015);
}

.site-header.scrolled {
  box-shadow: 0 10px 30px rgba(7, 27, 51, .07);
}

.desktop-nav a {
  color: #435870;
  font-size: 14px;
  font-weight: 660;
}

.header-actions .btn-primary {
  box-shadow: 0 8px 20px rgba(18, 103, 232, .15);
}

/* Buttons */
.btn {
  min-height: 48px;
  border-radius: 13px;
  font-size: 14.5px;
  font-weight: 740;
  letter-spacing: -.006em;
}

.btn-primary {
  box-shadow: 0 8px 20px rgba(18, 103, 232, .16);
}

.btn-primary:hover {
  box-shadow: 0 12px 28px rgba(18, 103, 232, .22);
}

/* Product cards: fixed premium geometry */
.rb-home-products,
.product-list,
.brand-model-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.rb-mini-product,
.product-card {
  height: 100%;
  border: 1px solid var(--pv3-line);
  border-radius: var(--pv3-radius);
  background: var(--pv3-card);
  box-shadow: 0 12px 34px rgba(7, 27, 51, .055);
  overflow: hidden;
}

.rb-mini-product {
  display: grid;
  grid-template-rows: auto 1fr;
}

.rb-mini-product img,
.product-visual,
.product-visual img {
  background: #eef2f6;
}

.rb-mini-product img,
.product-visual {
  aspect-ratio: 4 / 5;
}

.rb-mini-product img,
.product-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.rb-mini-product > div {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  justify-content: center;
  padding: 17px 18px 18px;
}

.rb-mini-product strong {
  color: var(--pv3-ink);
  font-size: 19px;
  line-height: 1.22;
  font-weight: 720;
  letter-spacing: -.022em;
}

.rb-mini-product small {
  margin-top: 5px;
  color: var(--pv3-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.product-card:hover,
a.rb-mini-product:hover {
  transform: translateY(-4px);
  border-color: #bdd0e4;
  box-shadow: var(--pv3-shadow-hover);
}

.product-visual {
  position: relative;
  display: block;
  overflow: hidden;
}

.product-info {
  flex: 1;
  padding: 20px 20px 22px;
}

.product-info h2 {
  color: var(--pv3-ink);
  font-size: 24px;
  line-height: 1.16;
  font-weight: 720;
}

.product-info > p {
  margin-top: 9px;
  color: var(--pv3-muted);
  font-size: 14px;
  line-height: 1.62;
}

.product-category {
  margin-bottom: 7px;
  font-size: 11px;
  letter-spacing: .11em;
}

.product-link {
  padding-top: 18px;
  font-size: 13.5px;
}

.product-chip,
.product-index {
  top: 14px;
}

/* Hero product stages */
.rb-stage,
.catalog-hero-art {
  border-color: rgba(147, 177, 208, .28);
  border-radius: var(--pv3-radius-lg);
  box-shadow: var(--pv3-shadow);
}

.rb-stage.dark {
  background:
    radial-gradient(circle at 55% 30%, rgba(44, 113, 190, .13), transparent 46%),
    rgba(4, 22, 41, .62);
}

.rb-stage img,
.catalog-hero-art img {
  border-radius: 18px;
}

/* Product detail gallery */
.pd-gallery {
  position: relative;
  min-width: 0;
  min-height: 520px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(147, 197, 253, .18);
  border-radius: var(--pv3-radius-lg);
  background:
    radial-gradient(circle at 52% 32%, rgba(60, 133, 216, .14), transparent 46%),
    rgba(4, 22, 41, .64);
  box-shadow: 0 24px 70px rgba(2, 13, 27, .22);
}

.pd-gallery-viewport {
  position: relative;
  width: min(72%, 410px);
  aspect-ratio: 4 / 5;
}

.pd-gallery-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px) scale(.99);
  transition: opacity .28s ease, transform .28s ease;
}

.pd-gallery-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.pd-gallery-slide img {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .22);
}

.pd-gallery-slide figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(3, 18, 34, .72);
  color: #f8fbff;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.pd-gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: var(--pv3-ink);
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
  transition: transform .18s ease, background .18s ease;
}

.pd-gallery-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.05);
}

.pd-gallery-prev { left: 22px; }
.pd-gallery-next { right: 22px; }

.pd-gallery-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 3;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.pd-gallery-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .38);
  cursor: pointer;
  transition: width .18s ease, border-radius .18s ease, background .18s ease;
}

.pd-gallery-dot.is-active {
  width: 24px;
  border-radius: 999px;
  background: #fff;
}

.pd-gallery-counter {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  min-width: 46px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(3, 18, 34, .66);
  color: #fff;
  font-size: 11px;
  font-weight: 760;
  backdrop-filter: blur(12px);
}

/* Front/back brand pairs */
.rb-pair,
.rb-brand-images {
  gap: 14px;
}

.rb-pair figure,
.rb-brand-pair {
  border-color: var(--pv3-line);
  border-radius: var(--pv3-radius);
  box-shadow: 0 10px 32px rgba(7, 27, 51, .05);
}

.rb-pair img,
.rb-brand-images img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
  background: #eef2f6;
}

.rb-brand-pairs {
  gap: 24px;
  align-items: stretch;
}

.rb-brand-pair {
  display: grid;
  grid-template-rows: auto 1fr;
}

.rb-brand-copy {
  padding: 20px 20px 22px;
}

.rb-brand-copy h3 {
  font-size: 18px;
  font-weight: 720;
  letter-spacing: -.018em;
}

/* Quote form refinement */
.qt-layout {
  grid-template-columns: minmax(310px, 340px) minmax(0, 1fr);
  gap: 40px;
}

.qt-aside > h2 {
  font-size: 28px;
  line-height: 1.12;
  font-weight: 710;
}

.qt-summary > div {
  padding: 15px 17px;
}

.qt-summary strong {
  font-size: 14px;
  line-height: 1.48;
}

.qt-form {
  padding: 34px 38px 40px;
  box-shadow: 0 16px 48px rgba(7, 27, 51, .055);
}

.qt-choice,
.qt-check,
.qt-upload,
.qt-field input,
.qt-field select,
.qt-field textarea {
  border-color: var(--pv3-line);
  background: #fff;
}

.qt-choice:hover,
.qt-check:hover,
.qt-upload:hover {
  border-color: #a9c5e4;
  background: #f9fbfe;
}

.qt-choice:has(input:checked),
.qt-check:has(input:checked) {
  border-color: var(--pv3-blue);
  background: #edf5ff;
  box-shadow: 0 0 0 3px rgba(18, 103, 232, .08);
}

/* CTA */
.rb-cta {
  padding: 54px 0;
}

.rb-cta-grid {
  gap: 48px;
}

.rb-cta .btn {
  min-width: 160px;
}

/* Footer */
.footer {
  border-top: 1px solid rgba(255, 255, 255, .05);
}

/* Responsive */
@media (max-width: 1024px) {
  .rb-title {
    font-size: clamp(44px, 5vw, 54px);
  }

  .rb-head,
  .rb-hero-grid,
  .catalog-hero-grid {
    gap: 42px;
  }

  .rb-home-products,
  .product-list,
  .brand-model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pd-gallery {
    min-height: 500px;
  }

  .pd-gallery-viewport {
    width: min(74%, 390px);
  }
}

@media (max-width: 760px) {
  :root {
    --pv3-radius: 17px;
    --pv3-radius-lg: 22px;
  }

  .rb-home-hero,
  .rb-hero,
  .catalog-hero {
    padding: 54px 0 58px;
  }

  .rb-section,
  .catalog-products {
    padding: 56px 0;
  }

  .rb-title,
  .catalog-hero-copy h1,
  .rb-quote-intro h1 {
    font-size: clamp(38px, 11vw, 46px);
    line-height: 1.04;
  }

  .rb-head h2,
  .rb-section-title,
  .rb-cta h2 {
    font-size: clamp(31px, 8.5vw, 38px);
  }

  .rb-head {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 28px;
  }

  .rb-home-products,
  .product-list,
  .brand-model-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .rb-mini-product > div {
    min-height: 82px;
  }

  .pd-gallery {
    min-height: 460px;
  }

  .pd-gallery-viewport {
    width: min(76%, 340px);
  }

  .pd-gallery-arrow {
    width: 42px;
    height: 42px;
    font-size: 24px;
  }

  .pd-gallery-prev { left: 12px; }
  .pd-gallery-next { right: 12px; }

  .qt-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .qt-form {
    padding: 26px 20px 30px;
  }

  .rb-cta-grid {
    align-items: flex-start;
    gap: 24px;
  }
}

@media (max-width: 430px) {
  .rb-title,
  .catalog-hero-copy h1,
  .rb-quote-intro h1 {
    font-size: 38px;
  }

  .rb-lead,
  .catalog-lead {
    font-size: 16px;
  }

  .pd-gallery {
    min-height: 430px;
  }

  .pd-gallery-viewport {
    width: min(78%, 310px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pd-gallery-slide,
  .pd-gallery-arrow,
  .pd-gallery-dot,
  .product-card,
  .rb-mini-product {
    transition: none !important;
  }
}
