:root {
  --page: #f4f7f6;
  --surface: #ffffff;
  --text: #17211e;
  --soft: #53625d;
  --muted: #73807c;
  --line: #d8e0dd;
  --green: #13795b;
  --green-soft: #e2f3ec;
  --blue: #256b91;
  --blue-soft: #e5f1f7;
  --coral: #b65345;
  --coral-soft: #f8e9e6;
  --amber: #946718;
  --amber-soft: #f8f0d8;
  --shadow: 0 16px 42px rgba(20, 45, 36, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--page); color: var(--text); font-family: Inter, "Segoe UI", Arial, sans-serif; margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(19, 121, 91, 0.24); outline-offset: 2px; }

.app-header { align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; min-height: 72px; padding: 12px max(20px, calc((100vw - 1180px) / 2)); position: sticky; top: 0; z-index: 20; }
.brand { align-items: center; color: var(--text); display: flex; gap: 11px; min-width: 0; text-decoration: none; }
.brand-mark { align-items: center; background: var(--green); border-radius: 6px; color: white; display: inline-flex; flex: 0 0 38px; font-size: 13px; font-weight: 850; height: 38px; justify-content: center; }
.brand > span:last-child { display: grid; gap: 2px; min-width: 0; }
.brand strong { font-size: 14px; }
.brand small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.language-field { align-items: center; color: var(--muted); display: flex; font-size: 11px; gap: 8px; }
.language-field select { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; color: var(--text); min-height: 40px; padding: 0 32px 0 10px; }
html[dir="rtl"] .language-field select { padding: 0 10px 0 32px; }

.marketplace-hero { background-image: url("/marketplace/assets/wellness-marketplace.png"); background-position: center; background-size: cover; min-height: 330px; position: relative; }
.hero-shade { background: rgba(17, 31, 26, 0.62); inset: 0; position: absolute; }
.hero-content { color: white; margin: 0 auto; max-width: 1180px; padding: 90px 20px 54px; position: relative; }
.hero-content h1 { font-size: clamp(32px, 4vw, 48px); letter-spacing: 0; line-height: 1.08; margin: 8px 0 14px; max-width: 760px; }
.hero-content > p:last-child { font-size: 15px; line-height: 1.6; margin: 0; max-width: 650px; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 850; letter-spacing: 0; margin: 0 0 6px; text-transform: uppercase; }
.hero-content .eyebrow { color: #9ef0cf; }

.view-tabs { background: var(--surface); border-bottom: 1px solid var(--line); display: flex; gap: 4px; margin: 0 auto; max-width: 1180px; padding: 10px 20px; }
.view-tab { background: transparent; border: 0; border-bottom: 3px solid transparent; color: var(--soft); font-size: 13px; font-weight: 800; min-height: 44px; padding: 8px 16px; }
.view-tab.active { border-color: var(--green); color: var(--green); }

.view-section { margin: 0 auto; max-width: 1180px; padding: 34px 20px 60px; }
.view-section[hidden] { display: none; }
.section-heading { align-items: flex-start; display: flex; gap: 20px; justify-content: space-between; }
.section-heading h2 { font-size: 24px; letter-spacing: 0; margin: 0; }
.section-heading p:not(.eyebrow) { color: var(--soft); font-size: 13px; line-height: 1.55; margin: 8px 0 0; max-width: 680px; }
.icon-command { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; color: var(--text); display: inline-flex; flex: 0 0 42px; font-size: 22px; height: 42px; justify-content: center; padding: 0; }
.icon-command:hover { border-color: var(--green); color: var(--green); }
.load-status, .form-message { color: var(--muted); font-size: 12px; line-height: 1.5; min-height: 20px; }

.catalog-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalog-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; display: grid; grid-template-columns: 150px minmax(0, 1fr); min-height: 188px; overflow: hidden; }
.catalog-card img { height: 100%; object-fit: cover; width: 100%; }
.catalog-card-body { display: flex; flex-direction: column; min-width: 0; padding: 18px; }
.catalog-card h3 { font-size: 18px; letter-spacing: 0; margin: 0; overflow-wrap: anywhere; }
.catalog-card p { color: var(--soft); font-size: 12px; line-height: 1.55; margin: 8px 0 18px; overflow-wrap: anywhere; }
.catalog-card .secondary-command { margin-top: auto; align-self: flex-start; }

