/*
 * Clinic Search Plugin — Frontend Styles
 * Scoped entirely under #clinic-search-app to avoid WP theme conflicts.
 * No Tailwind CDN dependency — all utilities written here.
 *
 * Color palette:
 *   Teal accent  : #0d9488
 *   Teal hover   : #0f766e
 *   Teal light   : #f0fdfa
 *   Slate text   : #0f172a, #334155, #64748b, #94a3b8
 *   Border       : #e2e8f0
 *   White        : #ffffff
 */

/* ── Reset (scoped) ──────────────────────────────────────────────────────── */
#clinic-search-app *,
#clinic-search-app *::before,
#clinic-search-app *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#clinic-search-app {
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
  /* v1.0.3 — overflow-x:clip removed. Hero no longer escapes via 100vw
     hack so there's nothing to guard against. The app now mounts directly
     inside <main id="main"> (no .nk-container wrapper), so its width is
     governed naturally by the parent. */
  /* Breathing room between the last clinic card / pagination and the
     footer below. Tightens on mobile to preserve vertical density. */
  padding-bottom: 96px;
}

@media (max-width: 768px) {
  #clinic-search-app {
    padding-bottom: 64px;
  }
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
/* Default hero: teal/cyan gradient (used when no admin BG is configured).
   When an admin uploads a hero image, JSX adds .cs-hero--bg-image and an
   inline style="background-image:url(...)" — those overrides come below.

   v1.0.3 — ARCHITECTURAL FULL-BLEED. The theme's .nk-container wrapper has
   been removed from archive-clinic.php, so #clinic-search-app now mounts
   directly inside <main id="main"> (full viewport width). The hero is a
   sibling of .cs-content (which carries the 1120px max-width), letting
   it stretch edge-to-edge without any 100vw / negative-margin trickery.
   No CSS escape required — the structure handles it. */
#clinic-search-app .cs-hero {
  position: relative;
  /* Layered radial gradients on a deep teal base — soft aurora glow without
     pseudo-elements. Order: top-most first, base color last. */
  background:
    radial-gradient(ellipse at 20% 50%, #00c6c6 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, #1a6b8a 0%, transparent 60%),
    radial-gradient(ellipse at 60% 80%, #00897b 0%, transparent 50%),
    #0d3d4a;
  color: #ffffff;
  /* Roomier vertical padding now that the hero spans the full viewport. */
  padding: 80px 32px;
  margin: 0 0 48px 0;     /* flush against sticky nav above; 48px below */
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

/* Inner wrapper stays within the readable content width so headlines /
   subheads don't sprawl edge-to-edge on wide monitors. */
#clinic-search-app .cs-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Hero with admin-provided background image.
   We keep the gradient as a `background-color` fallback (in case the image
   404s) and layer a dark gradient overlay via ::before so white headings stay
   readable on bright photos. The image URL is set inline by React. */
#clinic-search-app .cs-hero--bg-image {
  background-color: #0d9488;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* When admin sets a BG image, layer a dark gradient overlay over the photo
   so white headlines stay readable on bright images. */
#clinic-search-app .cs-hero--bg-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(13, 148, 136, 0.55) 0%,
    rgba(15, 23, 42, 0.65) 100%
  );
  z-index: 1;
  pointer-events: none;
}

#clinic-search-app .cs-hero__title {
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

#clinic-search-app .cs-hero__subtitle {
  font-size: 16px;
  opacity: 0.92;
}

/* ── Content wrapper (v1.0.3) ────────────────────────────────────────────── */
/* Constrains the post-hero content (results bar, sidebar+grid, pagination)
   to a comfortable reading width and centers it. The hero deliberately sits
   OUTSIDE this wrapper so it can run full-bleed without any CSS hacks. */
#clinic-search-app .cs-content {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 768px) {
  #clinic-search-app .cs-content {
    padding: 0 20px;
  }
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
#clinic-search-app .cs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 768px) {
  #clinic-search-app .cs-layout {
    grid-template-columns: 1fr;
  }

  /* Mobile hero: tighter vertical rhythm. */
  #clinic-search-app .cs-hero {
    padding: 56px 20px;
    margin-bottom: 32px;
  }

  #clinic-search-app .cs-hero__inner {
    padding: 0 12px;
  }

  #clinic-search-app .cs-hero__title {
    font-size: 22px;
  }
}

