:root {
  color-scheme: light;
  --ink: #16333b;
  --muted: #6c7e82;
  --paper: #f5f7f3;
  --white: #ffffff;
  --sea: #0d7773;
  --sea-dark: #07514f;
  --lime: #c9e66a;
  --line: #dfe8e4;
  --shadow: 0 18px 45px rgba(22, 51, 59, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 8%, rgba(201, 230, 106, 0.28), transparent 28rem),
    linear-gradient(180deg, #fbfcf9 0%, var(--paper) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }

.topbar {
  min-height: 78px;
  padding: 14px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(22, 51, 59, 0.08);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px 14px 14px 4px;
  color: white;
  background: var(--sea);
  font-weight: 900;
  font-size: 1.25rem;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; }
.brand small { color: var(--muted); margin-top: 2px; }

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e0a42f;
  box-shadow: 0 0 0 4px rgba(224, 164, 47, 0.14);
}

.sync-pill.connected .sync-dot {
  background: #3da66c;
  box-shadow: 0 0 0 4px rgba(61, 166, 108, 0.14);
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(54px, 8vw, 96px) 0 90px;
}

.hero { max-width: 740px; margin-bottom: 42px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--sea);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 720px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 6vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 500;
}

.hero > p:last-child {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.65;
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.family-card {
  min-height: 230px;
  padding: 26px;
  border: 1px solid rgba(22, 51, 59, 0.08);
  border-radius: 26px;
  background: var(--white);
  box-shadow: 0 3px 0 rgba(22, 51, 59, 0.02);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.family-card:hover, .family-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(13, 119, 115, 0.3);
  box-shadow: var(--shadow);
  outline: none;
}

.family-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #e4f2ef;
  font-size: 1.8rem;
}

.family-card h2 { margin: 0 0 7px; font-size: 1.35rem; }
.family-card p { margin: 0; color: var(--muted); }
.family-bottom { display: flex; justify-content: space-between; align-items: end; gap: 15px; }
.family-count { color: var(--sea); font-weight: 700; font-size: 0.86rem; }
.family-arrow { font-size: 1.5rem; color: var(--sea); }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: -8px 0 30px;
}

.back-button {
  border: 0;
  background: transparent;
  padding: 10px 0;
  color: var(--sea-dark);
  font-weight: 750;
  cursor: pointer;
}

.search {
  width: min(100%, 440px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.search input {
  width: 100%;
  padding: 13px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.results-meta { margin-bottom: 18px; color: var(--muted); font-size: 0.9rem; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.product-card {
  overflow: hidden;
  border: 1px solid rgba(22, 51, 59, 0.08);
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 5px 18px rgba(22, 51, 59, 0.05);
}

.product-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #d7ede7, #f1f4dc);
}

.product-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vat-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--sea-dark);
  font-size: 0.72rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.product-body { padding: 20px; }
.reference {
  color: var(--sea);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.designation { margin: 8px 0 20px; font-size: 1.08rem; line-height: 1.35; }
.scientific-name, .catch-zone { margin: 0 0 7px; color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.scientific-name { font-style: italic; }
.catch-zone { min-height: 2.2em; }
.product-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 0.82rem; }
.availability { color: #2f855a; font-weight: 700; }

.empty-state {
  padding: 50px 25px;
  border: 1px dashed #c7d4d0;
  border-radius: 22px;
  text-align: center;
  color: var(--muted);
}
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { margin-bottom: 8px; color: var(--ink); }

.load-more {
  display: block;
  margin: 34px auto 0;
  padding: 13px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--sea);
  color: white;
  font-weight: 750;
  cursor: pointer;
}
.load-more:hover { background: var(--sea-dark); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(20px, 5vw, 72px);
  border-top: 1px solid rgba(22, 51, 59, 0.08);
  color: var(--muted);
  font-size: 0.8rem;
}

[hidden] { display: none !important; }

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

@media (max-width: 600px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .sync-pill { width: 100%; }
  main { width: min(100% - 28px, 1180px); padding-top: 46px; }
  .family-grid, .product-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  footer { flex-direction: column; }
}
