/* Опт: страница условий, вход/регистрация, кабинет, печатный договор.
   Язык тот же, что у карточки товара по макету: Inter в заголовках, оранжевая пилюля — главное действие, тонкие линии. */
.opt,
.opt-doc,
.opt-doc-bar,
.opt-modal {
  --ink: #333;
  --text: #555;
  --muted: #8a8a8a;
  --hair: #e3e3e3;
  --well: #f5f5f5;
  --accent: #ff7e29;
  --accent-press: #f26b12;
  --green: #5f9a2e;
  --red: #c62828;
  --head-font: "Inter", "Montserrat", Arial, sans-serif;
}
.opt {
  color: var(--text);
  padding-bottom: 104px;
}
.opt *,
.opt *::before,
.opt *::after,
.opt-modal *,
.opt-modal *::before,
.opt-modal *::after {
  box-sizing: border-box;
}
.opt :focus-visible,
.opt-modal :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.opt a {
  color: var(--ink);
}
.opt-top {
  padding-top: 56px;
  margin-bottom: 40px;
}
.opt .opt-top h1 {
  margin: 0;
  font: 600 clamp(28px, 2.5vw, 48px) / 1.15 var(--head-font) !important;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.opt h2,
.opt-modal h2 {
  margin: 0;
  font: 600 22px/1.25 var(--head-font) !important;
  color: var(--ink);
}
.opt-muted {
  color: var(--muted);
}
.opt-small {
  font-size: 12px;
  line-height: 1.5;
}
.opt-error {
  margin: 0;
  font-size: 13px;
  color: var(--red);
}
.opt-ok {
  margin: 0;
  font-size: 13px;
  color: var(--green);
}

/* кнопки */
.opt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 28px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  font: 600 15px/1 "Montserrat", Arial, sans-serif;
  color: #fff !important;
  text-decoration: none !important;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.opt-btn:hover {
  background: var(--accent-press);
  border-color: var(--accent-press);
}
.opt-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.opt-btn--line {
  background: #fff;
  color: var(--accent) !important;
}
.opt-btn--line:hover {
  background: var(--accent);
  color: #fff !important;
}
.opt-link {
  padding: 0;
  border: 0;
  background: none;
  font: 600 14px/1.4 "Montserrat", Arial, sans-serif;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.opt-link:hover {
  color: var(--accent);
}

/* страница условий */
.opt-landing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 96px;
  align-items: start;
}
.opt-lead {
  margin: 0 0 32px;
  max-width: 640px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
}
.opt-terms {
  margin: 0 0 56px;
  border-top: 1px solid var(--hair);
}
.opt-terms div {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 15px;
}
.opt-terms dt {
  font-weight: 400;
  color: var(--muted);
}
.opt-terms dd {
  margin: 0;
  color: var(--ink);
}
.opt-steps {
  list-style: none;
  counter-reset: s;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 40px;
  margin: 24px 0 40px;
  padding: 0;
}
.opt-steps li {
  counter-increment: s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0 0 0 44px;
  position: relative;
  font-size: 14px;
  line-height: 1.55;
}
.opt-steps li::before {
  content: counter(s) !important;
  position: absolute;
  left: 0;
  top: -2px;
  width: 28px;
  height: 28px;
  display: grid !important;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: none !important;
  font: 600 13px/1 var(--head-font);
  color: var(--accent);
}
.opt-steps b {
  font-size: 15px;
  color: var(--ink);
}

/* вход и регистрация */
.opt-landing__auth {
  position: sticky;
  top: 112px;
}
.opt-auth {
  padding: 32px;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: #fff;
}
.opt-auth--loading {
  min-height: 420px;
}
.opt-auth h2 {
  margin-bottom: 8px;
}
.opt-auth .opt-btn {
  margin-top: 20px;
}
.opt-tabs {
  display: flex;
  gap: 28px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--hair);
}
.opt-tabs button {
  position: relative;
  padding: 0 0 14px;
  border: 0;
  background: none;
  font: 600 15px/1 "Montserrat", Arial, sans-serif;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s;
}
.opt-tabs button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.opt-tabs button.is-active,
.opt-tabs button:hover:not(:disabled) {
  color: var(--ink);
}
.opt-tabs button.is-active::after {
  transform: none;
}
.opt-tabs button:disabled {
  opacity: 0.4;
  cursor: default;
}

