/* 3Cares — shared styles */

:root {
  --brand-950: #061E3D;
  --brand-900: #0A2D5C;
  --brand-700: #0057B8;
  --brand-500: #3D7FCC;
  --brand-100: #E7EFFA;
  --accent: #0057B8;
  --accent-dark: #00458F;
  --paper: #F4F6F9;
  --white: #FFFFFF;
  --ink: #1A2433;
  --muted: #536072;
  --line: #D6DEE8;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --header-h: 72px;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-700); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  color: var(--brand-900);
  margin: 0;
  letter-spacing: -0.01em;
}

h4 { margin: 0; }

p { margin: 0; }

:focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--brand-900);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 200;
}
.skip-link:focus { top: 12px; }

section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  font: 600 16px/1.2 var(--sans);
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-dark); }

.btn-outline { border-color: var(--brand-700); color: var(--brand-700); background: transparent; }
.btn-outline:hover { background: var(--brand-700); color: var(--white); }

.btn-light { border-color: rgba(255,255,255,.6); color: var(--white); background: transparent; }
.btn-light:hover { background: var(--white); color: var(--brand-900); }

.btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- Utility bar ---------- */

.utility {
  background: var(--brand-950);
  color: #C9D6E8;
  font-size: 14px;
}
.utility .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 40px;
}
.utility a { color: #C9D6E8; text-decoration: none; }
.utility a:hover { color: var(--white); text-decoration: underline; }
.utility-links { display: flex; gap: 24px; }

@media (max-width: 720px) {
  .utility-note { display: none; }
  .utility .wrap { justify-content: center; }
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease;
}
.site-header.scrolled { box-shadow: 0 6px 20px rgba(6, 30, 61, .08); }

.header-row {
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--brand-900);
  font: 700 26px/1 var(--serif);
  letter-spacing: -0.02em;
  flex: none;
}
.logo img { height: 40px; width: auto; }

.main-nav { flex: 1; }
.main-nav > ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-item { position: relative; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  font: 500 16px/1.2 var(--sans);
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-link:hover, .nav-item.open > .nav-link { background: var(--brand-100); color: var(--brand-900); }
.nav-link svg { width: 16px; height: 16px; transition: transform .2s ease; }
.nav-item.open > .nav-link svg { transform: rotate(180deg); }

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 340px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(6, 30, 61, .14);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.nav-item.open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.dropdown a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
}
.dropdown a strong { display: block; font-weight: 600; color: var(--brand-900); }
.dropdown a span { display: block; font-size: 14px; color: var(--muted); line-height: 1.4; }
.dropdown a:hover { background: var(--paper); }

.header-cta { flex: none; }

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-900);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-toggle svg { width: 24px; height: 24px; }

@media (max-width: 960px) {
  :root { --header-h: 64px; }
  .main-nav, .header-cta { display: none; }
  .menu-toggle { display: inline-flex; }
  .logo img { height: 34px; }
}

/* ---------- Mobile menu ---------- */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--white);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .25s ease, visibility .25s;
}
.mobile-menu.open { transform: none; visibility: visible; }

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.mobile-menu-body {
  overflow-y: auto;
  padding: 8px var(--gutter) 32px;
  flex: 1;
}
.mobile-menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu > .mobile-menu-body > ul > li { border-bottom: 1px solid var(--line); }

.m-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 0;
  background: none;
  border: 0;
  font: 600 18px/1.2 var(--sans);
  color: var(--brand-900);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.m-link svg { width: 20px; height: 20px; transition: transform .2s ease; }
.m-link[aria-expanded="true"] svg { transform: rotate(180deg); }
.m-sub { padding: 0 0 12px 12px; }
.m-sub[hidden] { display: none; }
.m-sub a {
  display: block;
  padding: 10px 0;
  color: var(--ink);
  text-decoration: none;
}
.mobile-menu .btn { width: 100%; margin-top: 24px; }
.mobile-contact { margin-top: 24px; font-size: 15px; color: var(--muted); }
.mobile-contact a { display: block; padding: 6px 0; font-weight: 600; text-decoration: none; }

body.menu-open { overflow: hidden; }

/* ---------- Hero ---------- */

.hero {
  background: var(--paper);
  padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 96px);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.2rem, 4.2vw, 3.5rem);
  max-width: 18ch;
}
.hero-lead {
  margin-top: 20px;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--muted);
  max-width: 52ch;
}

