:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --text: #101827;
  --muted: #5b6473;
  --primary: #0f766e;
  --primary-2: #115e59;
  --accent: #ea580c;
  --ring: rgba(15, 118, 110, 0.2);
  --border: #d5dde7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(1200px 500px at 0% -10%, #dbeafe 0%, transparent 70%),
    radial-gradient(1000px 500px at 95% 0%, #dcfce7 0%, transparent 72%),
    var(--bg);
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0.75rem;
  z-index: 100;
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
  background: #0f766e;
  color: #ffffff;
  font-weight: 700;
}

.skip-link:focus {
  top: 0.75rem;
}

.serif {
  font-family: "Source Serif 4", serif;
}

.nav-blur {
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.86);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 18px 35px rgba(16, 24, 39, 0.07);
  content-visibility: auto;
  contain-intrinsic-size: 420px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.26rem 0.72rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-primary {
  background: rgba(15, 118, 110, 0.13);
  color: #0f5f59;
}

.badge-accent {
  background: rgba(234, 88, 12, 0.12);
  color: #9a3412;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 0.74rem;
  padding: 0.84rem 1rem;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.cta-btn:hover {
  transform: translateY(-1px);
  opacity: 0.98;
}

.cta-btn:focus-visible,
.select-control:focus-visible,
.input-control:focus-visible,
.link-focus:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

.input-control,
.select-control {
  width: 100%;
  border-radius: 0.72rem;
  border: 1px solid var(--border);
  padding: 0.7rem 0.78rem;
  background: #fff;
}

.stars {
  color: #f59e0b;
  letter-spacing: 0.05em;
}

.fade-up {
  animation: fadeUp 0.55s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fade-up {
    animation: none;
  }

  .cta-btn {
    transition: none;
  }
}

.grid-mask {
  position: relative;
  background: linear-gradient(140deg, #ffffff 0%, #f8fbff 55%, #f2f8f3 100%);
}

.grid-mask::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.32;
}

.table-wrap {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.compare-table th,
.compare-table td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 0.75rem 0.65rem;
  vertical-align: top;
}

.compare-table th {
  background: #f8fafc;
  font-weight: 700;
}

.card-media {
  height: 220px;
  border-radius: 0.9rem;
  border: 1px solid #e6ebf2;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.75rem;
}

.detail-media {
  min-height: 360px;
  border: 1px solid #e6ebf2;
  border-radius: 0.95rem;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
}

.mobile-sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 0.72rem 0.9rem;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 30px rgba(16, 24, 39, 0.08);
}

.compare-tray {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  width: min(360px, calc(100vw - 2rem));
}

.compare-tray-inner {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border);
  border-radius: 0.95rem;
  padding: 0.9rem;
  box-shadow: 0 20px 40px rgba(16, 24, 39, 0.16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.compare-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #cde7e4;
  background: #edf9f7;
  color: #0f5f59;
  font-size: 0.72rem;
  font-weight: 600;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
}

.image-viewer-dialog {
  position: relative;
  z-index: 1;
  max-width: min(1000px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid var(--border);
  padding: 1rem;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.32);
}

.image-viewer-dialog img {
  width: 100%;
  max-height: calc(100vh - 9rem);
  object-fit: contain;
}

.image-viewer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
  padding: 0.35rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 0.82rem;
  font-weight: 600;
}

@media (min-width: 768px) {
  .mobile-sticky-cta {
    display: none;
  }
}

@media (max-width: 767px) {
  .compare-tray {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 4.4rem;
    width: auto;
  }
}