.opt-form,
.opt-modal .opt-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.opt-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.opt-form input:not([type="checkbox"]),
.opt-form textarea,
.opt-search {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #d6d6d6;
  border-radius: 4px;
  background: #fff;
  font: 500 15px/1.4 "Montserrat", Arial, sans-serif;
  color: var(--ink);
  transition: border-color 0.2s;
}
.opt-form textarea {
  resize: vertical;
}
.opt-form input:hover,
.opt-form textarea:hover,
.opt-search:hover {
  border-color: #aaa;
}
.opt-form input:focus,
.opt-form textarea:focus,
.opt-search:focus {
  outline: none;
  border-color: var(--accent);
}
.opt-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.opt-check {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px !important;
  font-size: 12px !important;
  line-height: 1.5;
  cursor: pointer;
}
.opt-check input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  flex: none;
  accent-color: var(--accent);
}
.opt-check a {
  color: inherit !important;
  text-decoration: underline;
}
.opt-party {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: -6px;
  padding: 12px 14px;
  border-radius: 4px;
  background: var(--well);
  font-size: 13px;
  line-height: 1.45;
}
.opt-party b {
  color: var(--ink);
}

/* кабинет */
.opt-cab--loading {
  min-height: 60vh;
}
.opt-cab__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.opt-cab__company {
  margin: 0 0 4px;
  font: 600 20px/1.3 var(--head-font);
  color: var(--ink);
}
.opt-cab__head .opt-muted {
  margin: 0;
  font-size: 14px;
}
.opt-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 28px;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: #fff6ef;
  font-size: 14px;
  line-height: 1.5;
}
.opt-note b {
  color: var(--ink);
}
.opt-note--soft {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  border-left-color: var(--hair);
  background: var(--well);
}
.opt-tabs--cab {
  margin-bottom: 32px;
}
.opt-flash {
  margin: -12px 0 28px;
  padding: 14px 18px;
  border-radius: 4px;
  background: #eef6e6;
  font-size: 14px;
  color: #3d6b1c;
}
.opt-empty {
  padding: 40px 0;
  text-align: center;
}