.primary-command, .secondary-command { border: 1px solid var(--green); border-radius: 6px; font-size: 12px; font-weight: 800; min-height: 42px; padding: 9px 14px; white-space: normal; }
.primary-command { background: var(--green); color: white; }
.primary-command:hover { background: #0e644a; }
.secondary-command { background: var(--surface); color: var(--green); }
.secondary-command:hover { background: var(--green-soft); }
.primary-command:disabled, .secondary-command:disabled { cursor: not-allowed; opacity: 0.52; }

.seller-access { align-items: center; background: var(--blue-soft); border-inline-start: 4px solid var(--blue); display: flex; gap: 18px; justify-content: space-between; margin-top: 22px; padding: 16px 18px; }
.seller-access strong { font-size: 14px; }
.seller-access p { color: var(--soft); font-size: 12px; line-height: 1.5; margin: 5px 0 0; }
.status-badge { background: var(--blue-soft); border: 1px solid rgba(37, 107, 145, 0.25); border-radius: 6px; color: var(--blue); flex: 0 0 auto; font-size: 10px; font-weight: 850; padding: 6px 8px; }
.status-badge.pending { background: var(--amber-soft); border-color: rgba(148, 103, 24, 0.25); color: var(--amber); }
.status-badge.approved { background: var(--green-soft); border-color: rgba(19, 121, 91, 0.25); color: var(--green); }
.status-badge.rejected, .status-badge.suspended { background: var(--coral-soft); border-color: rgba(182, 83, 69, 0.25); color: var(--coral); }
.seller-workspace { margin-top: 24px; }
.seller-toolbar { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 16px; justify-content: space-between; padding-bottom: 14px; }
.seller-toolbar h3 { font-size: 17px; margin: 0; }
.seller-toolbar p { margin: 5px 0 0; }
.product-list { display: grid; gap: 10px; margin-top: 14px; }
.product-row { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; }
.product-row h4 { font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.product-row p { color: var(--muted); font-size: 11px; margin: 5px 0 0; }
.product-row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.empty-state { border: 1px dashed var(--line); color: var(--muted); font-size: 13px; padding: 28px 18px; text-align: center; }

.product-form { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); margin-top: 18px; padding: 20px; }
.product-form[hidden] { display: none; }
.product-form > header { align-items: flex-start; border-bottom: 1px solid var(--line); display: flex; gap: 16px; justify-content: space-between; padding-bottom: 14px; }
.product-form h3 { font-size: 19px; margin: 0; }
.type-control { border: 0; display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0; padding: 0; }
.type-control legend { color: var(--muted); font-size: 11px; font-weight: 800; grid-column: 1 / -1; margin-bottom: 5px; }
.type-control label { cursor: pointer; min-width: 0; }
.type-control input { opacity: 0; pointer-events: none; position: absolute; }
.type-control span { align-items: center; border: 1px solid var(--line); border-radius: 6px; display: flex; font-size: 12px; font-weight: 750; justify-content: center; min-height: 44px; overflow-wrap: anywhere; padding: 8px; text-align: center; }
.type-control input:checked + span { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.type-control .disabled-option { cursor: not-allowed; opacity: 0.5; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label { color: var(--muted); display: grid; font-size: 11px; font-weight: 750; gap: 6px; min-width: 0; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; color: var(--text); min-height: 44px; min-width: 0; padding: 9px 11px; resize: vertical; width: 100%; }
.product-form > footer { display: flex; gap: 10px; justify-content: flex-end; }

.catalog-dialog { background: transparent; border: 0; color: var(--text); max-height: calc(100vh - 24px); max-width: 720px; padding: 0; width: calc(100% - 24px); }
.catalog-dialog::backdrop { background: rgba(14, 24, 21, 0.7); }
.catalog-dialog article { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: calc(100vh - 24px); overflow: auto; padding: 22px; }
.catalog-dialog header { align-items: flex-start; display: flex; gap: 16px; justify-content: space-between; }
.catalog-dialog h2 { font-size: 24px; letter-spacing: 0; margin: 0; }
.catalog-dialog h3 { font-size: 14px; margin: 22px 0 10px; }
.catalog-purpose, .pricing-note { color: var(--soft); font-size: 13px; line-height: 1.6; }
.module-list { border-top: 1px solid var(--line); }
.module-row { border-bottom: 1px solid var(--line); padding: 12px 2px; }
.module-row strong { font-size: 13px; }
.module-row p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 4px 0 0; }
.bundle-control { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bundle-button { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; color: var(--soft); display: grid; gap: 4px; min-height: 68px; padding: 10px; text-align: start; }
.bundle-button strong { color: var(--text); font-size: 12px; }
.bundle-button span { font-size: 10px; }
.bundle-button.selected { background: var(--green-soft); border-color: var(--green); }
.pricing-note { background: var(--amber-soft); border-inline-start: 3px solid var(--amber); padding: 10px 12px; }
.catalog-dialog footer { display: flex; justify-content: flex-end; margin-top: 18px; }

@media (max-width: 800px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .catalog-card { grid-template-columns: 130px minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .app-header { align-items: stretch; flex-direction: column; gap: 10px; padding: 10px 14px; position: static; }
  .language-field { align-items: stretch; flex-direction: column; gap: 4px; }
  .language-field select { width: 100%; }
  .marketplace-hero { min-height: 300px; }
  .hero-content { padding: 68px 16px 40px; }
  .hero-content h1 { font-size: 31px; overflow-wrap: anywhere; }
  .view-tabs { overflow-x: auto; padding: 8px 12px; }
  .view-tab { flex: 1 1 0; min-width: 0; padding-inline: 6px; overflow-wrap: anywhere; }
  .view-section { padding: 26px 14px 44px; }
  .section-heading, .seller-access, .seller-toolbar { align-items: stretch; display: grid; }
  .section-heading h2 { font-size: 21px; overflow-wrap: anywhere; }
  .icon-command, .status-badge { justify-self: start; }
  .catalog-card { grid-template-columns: 1fr; }
  .catalog-card img { aspect-ratio: 16 / 7; height: auto; }
  .type-control, .form-grid, .bundle-control { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .product-row { grid-template-columns: 1fr; }
  .product-row-actions { justify-content: stretch; }
  .product-row-actions button { flex: 1 1 130px; }
  .product-form { padding: 16px; }
  .product-form > footer { display: grid; grid-template-columns: 1fr 1fr; }
  .catalog-dialog article { padding: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

