/* Vishwatronix Products — catalog + detail */

.products-page {
  overflow-x: clip;
}

/* —— Catalog hero —— */
.products-hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: flex;
  align-items: flex-end;
  padding: calc(var(--header-h) + 48px) 0 72px;
  color: #f5f5f7;
  background: #07111f;
}

.products-hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.products-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transform: scale(1.04);
  animation: products-kenburns 22s var(--ease-in-out) infinite alternate;
}

.products-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(5, 12, 22, 0.92) 0%, rgba(5, 12, 22, 0.72) 42%, rgba(5, 12, 22, 0.45) 100%),
    linear-gradient(0deg, rgba(5, 12, 22, 0.85) 0%, transparent 45%);
}

.products-hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 75% 65% at 40% 50%, #000 15%, transparent 75%);
  opacity: 0.7;
  pointer-events: none;
}

@keyframes products-kenburns {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.1) translate3d(-1.5%, -1%, 0);
  }
}

.products-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.products-hero .page-hero__crumb,
.products-hero .page-hero__crumb a {
  color: rgba(245, 245, 247, 0.62);
}

.products-hero .page-hero__crumb a:hover {
  color: #fff;
}

.products-hero__brand {
  margin: 18px 0 14px;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: #fff;
}

.products-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(22px, 3.2vw, 34px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: rgba(245, 245, 247, 0.92);
  max-width: 18ch;
}

.products-hero__lead {
  margin: 0 0 28px;
  font-size: 17px;
  line-height: 1.55;
  color: rgba(245, 245, 247, 0.68);
  max-width: 44ch;
}

.products-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.products-hero .btn--primary {
  background: #fff;
  color: #0a1628;
}

.products-hero .btn--primary:hover {
  background: #e8eef7;
  color: #0a1628;
}

.products-hero .btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.products-hero .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* —— Catalog mosaic —— */
.products-mosaic {
  padding-top: clamp(40px, 5vw, 64px);
}

.products-mosaic__header {
  margin-bottom: 28px;
  max-width: 42ch;
}

.products-mosaic__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.product-tile {
  position: relative;
  grid-column: span 4;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: #f5f5f7;
  border: 1px solid rgba(255, 255, 255, 0.08);
  isolation: isolate;
  transition:
    transform var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out);
}

.product-tile--featured {
  grid-column: span 8;
  min-height: 420px;
}

.product-tile--wide {
  grid-column: span 12;
  min-height: 280px;
}

.product-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
  color: #fff;
}

.product-tile__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.product-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease-out);
}

.product-tile:hover .product-tile__media img {
  transform: scale(1.06);
}

.product-tile__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(6, 14, 24, 0.15) 0%, rgba(6, 14, 24, 0.82) 100%);
}