/* ── Sidebar / Filters (v1.0.4 — old-theme redesign) ────────────────────── */
/* Card wrapper: white, rounded 16px, generous padding, sticky on desktop.
   Internal sections separated by 20px gap (display:flex column). The whole
   thing matches the original NK Medic theme's sidebar look that Touch
   preferred over the previous teal-accented version. */
#clinic-search-app .cs-filters {
  background: transparent;
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#clinic-search-app .cs-filter-group {
  display: flex;
  flex-direction: column;
}

/* Section label — small, semibold, slate. Optional hint span sits inline
   (e.g. "ค้นหาจากผลิตภัณฑ์ (เลือกได้มากกว่า 1):"). */
#clinic-search-app .cs-filters__section-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 10px;
}

#clinic-search-app .cs-filters__section-hint {
  font-size: 13px;
  font-weight: 400;
  color: #64748b;
  margin-left: 4px;
}

/* ── Search input (pill, icon-right) ─────────────────────────────────────── */
#clinic-search-app .cs-search-input-wrap {
  position: relative;
}

#clinic-search-app .cs-search-input {
  width: 100%;
  padding: 14px 48px 14px 20px;     /* extra right space for the search icon */
  border: 1px solid #e2e8f0;
  border-radius: 999px;             /* pill */
  font-size: 15px;
  color: #0f172a;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

#clinic-search-app .cs-search-input:focus {
  outline: none;
  border-color: #2563EB;            /* NK Medic blue */
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#clinic-search-app .cs-search-input::placeholder {
  color: #94a3b8;
}

/* Remove WebKit's default search cancel button so the layout stays clean. */
#clinic-search-app .cs-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

#clinic-search-app .cs-search-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  display: flex;
}

/* ── Select dropdowns (pill) ─────────────────────────────────────────────── */
#clinic-search-app .cs-select {
  width: 100%;
  padding: 12px 40px 12px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;             /* pill */
  font-size: 15px;
  color: #0f172a;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2394a3b8' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center;
  background-size: 14px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#clinic-search-app .cs-select:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#clinic-search-app .cs-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Products: colored radio rows ────────────────────────────────────────── */
/* Each product is a row: [colored circle] [name]. Border color of the circle
   is hashed from the product name via colorFromName() so Bienox/Fillstim/
   Volifil etc. always have their own consistent color across reloads.
   When checked, the circle fills with the same color and shows a white check.
   The native checkbox is visually hidden but keeps semantics + keyboard nav. */
#clinic-search-app .cs-product-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#clinic-search-app .cs-product-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}

#clinic-search-app .cs-product-option:hover {
  background: #f8fafc;
}

/* Visually-hidden but accessible (focus + screen readers still work). */
#clinic-search-app .cs-product-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#clinic-search-app .cs-product-radio {
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;   /* overridden inline by React */
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
  background-color: transparent;
}

/* Keyboard focus ring on the visually-hidden input → render around the radio. */
#clinic-search-app .cs-product-input:focus-visible + .cs-product-radio {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

#clinic-search-app .cs-product-option:hover .cs-product-radio {
  transform: scale(1.05);
}

/* Checked state — color/bg are set inline by React (deterministic per product),
   this rule just adds a soft elevation so the filled circle reads as "active". */
#clinic-search-app .cs-product-radio--checked {
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

#clinic-search-app .cs-product-label {
  font-size: 15px;
  font-weight: 400;
  color: #1e293b;
  line-height: 1.4;
}

#clinic-search-app .cs-product-option--checked .cs-product-label {
  font-weight: 500;
}

/* ── Geolocation: big blue pill ──────────────────────────────────────────── */
#clinic-search-app .cs-geo-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border: none;
  border-radius: 999px;
  background: #2563EB;              /* NK Medic blue */
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;              /* keep label on one line */
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

#clinic-search-app .cs-geo-icon svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#clinic-search-app .cs-geo-btn:hover:not(:disabled) {
  background: #1D4ED8;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

#clinic-search-app .cs-geo-btn:active:not(:disabled) {
  transform: translateY(1px);
}

#clinic-search-app .cs-geo-btn--active {
  background: #1E40AF;              /* slightly deeper to communicate "on" */
}

#clinic-search-app .cs-geo-btn--active:hover {
  background: #1E3A8A;
}

#clinic-search-app .cs-geo-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

#clinic-search-app .cs-geo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#clinic-search-app .cs-geo-btn__spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: cs-spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* HTTPS / GPS hint — subtle gray, NOT a red error. Sits below the geo button. */
#clinic-search-app .cs-geo-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 8px;
  text-align: center;
  line-height: 1.5;
}