/* каталог */
.opt-filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
.opt-search {
  max-width: 440px;
}
.opt-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.opt-chips button {
  height: 34px;
  padding: 0 14px;
  border: 1px solid #d6d6d6;
  border-radius: 999px;
  background: #fff;
  font: 500 13px/1 "Montserrat", Arial, sans-serif;
  color: var(--text);
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.opt-chips button:hover,
.opt-chips button.is-active {
  border-color: var(--ink);
  color: var(--ink);
}
.opt-chips__sep {
  width: 1px;
  height: 20px;
  margin: 0 6px;
  background: var(--hair);
}
.opt-table {
  border-top: 1px solid var(--hair);
}
.opt-tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 110px 150px 120px;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 14px;
}
.opt-tr--head {
  padding: 10px 0;
  font-size: 12px;
  color: var(--muted);
}
.opt-tr.is-picked {
  background: #fffaf6;
}
.opt-prod {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.opt-prod__img {
  flex: none;
  width: 48px;
  height: 64px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--well);
}
.opt-prod__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.opt-prod a {
  display: block;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.opt-prod a:hover {
  color: var(--accent);
}
.opt-prod small {
  font-size: 12px;
  color: var(--muted);
}
.opt-retail {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: #bbb;
}
.opt-price,
.opt-sum {
  font: 600 15px/1 var(--head-font);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.opt-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d6d6d6;
  border-radius: 999px;
  overflow: hidden;
}
.opt-qty button {
  width: 36px;
  height: 36px;
  border: 0;
  background: none;
  font-size: 18px;
  color: var(--ink);
  cursor: pointer;
}
.opt-qty button:hover:not(:disabled) {
  background: var(--well);
}
.opt-qty button:disabled {
  color: #ccc;
  cursor: default;
}
.opt-qty input {
  width: 56px;
  height: 36px;
  border: 0;
  text-align: center;
  font: 600 14px/1 "Montserrat", Arial, sans-serif;
  color: var(--ink);
  background: none;
}
.opt-qty input:focus {
  outline: none;
}

/* нижняя панель заявки */
.opt-bar {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  padding: 16px 16px 16px 24px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}
.opt-bar__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 13px;
}
.opt-bar__info b {
  font: 600 17px/1.2 var(--head-font);
  color: var(--ink);
}
.opt-progress {
  display: block;
  width: 240px;
  max-width: 100%;
  height: 3px;
  margin-top: 4px;
  border-radius: 2px;
  background: var(--hair);
  overflow: hidden;
}
.opt-progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* модальное окно заявки */
.opt-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 16px;
}
.opt-modal__bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}
.opt-modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 28px;
  border-radius: 8px;
  background: #fff;
}
.opt-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.opt-x {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--well);
  cursor: pointer;
}
.opt-lines {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hair);
}
.opt-lines li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 110px;
  gap: 16px;
  align-items: baseline;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 14px;
  color: var(--ink);
}
.opt-lines li::before {
  display: none !important;
}
.opt-lines b {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* заявки */
.opt-orders {
  border-top: 1px solid var(--hair);
}
.opt-order {
  border-bottom: 1px solid var(--hair);
}
.opt-order__head {
  display: grid;
  grid-template-columns: 140px 1fr auto 130px;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px 0;
  border: 0;
  background: none;
  text-align: left;
  font: 400 14px/1.3 "Montserrat", Arial, sans-serif;
  color: var(--text);
  cursor: pointer;
}
.opt-order__no {
  font: 600 16px/1.3 var(--head-font);
  color: var(--ink);
}
.opt-order__head b {
  text-align: right;
  font: 600 16px/1 var(--head-font);
  color: var(--ink);
}
.opt-order__head:hover .opt-order__no {
  color: var(--accent);
}
.opt-status {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--well);
  color: var(--text);
}
.opt-status.is-new {
  background: #fff1e6;
  color: #c2560f;
}
.opt-status.is-work {
  background: #eaf1fb;
  color: #2a5ea8;
}
.opt-status.is-done {
  background: #eef6e6;
  color: #3d6b1c;
}
.opt-status.is-off {
  background: var(--well);
  color: var(--muted);
}
.opt-order__body {
  padding: 0 0 24px;
}
.opt-dl {
  display: grid;
  gap: 6px;
  margin: 16px 0;
  font-size: 14px;
}
.opt-dl div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
}
.opt-dl dt {
  font-weight: 400;
  color: var(--muted);
}
.opt-dl dd {
  margin: 0;
  color: var(--ink);
}
.opt-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-top: 20px;
}
.opt-actions .opt-btn {
  min-height: 44px;
  font-size: 14px;
}