.search {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search:focus-within {
  border-color: var(--brand-700);
  box-shadow: 0 0 0 4px rgba(0, 87, 184, .15);
}
.search svg { width: 22px; height: 22px; color: var(--muted); flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: 400 17px/1.4 var(--sans);
  color: var(--ink);
  padding: 10px 4px;
}
.search input::placeholder { color: #7D8C89; }
.search .btn { min-height: 44px; padding: 10px 20px; }

.browse {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--muted);
}
.browse a {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--brand-900);
  text-decoration: none;
  font-weight: 500;
}
.browse a:hover { border-color: var(--brand-700); }

.hero-figure {
  position: relative;
  margin: 0;
}
.arch {
  aspect-ratio: 4 / 5;
  border-radius: 50% 50% 18px 18px / 40% 40% 18px 18px;
  overflow: hidden;
  background: var(--brand-100);
}
.arch img { width: 100%; height: 100%; object-fit: cover; }

.hero-badge {
  position: absolute;
  left: -28px;
  bottom: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: 0 16px 40px rgba(6, 30, 61, .16);
  max-width: 260px;
  font-size: 15px;
  line-height: 1.35;
}
.hero-badge strong { display: block; color: var(--brand-900); }
.hero-badge .icon-dot {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-700);
  display: grid; place-items: center;
}
.hero-badge .icon-dot svg { width: 22px; height: 22px; }