/* Generic filter hint — sits under a select to nudge the user (e.g. "เลือก
   ภูมิภาคก่อนเพื่อกรองจังหวัด"). Same muted treatment as cs-geo-hint, but
   left-aligned to track the dropdown above it. */
#clinic-search-app .cs-filter-hint {
  font-size: 12px;
  color: #94a3b8;
  margin: 6px 4px 0;
  line-height: 1.5;
}

/* ── Clear filters: outline pill ─────────────────────────────────────────── */
#clinic-search-app .cs-clear-btn-pill {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

#clinic-search-app .cs-clear-btn-pill:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #1e293b;
}

/* ── Results bar ─────────────────────────────────────────────────────────── */
#clinic-search-app .cs-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  min-height: 28px;
}

#clinic-search-app .cs-results-bar__count {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

#clinic-search-app .cs-results-bar__error {
  font-size: 14px;
  color: #ef4444;
}

#clinic-search-app .cs-clear-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

#clinic-search-app .cs-clear-btn:hover {
  border-color: #0d9488;
  color: #0d9488;
}

/* ── Clinic grid ─────────────────────────────────────────────────────────── */
#clinic-search-app .cs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

@media (max-width: 1024px) {
  #clinic-search-app .cs-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 480px) {
  #clinic-search-app .cs-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Clinic card ─────────────────────────────────────────────────────────── */
#clinic-search-app .cs-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  cursor: default;
}

#clinic-search-app .cs-card:hover {
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
  border-color: #ccfbf1;
}

/* ── Card header ──────────────────────────────────────────────────────────── */
/* v1.0.2: header is now a 2-column flex (avatar/logo + text stack). */
#clinic-search-app .cs-card__header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
}

#clinic-search-app .cs-card__header-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0; /* let long names wrap inside flex */
  flex: 1;
}

#clinic-search-app .cs-card__name {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  word-break: break-word;
}

#clinic-search-app .cs-card__location-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Clinic logo / avatar fallback (v1.0.2) ──────────────────────────────── */
/* Shared box dimensions so swapping <img> for <div> keeps the layout stable. */
#clinic-search-app .cs-clinic-logo,
#clinic-search-app .cs-avatar-fallback {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* Real uploaded logo image */
#clinic-search-app .cs-clinic-logo {
  background: #ffffff;
  object-fit: cover;
  border: 1px solid #e2e8f0;
}

/* Random-color avatar fallback (background-color is set inline via React,
   hashed from clinic name in src/utils/colorHash.js). */
#clinic-search-app .cs-avatar-fallback {
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  /* subtle inner edge so the circle reads as a deliberate UI element rather
     than a random colored blob */
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 1px 2px rgba(15, 23, 42, 0.08);
}

/* ── Location badges ──────────────────────────────────────────────────────── */
#clinic-search-app .cs-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

#clinic-search-app .cs-badge--province {
  background: #f0fdfa;
  color: #0d9488;
  border: 1px solid #ccfbf1;
}

#clinic-search-app .cs-badge--region {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* ── Card address ─────────────────────────────────────────────────────────── */
#clinic-search-app .cs-card__address {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

#clinic-search-app .cs-card__icon {
  flex-shrink: 0;
  margin-top: 3px;
  color: #94a3b8;
  display: flex;
}

#clinic-search-app .cs-card__address-text {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

/* ── Card products (v1.0.2: horizontal colored chips) ───────────────────── */
/* Each product is a pill with a deterministic background color hashed from
   its name (palette of 8 — see src/utils/colorHash.js). White text +
   subtle inner ring for elevation. Replaces the old vertical list. */
#clinic-search-app .cs-card__products-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

#clinic-search-app .cs-card__products-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

#clinic-search-app .cs-product-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: #ffffff;
  letter-spacing: 0.01em;
  white-space: nowrap;
  /* subtle elevation + inner ring for crisp edge on light/medium palette
     colors. Background-color comes from inline style (deterministic hash). */
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

/* ── Stock status badges ──────────────────────────────────────────────────── */
#clinic-search-app .cs-stock {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

#clinic-search-app .cs-stock--available {
  background: #dcfce7;
  color: #15803d;
}

#clinic-search-app .cs-stock--limited {
  background: #fef9c3;
  color: #a16207;
}