/* документы */
.opt-docs {
  margin: 12px 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hair);
}
.opt-docs li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 13px;
}
.opt-docs li::before {
  display: none !important;
}
.opt-docs a {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.opt-docs a:hover {
  color: var(--accent);
}

/* компания */
.opt-company {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 72px;
  align-items: start;
}
.opt-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.opt-wide {
  grid-column: 1 / -1;
}
.opt-company .opt-btn {
  align-self: flex-start;
}

@media (max-width: 1199px) {
  .opt-landing {
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 48px;
  }
  .opt-company {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .opt-form--narrow {
    max-width: 440px;
  }
}
@media (max-width: 991px) {
  .opt-landing {
    grid-template-columns: 1fr;
  }
  .opt-landing__auth {
    position: static;
    order: -1;
  }
  .opt-tr {
    grid-template-columns: minmax(0, 1fr) 90px 90px 140px;
  }
  .opt-tr > :nth-child(5) {
    display: none;
  }
}
@media (max-width: 767px) {
  .opt-top {
    padding-top: 32px;
    margin-bottom: 24px;
  }
  .opt-auth {
    padding: 20px;
  }
  .opt-terms div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .opt-steps {
    grid-template-columns: 1fr;
  }
  .opt-row2,
  .opt-grid2 {
    grid-template-columns: 1fr;
  }
  .opt-tr--head {
    display: none;
  }
  .opt-tr {
    grid-template-columns: 1fr auto;
    gap: 10px 12px;
  }
  .opt-tr .opt-prod {
    grid-column: 1 / -1;
  }
  .opt-tr > :nth-child(2) {
    display: none;
  }
  .opt-tr > :nth-child(3)::before {
    content: "Опт ";
    font: 400 12px "Montserrat", Arial, sans-serif;
    color: var(--muted);
  }
  .opt-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    border-radius: 16px;
    bottom: 72px;
  }
  .opt-order__head {
    grid-template-columns: 1fr auto;
  }
  .opt-order__head > :nth-child(2) {
    display: none;
  }
  .opt-order__head b {
    grid-column: 1 / -1;
    text-align: left;
  }
  .opt-lines li {
    grid-template-columns: 1fr auto;
  }
  .opt-lines li > :nth-child(2) {
    grid-column: 1;
  }
  .opt-dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .opt-cab__head {
    flex-direction: column;
    gap: 12px;
  }
}

/* ── печатный договор ──────────────────────────────────────── */
.opt-doc-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--hair);
  font: 500 14px/1 "Montserrat", Arial, sans-serif;
}
.opt-doc-bar a {
  color: var(--ink);
}
.opt-doc-bar button {
  height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  font: 600 14px/1 "Montserrat", Arial, sans-serif;
  color: #fff;
  cursor: pointer;
}
.opt-doc-bar button:hover {
  background: var(--accent-press);
}
.opt-doc-msg {
  max-width: 820px;
  margin: 80px auto;
  padding: 0 24px;
  font: 400 15px/1.5 "Montserrat", Arial, sans-serif;
}
.opt-doc {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 56px 80px;
  font: 400 13px/1.55 "Times New Roman", Times, serif;
  color: #111;
  background: #fff;
}
.opt-doc h1 {
  margin: 0 0 12px;
  text-align: center;
  font: 700 17px/1.3 "Times New Roman", Times, serif !important;
  color: #111;
}
.opt-doc h2 {
  margin: 20px 0 8px;
  font: 700 14px/1.3 "Times New Roman", Times, serif !important;
  color: #111;
}
.opt-doc h3 {
  margin: 0 0 6px;
  font: 700 13px/1.3 "Times New Roman", Times, serif !important;
}
.opt-doc p {
  margin: 0 0 6px;
  text-align: justify;
}
.opt-doc__place {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px !important;
}
.opt-doc__parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.opt-doc__parties p {
  text-align: left;
  margin-bottom: 3px;
}
.opt-doc__sign {
  margin-top: 28px !important;
}
.opt-doc__parties--sign {
  margin-top: 28px;
}
.opt-doc__spec {
  margin-top: 48px;
  break-before: page;
}
.opt-doc table {
  width: 100%;
  margin: 12px 0 16px;
  border-collapse: collapse;
}
.opt-doc th,
.opt-doc td {
  padding: 5px 6px;
  border: 1px solid #333;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}
.opt-doc th {
  font-weight: 700;
}
.opt-doc td:nth-child(n + 4),
.opt-doc th:nth-child(n + 4) {
  text-align: right;
  white-space: nowrap;
}
.opt-doc tfoot td {
  font-weight: 700;
}

@media print {
  .opt-doc-bar,
  nextjs-portal {
    display: none !important;
  }
  .opt-doc {
    max-width: none;
    padding: 0;
  }
  @page {
    size: A4;
    margin: 18mm 16mm;
  }
}
@media (max-width: 767px) {
  .opt-doc {
    padding: 24px 16px 48px;
  }
  .opt-doc__parties {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .opt-tabs--cab {
    gap: 22px;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
  }
  .opt-tabs--cab::-webkit-scrollbar {
    display: none;
  }
  .opt-tabs--cab button {
    flex: none;
  }
}
