/* =========================================================
   PRODUCTS PAGES SHARED STYLES
   Used by:
   - /products/index.php
   - /products/motor-test-equipment/index.php
   Brand variables come from /css-global.css
========================================================= */

/* ========= BASE ========= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  color: var(--clr-secondary);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--clr-primary);
  text-decoration: none;
}

a:hover {
  color: var(--clr-accent);
}

main {
  padding: 0 0 50px;
  background: #ffffff;
}

.section {
  width: 100%;
  background: #ffffff;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

/* ========= SKIP LINK ========= */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: var(--page-gutter);
  top: var(--page-gutter);
  width: auto;
  height: auto;
  padding: 8px 12px;
  background: var(--clr-primary);
  color: #fff;
  border-radius: 6px;
  z-index: 9999;
}

/* ========= SHARED TYPOGRAPHY ========= */
.page-header {
  margin-bottom: 26px;
}

.page-title {
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  color: var(--clr-primary);
  margin-bottom: 8px;
}

.page-intro {
  font-size: 0.98rem;
  line-height: 1.6;
  color: #334155;
}

.section-title {
  margin: 22px 0 12px;
  font-size: 1.15rem;
  color: var(--clr-secondary);
}

/* =========================================================
   PRODUCTS LANDING PAGE GRID
   /products/index.php
========================================================= */
.products-section {
  background: #ffffff;
}

.products-grid {
  list-style: none;
  display: grid;
  gap: 22px;
  margin-top: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-card {
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  overflow: hidden;
  transition:
    transform 0.16s ease-out,
    box-shadow 0.16s ease-out,
    border-color 0.16s ease-out,
    background-color 0.16s ease-out;
}

.product-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 118, 184, 0.65);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.15);
  background-color: #f8fbff;
}

.product-thumb {
  width: 100%;
  padding: 14px 14px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-thumb img {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
}

.product-body {
  padding: 14px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-body h2 {
  font-size: 1rem;
  color: var(--clr-secondary);
}

.product-body p {
  font-size: 0.9rem;
  color: var(--clr-muted);
  line-height: 1.5;
}

/* =========================================================
   MOTOR TEST EQUIPMENT PAGE
   /products/motor-test-equipment/index.php
========================================================= */

.motor-page main {
  padding: 0 0 56px;
  background: #ffffff;
}

/* ========= HERO ========= */
.hero-bleed {
  position: relative;
  margin: 0 0 22px;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
  padding: 0 0 22px;
  background:
    radial-gradient(900px 340px at 10% 0%, rgba(255,255,255,0.18), transparent 58%),
    radial-gradient(700px 260px at 92% 8%, rgba(255,255,255,0.12), transparent 56%),
    linear-gradient(180deg, #00A9E0 0%, #009fd5 100%);
  border-bottom: 1px solid rgba(255,255,255,0.18);
}

.hero-bleed::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0) 34%),
    radial-gradient(1000px 300px at 50% 100%, rgba(255,255,255,0.10), transparent 70%);
}

/* ========= HERO CARD ========= */
.hero {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
  background: #FFFFFF;
  box-shadow:
    0 14px 34px rgba(0, 54, 78, 0.18),
    0 2px 10px rgba(15, 23, 42, 0.05);
  color: var(--clr-secondary);
  margin-top: 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 32px;
  padding: 22px 28px 28px;
  align-items: center;
}

.hero-inner > * {
  min-width: 0;
}

.hero h1 {
  margin-bottom: 14px;
  font-size: clamp(2.1rem, 3.6vw, 2.95rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--clr-primary);
}

.hero p {
  margin-bottom: 12px;
  color: #385065;
  font-size: 1rem;
  line-height: 1.72;
  max-width: 62ch;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 6px;
  background: rgba(0, 169, 224, 0.10);
  border: 1px solid rgba(0, 169, 224, 0.18);
  color: #007fb0;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  width: fit-content;
}

.hero-kicker i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #00A9E0;
  box-shadow: 0 0 0 4px rgba(0, 169, 224, 0.12);
}

.hero-media {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}

/* ========= HERO SLIDER ========= */
.hero-slider {
  width: 100%;
  max-width: 500px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  user-select: none;
  background: #ffffff;
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow:
    0 16px 34px rgba(0, 54, 78, 0.18),
    0 3px 12px rgba(15, 23, 42, 0.06);
}

