:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #183128;
  background: #f5f8f5;
  font-synthesis: none;
  --green: #187447;
  --green-dark: #105b36;
  --green-soft: #e9f5ed;
  --border: #dce8df;
  --muted: #61786b;
  --danger: #8a2525;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: #f5f8f5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 10px clamp(16px, 4vw, 56px);
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid #dfe9e1;
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  min-width: 220px;
}
.brand img {
  display: block;
  width: clamp(210px, 24vw, 330px);
  height: auto;
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
}
.header-tools { display: flex; align-items: center; gap: 22px; }
nav { display: flex; align-items: center; gap: 18px; }
nav a { text-decoration: none; font-weight: 750; font-size: 14px; }
nav a:hover, .footer-links a:hover { color: var(--green); }
.language-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}
.language-control select {
  width: auto;
  min-width: 130px;
  padding: 8px 34px 8px 10px;
}

main { min-height: calc(100vh - 180px); }
footer {
  padding: 30px 18px;
  text-align: center;
  color: #6b7f74;
  font-size: 13px;
  border-top: 1px solid #e1ebe4;
  background: #fff;
}
footer p { margin: 6px 0; }
.footer-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.footer-links a { font-weight: 700; }

.hero {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 68px 20px;
  background:
    radial-gradient(circle at top right, #dff3e6, transparent 42%),
    radial-gradient(circle at bottom left, #eef9d8, transparent 36%),
    linear-gradient(160deg, #f8fbf8, #edf5ef);
}
.hero-inner { max-width: 900px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  color: var(--green);
  font-weight: 850;
}
h1 { font-size: clamp(37px, 7vw, 68px); line-height: 1.03; margin: 12px 0 18px; }
h2 { margin: 0 0 12px; font-size: clamp(27px, 4vw, 39px); }
h3 { margin: 10px 0 8px; }
p { line-height: 1.6; }
.lead { font-size: clamp(17px, 2.5vw, 22px); color: #536b5e; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }

.button, button {
  border: 0;
  border-radius: 10px;
  padding: 13px 18px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover, button:hover { transform: translateY(-1px); }
.primary { background: var(--green); color: #fff; box-shadow: 0 8px 18px rgba(24,116,71,.16); }
.primary:hover { background: var(--green-dark); }
.secondary { background: #fff; color: var(--green); border: 1px solid #b9d1c1; }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.page { width: min(1120px, calc(100% - 28px)); margin: 36px auto; }
.narrow { width: min(680px, calc(100% - 28px)); margin: 36px auto; }
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(18px, 4vw, 34px);
  box-shadow: 0 8px 30px rgba(27,73,49,.06);
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-stack { display: grid; gap: 18px; }
label { display: flex; flex-direction: column; gap: 7px; font-weight: 750; font-size: 14px; }
input, select, textarea {
  width: 100%;
  border: 1px solid #bfd0c4;
  border-radius: 9px;
  padding: 12px;
  background: #fff;
  color: #183128;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(24,116,71,.11); }
textarea { resize: vertical; min-height: 130px; }
.full { grid-column: 1 / -1; }
.help { margin: 3px 0 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.inline-grid { display: grid; grid-template-columns: minmax(150px,.65fr) minmax(180px,1.35fr); gap: 10px; }
.check { flex-direction: row; align-items: flex-start; gap: 9px; font-weight: 550; }
.check input { width: auto; margin-top: 4px; }
.check a { color: var(--green); font-weight: 800; }
.status { margin-top: 4px; padding: 12px 14px; border-radius: 9px; background: #edf6ef; line-height: 1.45; }
.status.error { background: #fff0f0; color: var(--danger); border: 1px solid #f1cccc; }
.status.success { background: #eaf8ef; color: #125c36; border: 1px solid #c8e8d2; }
.muted { color: #6a7f73; }

.product-heading { margin: 4px 0; font-weight: 850; }
.product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px 14px;
  margin-top: 10px;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfdfb;
}
.product-group { grid-column: 1 / -1; margin-top: 8px; padding-top: 10px; border-top: 1px solid #e3ece5; font-weight: 850; color: var(--green-dark); }
.product-group:first-child { border-top: 0; margin-top: 0; padding-top: 0; }

.tabs { display: flex; gap: 8px; margin: 20px 0; flex-wrap: wrap; }
.tabs button { background: #fff; color: var(--green); border: 1px solid #b9d1c1; }
.tabs button.active { background: var(--green); color: #fff; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; }
.cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top: 20px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.card h3 { font-size: 22px; }
.meta { color: var(--muted); font-size: 14px; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; background: var(--green-soft); color: #17663f; font-size: 12px; font-weight: 850; text-transform: capitalize; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin: 20px 0; }
.stat { padding: 18px; border-radius: 12px; background: #f2f7f3; }
.stat strong { display: block; font-size: 28px; }

.legal { max-width: 900px; }
.legal .panel > p:first-of-type { color: var(--muted); }
.legal-section { margin-top: 26px; }
.legal-section h3 { color: var(--green-dark); }

.loading-shell { text-align: center; padding: 50px 20px; }
.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 14px;
  border: 4px solid #dfece3;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

[dir="rtl"] .brand img { object-position: right center; }
[dir="rtl"] .check { text-align: right; }
[dir="rtl"] .brand { justify-content: flex-end; }

@media (max-width: 920px) {
  .site-header { align-items: flex-start; }
  .header-tools { flex-direction: column-reverse; align-items: flex-end; gap: 9px; }
  .language-control span { display: none; }
  .brand img { width: 230px; }
}

@media (max-width: 760px) {
  .site-header { padding: 9px 13px; gap: 8px; align-items: center; }
  .brand { min-width: 0; }
  .brand img { width: 176px; max-height: 48px; }
  .header-tools { gap: 6px; }
  nav { gap: 10px; }
  nav a { font-size: 12px; }
  .language-control select { min-width: 105px; max-width: 120px; padding: 7px 28px 7px 8px; font-size: 12px; }
  .form-grid, .cards, .dashboard-grid, .product-list { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .full, .product-group { grid-column: auto; }
  .inline-grid { grid-template-columns: 1fr 1.2fr; }
  .hero { min-height: 66vh; padding-top: 50px; }
}

@media (max-width: 470px) {
  .site-header { flex-wrap: wrap; }
  .brand img { width: 190px; }
  .header-tools { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
  nav { order: 1; }
  .language-control { order: 2; }
  .inline-grid { grid-template-columns: 1fr; }
}

/* Member profile and product editor */
.dashboard-summary { margin-bottom: 20px; }
.editor-heading { margin-top: 12px; }
.editor-product-groups { display: grid; gap: 20px; }
.editor-category { border-top: 1px solid var(--border); padding-top: 18px; }
.editor-category h4 { margin-bottom: 12px; color: var(--green-dark); font-size: 19px; }
.editor-products { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.product-editor-card { border: 1px solid var(--border); border-radius: 12px; background: #fbfdfb; padding: 14px; }
.product-select { margin: 0; }
.product-details { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.hidden { display: none !important; }
.compact-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.compact-grid label { font-size: 13px; }
.compact-grid input, .compact-grid select, .compact-grid textarea { margin-top: 5px; }
.current-photo { display:flex; align-items:center; gap:12px; padding:10px; border:1px solid var(--border); border-radius:12px; max-width:440px; }
.current-photo img { width:74px; height:74px; object-fit:cover; border-radius:10px; }
.publish-check { padding: 14px; background: var(--green-soft); border-radius: 12px; }
@media (max-width: 760px) {
  .editor-products, .compact-grid { grid-template-columns: 1fr; }
}

/* Final product catalog */
.directory-lead { max-width: 850px; }
.catalog-filters { display:grid; grid-template-columns: 2fr 1.15fr 1.15fr 1fr 1.15fr 1.25fr auto; gap:12px; align-items:end; }
.product-catalog { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin-top:20px; }
.product-card { overflow:hidden; background:#fff; border:1px solid var(--border); border-radius:15px; box-shadow:0 8px 24px rgba(20,72,45,.06); }
.product-card-image { aspect-ratio:16/10; background:#edf5ef; overflow:hidden; }
.product-card-image img { width:100%; height:100%; object-fit:cover; display:block; }
.image-placeholder { width:100%; height:100%; display:grid; place-items:center; font-size:56px; font-weight:900; color:#3e7d5c; background:linear-gradient(135deg,#eaf5ed,#f7fbf8); }
.product-card-body { padding:17px; }
.product-card-body h3 { margin:9px 0 4px; font-size:24px; }
.supplier-name { margin:0; font-weight:800; color:var(--green-dark); }
.listing-details { margin-top:13px; padding-top:10px; border-top:1px solid var(--border); }
.listing-details p { margin:6px 0; font-size:14px; }
.product-notes { margin-top:12px; color:#40584b; }
.empty-catalog { grid-column:1/-1; text-align:center; }
.optional { color:var(--muted); font-size:12px; font-weight:500; }
@media (max-width:1100px) { .catalog-filters { grid-template-columns:repeat(3,minmax(0,1fr)); } .product-catalog { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:760px) { .catalog-filters,.product-catalog { grid-template-columns:1fr; } }