/* the one orchestrated load moment */
@keyframes archRise {
  from { clip-path: inset(100% 0 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
@keyframes badgeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.arch { animation: archRise .9s cubic-bezier(.2,.7,.2,1) both; }
.hero-badge { animation: badgeIn .5s .7s ease-out both; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { max-width: 420px; width: 100%; margin: 0 auto; }
  .hero-badge { left: 12px; bottom: 20px; }
}
@media (max-width: 480px) {
  .search { padding-left: 14px; }
  .search .btn span { display: none; }
  .search .btn { padding: 10px 14px; }
  .search .btn::after { content: "Go"; }
}

/* ---------- Generic section ---------- */

.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-alt { background: var(--paper); }

.section-head { max-width: 640px; margin-bottom: clamp(32px, 4vw, 48px); }
.section-head h2 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
.section-head p { margin-top: 14px; color: var(--muted); font-size: 1.08rem; }

/* ---------- Who we serve ---------- */

.serve {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.serve-item {
  border-top: 3px solid var(--brand-700);
  padding-top: 20px;
}
.serve-item h3 { font-size: 1.35rem; }
.serve-item p { margin-top: 10px; color: var(--muted); font-size: 16px; }
.serve-item a {
  display: inline-block;
  margin-top: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 0;
}
.serve-item a:hover { text-decoration: underline; }

@media (max-width: 960px) { .serve { grid-template-columns: repeat(2, 1fr); gap: 32px 24px; } }
@media (max-width: 560px) { .serve { grid-template-columns: 1fr; } }

/* ---------- Products ---------- */

.products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 48px;
  border-top: 1px solid var(--line);
}
.product {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.product-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-700);
  display: grid; place-items: center;
  transition: background-color .15s ease, color .15s ease;
}
.product-icon svg { width: 26px; height: 26px; }
.product h3 { font-size: 1.3rem; }
.product p { margin-top: 4px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.product-action {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-700);
  white-space: nowrap;
}
.product:hover .product-icon { background: var(--brand-700); color: var(--white); }
.product:hover h3 { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 860px) {
  .products { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .product { grid-template-columns: 48px 1fr; gap: 16px; padding: 20px 0; }
  .product-icon { width: 48px; height: 48px; }
  .product-action { grid-column: 2; margin-top: -8px; }
}

/* ---------- Services (dark band) ---------- */

.services {
  background: var(--brand-900);
  color: #D3DEEC;
}
.services h2, .services h3 { color: var(--white); }
.services .section-head p { color: #B4C3D8; }

.services-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.services-photo {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.services-photo img { width: 100%; height: 100%; object-fit: cover; }

.service-list { list-style: none; margin: 0; padding: 0; }
.service {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  padding: 24px 0;
  border-top: 1px solid rgba(255,255,255,.14);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.service:last-child { border-bottom: 1px solid rgba(255,255,255,.14); }
.service-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.35);
  color: #8DB8EC;
  display: grid; place-items: center;
}
.service-icon svg { width: 22px; height: 22px; }
.service h3 { font-size: 1.3rem; }
.service p { margin-top: 6px; color: #B4C3D8; }

@media (max-width: 860px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.about-photo { border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }

.about-copy h2 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
.about-copy > p { margin-top: 16px; color: var(--muted); font-size: 1.08rem; max-width: 56ch; }

.ceo {
  margin: 32px 0 0;
  padding: 0;
}
.ceo blockquote {
  margin: 0;
  font: 400 clamp(1.25rem, 2vw, 1.5rem)/1.5 var(--serif);
  color: var(--brand-900);
}
.ceo figcaption { margin-top: 14px; font-size: 15px; color: var(--muted); }
.ceo figcaption strong { color: var(--ink); }

.facts {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.fact strong {
  display: block;
  font: 600 1.9rem/1.1 var(--serif);
  color: var(--brand-700);
}
.fact span { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); line-height: 1.35; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { aspect-ratio: 16 / 10; }
}
@media (max-width: 480px) {
  .facts { grid-template-columns: repeat(2, 1fr); gap: 20px 16px; }
}

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.contact-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contact-card.primary { background: var(--brand-100); border-color: transparent; }
.contact-card h3 { font-size: 1.35rem; }
.contact-card p { color: var(--muted); }
.contact-card address { font-style: normal; color: var(--ink); line-height: 1.55; }
.contact-card .btn { margin-top: auto; align-self: flex-start; }
.contact-card .value {
  font-weight: 600;
  color: var(--brand-900);
  text-decoration: none;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--brand-950);
  color: #B4C3D8;
  padding: 64px 0 28px;
  font-size: 15px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}
.site-footer .logo { color: var(--white); }
.footer-about p { margin-top: 14px; max-width: 34ch; }
.social { display: flex; gap: 8px; margin-top: 20px; }
.social a {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #C9D6E8;
  border: 1px solid rgba(255,255,255,.18);
}
.social a:hover { background: rgba(255,255,255,.08); color: var(--white); }
.social svg { width: 20px; height: 20px; }

.site-footer h4 { color: var(--white); font: 600 16px/1.3 var(--sans); margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a {
  display: inline-block;
  padding: 5px 0;
  color: #B4C3D8;
  text-decoration: none;
}
.site-footer li a:hover { color: var(--white); text-decoration: underline; }

.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- Catalogue page ---------- */

.page-hero {
  background: var(--paper);
  padding: clamp(28px, 4vw, 48px) 0 clamp(36px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
}
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }
.page-hero h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); }
.page-hero p { margin-top: 12px; color: var(--muted); max-width: 60ch; font-size: 1.08rem; }

.catalogue {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: clamp(28px, 4vw, 56px);
  padding-top: clamp(32px, 5vw, 56px);
  padding-bottom: clamp(56px, 8vw, 96px);
  align-items: start;
}
.filters {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.filter-group + .filter-group { margin-top: 28px; }
.filter-label {
  display: block;
  font-weight: 600;
  color: var(--brand-900);
  margin-bottom: 10px;
  font-size: 15px;
}
.filters .search { margin-top: 0; padding: 4px 6px 4px 16px; max-width: none; }
.filters .search input { font-size: 16px; padding: 10px 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  font: 500 15px/1.2 var(--sans);
  color: var(--ink);
  cursor: pointer;
}
.chip:hover { border-color: var(--brand-700); }
.chip[aria-pressed="true"] { background: var(--brand-700); border-color: var(--brand-700); color: var(--white); }

.letters {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.letter {
  aspect-ratio: 1;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font: 600 14px/1 var(--sans);
  color: var(--ink);
  cursor: pointer;
}
.letter:hover:not(:disabled) { border-color: var(--brand-700); }
.letter[aria-pressed="true"] { background: var(--brand-700); border-color: var(--brand-700); color: var(--white); }
.letter:disabled { color: #B3BFBC; background: var(--paper); cursor: default; }

.clear-filters {
  margin-top: 20px;
  background: none;
  border: 0;
  padding: 8px 0;
  font: 600 15px/1.2 var(--sans);
  color: var(--brand-700);
  text-decoration: underline;
  cursor: pointer;
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.results-head h2 { font-size: 1.6rem; }
.results-count { color: var(--muted); font-size: 15px; }

.drug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.drug {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--white);
}
.drug h3 { font-size: 1.3rem; overflow-wrap: anywhere; }
.drug .tag {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-700);
}
.drug p { color: var(--muted); font-size: 15px; line-height: 1.5; flex: 1; }
.drug a {
  margin-top: 6px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  padding: 4px 0;
}
.drug a:hover { text-decoration: underline; }

.empty {
  grid-column: 1 / -1;
  padding: 40px 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.empty h3 { font-size: 1.4rem; }
.empty p { margin: 10px auto 20px; color: var(--muted); max-width: 46ch; }

.load-more-wrap { text-align: center; margin-top: 32px; }

@media (max-width: 860px) {
  .catalogue { grid-template-columns: 1fr; }
  .filters { position: static; }
  .filter-group + .filter-group { margin-top: 20px; }

  /* On phones the chips and letters become swipeable rows */
  .chips, .letters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    margin: 0 calc(var(--gutter) * -1);
    padding: 2px var(--gutter) 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .chips::-webkit-scrollbar, .letters::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .letter { flex: none; width: 42px; height: 42px; aspect-ratio: auto; }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* let grid children shrink so the swipeable rows scroll instead of widening the page */
.catalogue > * { min-width: 0; }

/* ---------- Chat widget ---------- */

.chat {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
}
@supports (bottom: env(safe-area-inset-bottom)) {
  .chat { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

.chat-fab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 22px 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--white);
  font: 600 16px/1 var(--sans);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(6, 30, 61, .28);
  transition: background-color .15s ease;
}
.chat-fab:hover { background: var(--accent-dark); }
.chat-fab svg { width: 24px; height: 24px; }
.chat.is-open .chat-fab { display: none; }

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(390px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 110px));
  height: min(600px, calc(100dvh - 110px));
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(6, 30, 61, .28);
  overflow: hidden;
}
.chat-panel[hidden] { display: none; }

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 14px 18px;
  background: var(--brand-900);
  color: var(--white);
}
.chat-head strong { display: block; font: 600 17px/1.2 var(--sans); }
.chat-head span { display: block; margin-top: 2px; font-size: 13px; color: #B4C3D8; }
.chat-close {
  flex: none;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: var(--white);
  display: grid; place-items: center;
  cursor: pointer;
}
.chat-close:hover { background: rgba(255,255,255,.22); }
.chat-close svg { width: 20px; height: 20px; }

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--paper);
  overscroll-behavior: contain;
}
.msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.msg p + p, .msg p + ul, .msg ul + p { margin-top: 8px; }
.msg ul { margin: 0; padding-left: 20px; }
.msg a { color: inherit; text-decoration: underline; }
.msg-bot { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-user { align-self: flex-end; background: var(--accent); color: var(--white); border-bottom-right-radius: 4px; }
.msg-error { background: #FFF4F2; border-color: #F0C9C2; }

.msg-typing { display: flex; gap: 5px; padding: 14px 16px; }
.msg-typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  animation: chatDot 1s infinite ease-in-out;
}
.msg-typing i:nth-child(2) { animation-delay: .15s; }
.msg-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chatDot { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.chat-starters { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 4px; }
.chat-starters button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--brand-500);
  border-radius: 999px;
  background: var(--white);
  color: var(--brand-700);
  font: 500 15px/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
}
.chat-starters button:hover { background: var(--brand-100); }

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.chat-form textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 10px 14px;
  font: 400 16px/1.4 var(--sans);   /* 16px stops iOS zooming on focus */
  color: var(--ink);
  max-height: 110px;
}
.chat-form textarea:focus { outline: 0; border-color: var(--brand-700); }
.chat-send {
  flex: none;
  width: 46px; height: 46px;
  border: 0; border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  display: grid; place-items: center;
  cursor: pointer;
}
.chat-send:hover:not(:disabled) { background: var(--accent-dark); }
.chat-send:disabled { opacity: .5; cursor: default; }
.chat-send svg { width: 20px; height: 20px; }

.chat-note {
  padding: 0 14px 12px;
  background: var(--white);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}
.chat-note a { color: var(--brand-700); }

@media (max-width: 520px) {
  .chat { right: 12px; left: 12px; bottom: 12px; }
  .chat-fab { margin-left: auto; display: flex; }
  .chat-panel {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
  }
  .chat-head { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .chat-note { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  body.chat-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .msg-typing i { animation: none; opacity: .6; }
}