#clinic-search-app .cs-stock--out {
  background: #fee2e2;
  color: #b91c1c;
}

/* ── Card action buttons ──────────────────────────────────────────────────── */
#clinic-search-app .cs-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px solid #f1f5f9;
}

#clinic-search-app .cs-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

#clinic-search-app .cs-action-btn--phone {
  background: #f0fdfa;
  color: #0d9488;
  border-color: #ccfbf1;
}

#clinic-search-app .cs-action-btn--phone:hover {
  background: #0d9488;
  color: #ffffff;
  border-color: #0d9488;
}

#clinic-search-app .cs-action-btn--line {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}

#clinic-search-app .cs-action-btn--line:hover {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

#clinic-search-app .cs-action-btn--maps {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

#clinic-search-app .cs-action-btn--maps:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* ── Skeleton loading ────────────────────────────────────────────────────── */
#clinic-search-app .cs-card--skeleton {
  cursor: default;
  pointer-events: none;
}

#clinic-search-app .cs-card--skeleton:hover {
  box-shadow: none;
  transform: none;
  border-color: #e2e8f0;
}

@keyframes cs-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

#clinic-search-app .cs-skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e9eef4 50%, #f1f5f9 75%);
  background-size: 800px 100%;
  animation: cs-shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

#clinic-search-app .cs-skeleton--title {
  height: 20px;
  width: 70%;
  margin-bottom: 10px;
}

#clinic-search-app .cs-skeleton--line {
  height: 14px;
  width: 90%;
  margin-bottom: 8px;
}

#clinic-search-app .cs-skeleton--short {
  width: 55%;
}

#clinic-search-app .cs-skeleton--badges {
  height: 22px;
  width: 40%;
  border-radius: 20px;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
#clinic-search-app .cs-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

#clinic-search-app .cs-empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  margin: 0 auto 16px;
}

#clinic-search-app .cs-empty-state__title {
  font-size: 18px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 8px;
}

#clinic-search-app .cs-empty-state__desc {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 20px;
}

/* ── Error state ─────────────────────────────────────────────────────────── */
#clinic-search-app .cs-error-state {
  text-align: center;
  padding: 48px 20px;
  color: #ef4444;
}

#clinic-search-app .cs-error-state p {
  margin-bottom: 16px;
}

/* ── Generic buttons ─────────────────────────────────────────────────────── */
#clinic-search-app .cs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border: 1.5px solid transparent;
}

#clinic-search-app .cs-btn--teal {
  background: #0d9488;
  color: #ffffff;
  border-color: #0d9488;
}

#clinic-search-app .cs-btn--teal:hover {
  background: #0f766e;
  border-color: #0f766e;
}

#clinic-search-app .cs-btn--outline {
  background: transparent;
  color: #64748b;
  border-color: #e2e8f0;
}

#clinic-search-app .cs-btn--outline:hover {
  border-color: #0d9488;
  color: #0d9488;
}

#clinic-search-app .cs-btn--full {
  width: 100%;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
#clinic-search-app .cs-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}

#clinic-search-app .cs-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

#clinic-search-app .cs-page-btn:hover:not(:disabled) {
  border-color: #0d9488;
  color: #0d9488;
  background: #f0fdfa;
}

#clinic-search-app .cs-page-btn--active {
  background: #0d9488;
  border-color: #0d9488;
  color: #ffffff;
  font-weight: 700;
}

#clinic-search-app .cs-page-btn--active:hover {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}

#clinic-search-app .cs-page-btn--nav {
  color: #94a3b8;
}

#clinic-search-app .cs-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#clinic-search-app .cs-page-ellipsis {
  color: #94a3b8;
  font-size: 14px;
  width: 24px;
  text-align: center;
  line-height: 36px;
}

/* ── Mobile layout adjustments ───────────────────────────────────────────── */
@media (max-width: 768px) {
  #clinic-search-app .cs-filters {
    position: static;
  }

  #clinic-search-app .cs-card__actions {
    gap: 6px;
  }

  #clinic-search-app .cs-action-btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  #clinic-search-app .cs-pagination {
    gap: 4px;
  }

  #clinic-search-app .cs-page-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
}

/* ── Spinner keyframe (shared by .cs-geo-btn__spinner) ───────────────────── */
@keyframes cs-spin {
  to { transform: rotate(360deg); }
}

/* ── Distance badge ──────────────────────────────────────────────────────── */
#clinic-search-app .cs-badge--distance {
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fef08a;
}