.product-tile__body {
  position: relative;
  z-index: 2;
  padding: clamp(20px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-tile__tag {
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 980px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.product-tile__title {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.product-tile__summary {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(245, 245, 247, 0.72);
  max-width: 42ch;
}

.product-tile__action {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  color: #fff;
}

.product-tile__action svg {
  width: 16px;
  height: 16px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.product-tile:hover .product-tile__action svg {
  transform: translateX(3px);
}

/* —— Detail hero —— */
.product-detail-hero {
  position: relative;
  min-height: min(78vh, 680px);
  display: flex;
  align-items: flex-end;
  padding: calc(var(--header-h) + 40px) 0 64px;
  color: #f5f5f7;
  background: #07111f;
}

.product-detail-hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.product-detail-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.product-detail-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(5, 12, 22, 0.9) 0%, rgba(5, 12, 22, 0.55) 50%, rgba(5, 12, 22, 0.35) 100%),
    linear-gradient(0deg, rgba(5, 12, 22, 0.88) 0%, transparent 50%);
}

.product-detail-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.product-detail-hero .page-hero__crumb,
.product-detail-hero .page-hero__crumb a {
  color: rgba(245, 245, 247, 0.62);
}

.product-detail-hero .page-hero__crumb a:hover {
  color: #fff;
}

.product-detail-hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 12px;
  padding: 6px 12px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.product-detail-hero__tag svg {
  width: 14px;
  height: 14px;
}

.product-detail-hero__brand {
  margin: 0 0 12px;
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: #fff;
}

.product-detail-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(20px, 2.8vw, 28px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: rgba(245, 245, 247, 0.9);
  max-width: 28ch;
}

.product-detail-hero__lead {
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(245, 245, 247, 0.68);
  max-width: 46ch;
}

.product-detail-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.product-detail-hero .btn--primary {
  background: #fff;
  color: #0a1628;
}

.product-detail-hero .btn--primary:hover {
  background: #e8eef7;
  color: #0a1628;
}

.product-detail-hero .btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.product-detail-hero .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* —— Feature strip —— */
.product-features {
  margin-top: -28px;
  position: relative;
  z-index: 2;
  padding-bottom: 8px;
}

.product-features__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.product-features__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 980px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 560;
  color: var(--text-primary);
}

.product-features__item svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

/* —— Detail body —— */
.product-body {
  padding-top: clamp(40px, 5vw, 64px);
}

.product-body__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.55fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  margin-bottom: 48px;
}

.product-body .page-prose {
  max-width: none;
}

.product-aside {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    linear-gradient(165deg, rgba(0, 113, 227, 0.06), transparent 55%),
    var(--surface);
}

.product-aside__visual {
  margin: -22px -22px 18px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.product-aside__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-aside h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.product-aside p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.product-aside .btn {
  width: 100%;
  justify-content: center;
}

/* —— Related with images —— */
.products-page .related-products,
.product-page .related-products {
  margin-top: 8px;
}

.related-products--visual .related-products__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.related-products__card--visual {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border);
  color: #f5f5f7;
}

.related-products__card--visual:hover {
  border-color: transparent;
  color: #fff;
}

.related-products__card--visual .related-products__thumb {
  position: absolute;
  inset: 0;
}

.related-products__card--visual .related-products__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease-out);
}

.related-products__card--visual:hover .related-products__thumb img {
  transform: scale(1.05);
}

.related-products__card--visual .related-products__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(6, 14, 24, 0.88) 100%);
}

.related-products__card--visual .related-products__copy {
  position: relative;
  z-index: 1;
  padding: 18px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 180px;
}

.related-products__card--visual h3 {
  color: #fff;
  margin-bottom: 4px;
}

.related-products__card--visual p {
  color: rgba(245, 245, 247, 0.7);
}

/* Transparent header over product heroes */
body[data-page="product"] .header:not(.is-scrolled) {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body[data-page="product"] .header:not(.is-scrolled) .logo__name,
body[data-page="product"] .header:not(.is-scrolled) .nav__link,
body[data-page="product"] .header:not(.is-scrolled) .theme-toggle,
body[data-page="product"] .header:not(.is-scrolled) .nav-toggle {
  color: rgba(245, 245, 247, 0.92);
}

body[data-page="product"] .header:not(.is-scrolled) .nav__link.is-active,
body[data-page="product"] .header:not(.is-scrolled) .nav__link:hover {
  color: #fff;
}

body[data-page="product"] .header:not(.is-scrolled) .theme-toggle,
body[data-page="product"] .header:not(.is-scrolled) .nav-toggle {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 980px) {
  .product-tile,
  .product-tile--featured {
    grid-column: span 6;
    min-height: 280px;
  }

  .product-tile--wide {
    grid-column: span 12;
  }

  .product-body__layout {
    grid-template-columns: 1fr;
  }

  .product-aside {
    position: static;
  }
}

@media (max-width: 640px) {
  .products-hero,
  .product-detail-hero {
    min-height: auto;
    padding-bottom: 52px;
  }

  .product-tile,
  .product-tile--featured,
  .product-tile--wide {
    grid-column: span 12;
    min-height: 260px;
  }

  .related-products--visual .related-products__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .products-hero__media img,
  .product-tile:hover .product-tile__media img,
  .related-products__card--visual:hover .related-products__thumb img {
    animation: none;
    transform: none;
  }

  .product-tile:hover {
    transform: none;
  }
}