.hero-slider::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0) 20%),
    radial-gradient(420px 220px at 18% 10%, rgba(0,169,224,0.08), transparent 62%);
  z-index: 1;
}

.hero-slider::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 96px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.12));
  z-index: 1;
}

.hero-slider .slides {
  display: grid;
  background: #ffffff;
}

.hero-slider .slide {
  grid-area: 1 / 1;
  opacity: 0;
  transform: scale(1.01);
  transition: opacity 520ms ease, transform 820ms ease;
  position: relative;
}

.hero-slider .slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.hero-slider .slide img {
  width: 100%;
  height: 360px;
  object-fit: contain;
  display: block;
  padding: 18px 18px 70px;
  background:
    radial-gradient(circle at top, rgba(0,169,224,0.06), transparent 48%),
    linear-gradient(180deg, #ffffff 0%, #f2fbff 100%);
}

.hero-slider .caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 11px 13px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 169, 224, 0.16);
  color: #0f2740;
  font-weight: 800;
  font-size: 0.96rem;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(6px);
  z-index: 2;
}

.hero-slider .caption span {
  display: block;
  font-weight: 600;
  color: #587082;
  font-size: 0.82rem;
  margin-top: 3px;
}

/* hidden slider UI */
.hero-slider .dots,
.hero-slider .dot,
.hero-slider .pause-hint {
  display: none !important;
}

/* ========= CATEGORY GRID ========= */
.grid {
  list-style: none;
  display: grid;
  gap: 22px;
  margin-top: 14px;
  padding: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #ffffff;
}

.card {
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  overflow: hidden;
  transition:
    transform 0.16s ease-out,
    box-shadow 0.16s ease-out,
    border-color 0.16s ease-out,
    background-color 0.16s ease-out;
}

.card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 118, 184, 0.65);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.15);
  background-color: #f8fbff;
}

.thumb {
  width: 100%;
  padding: 14px 14px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 210px;
  background: #ffffff;
}

.thumb img {
  width: 100%;
  max-width: 100%;
  max-height: 180px;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
}

.body {
  padding: 14px 16px 16px;
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  min-height: 64px;
  background: #ffffff;
}

.body h2 {
  font-size: 1rem;
  color: var(--clr-secondary);
  line-height: 1.25;
  margin: 0;
}

/* ========= REDUCED MOTION ========= */
@media (prefers-reduced-motion: reduce) {
  .hero-slider .slide {
    transition: none;
  }
}

/* ========= RESPONSIVE ========= */
@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-media {
    justify-content: flex-start;
  }

  .hero-slider {
    max-width: 560px;
  }

  .hero-slider .slide img {
    height: 320px;
  }
}

@media (max-width: 900px) {
  .products-grid,
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .container {
    padding: 0 20px;
  }
}

@media (max-width: 680px) {
  .products-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 18px;
  }

  .thumb {
    height: 200px;
  }

  .hero-bleed {
    padding: 0 0 18px;
  }

  .hero-inner {
    padding: 18px 22px 22px;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 8vw, 2.35rem);
  }

  .hero-slider .slide img {
    height: 280px;
    padding: 14px 14px 64px;
  }

  .motor-page main {
    padding: 0 0 52px;
  }
}

@media (max-width: 480px) {
  .product-thumb,
  .thumb {
    padding: 10px 10px 0;
  }

  .product-body {
    padding: 10px 12px 12px;
  }

  .body {
    padding: 10px 12px 12px;
    min-height: 60px;
  }

  .container {
    padding: 0 16px;
  }

  .hero-bleed {
    padding: 0 0 16px;
    margin-bottom: 18px;
  }

  .hero {
    border-radius: 6px;
  }

  .hero-inner {
    padding: 16px 18px 18px;
    gap: 18px;
  }

  .hero-kicker {
    font-size: 0.76rem;
    padding: 7px 11px;
  }

  .hero p {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .hero-slider {
    border-radius: 6px;
  }

  .hero-slider .slide img {
    height: 250px;
    padding: 12px 12px 62px;
  }

  .hero-slider .caption {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 10px 12px;
    border-radius: 6px;
  }

  .hero-slider .caption span {
    font-size: 0.78rem;
  }

  .thumb {
    height: 190px;
  }
}