/* ============================================================
   FlowBiz — мастер добавления товара
   ============================================================ */

body.wizard-page {
  background: #f4f0ea;
  color: #241a17;
  font-family: var(--font-sans);
}

body.wizard-page.wiz-sheet-open {
  overflow: hidden;
}

.wizard-page h2 {
  margin: 0 0 12px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wiz {
  min-height: 100dvh;
}

/* ---------- шапка ---------- */

.wiz-head {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 10px 16px;
  background: rgba(244, 240, 234, 0.96);
  backdrop-filter: blur(12px);
}

.wiz-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid #e6d9cf;
  border-radius: 14px;
  background: #fff;
  color: #241a17;
  cursor: pointer;
}

.wiz-icon .icon {
  width: 19px;
  height: 19px;
}

.wiz-head__center {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
}

.wiz-head__center strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.wiz-head__center span {
  font-size: 10.5px;
  color: #8a7a72;
}

/* ---------- степпер ---------- */

.wiz-stepper {
  position: sticky;
  top: 64px;
  z-index: 29;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 8px 16px 12px;
  background: rgba(244, 240, 234, 0.96);
  backdrop-filter: blur(12px);
}

.wiz-stepper button {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: #8a7a72;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}

.wiz-stepper button span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #ddcec3;
  border-radius: 50%;
  background: #fff;
  color: #8a7a72;
  font-size: 12px;
  font-weight: 700;
}

.wiz-stepper button.is-active span {
  border-color: #c92a2a;
  background: #c92a2a;
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(180, 30, 20, 0.8);
}

.wiz-stepper button.is-done span {
  border-color: #fbe9e7;
  background: #fbe9e7;
  color: #c92a2a;
}

.wiz-stepper button.is-locked {
  opacity: 0.55;
}

.wiz-stepper i {
  flex: 0 0 22px;
  height: 1px;
  margin-top: 15px;
  background: #e2d5ca;
}

/* ---------- контент ---------- */

.wiz-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 4px 16px 180px;
}

.wiz-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wiz-panel[hidden] {
  display: none;
}

.wiz-card {
  padding: 20px;
  border: 1px solid #ece1d8;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 34px -30px rgba(60, 30, 20, 0.45);
}

.wiz-card h2 {
  color: #241a17;
}

/* ---------- поля ---------- */

.wiz-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.wiz-field + .wiz-field {
  margin-top: 12px;
}

.wiz-field > span {
  font-size: 12.5px;
  font-weight: 600;
  color: #8a7a72;
}

.wiz-field > span b {
  color: #c92a2a;
  font-weight: 700;
}

.wiz-input {
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border: 1px solid #ddcec3;
  border-radius: 14px;
  background: #fdfbf9;
  color: #241a17;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.3;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.wiz-input:focus {
  border-color: #c92a2a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 42, 42, 0.12);
}

textarea.wiz-input {
  height: auto;
  min-height: 112px;
  padding: 13px 14px;
  resize: vertical;
}

select.wiz-input {
  padding-right: 38px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a7a72' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.wiz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.wiz-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wiz-grid .wiz-field + .wiz-field {
  margin-top: 0;
}

/* ---------- фотографии ---------- */

.wiz-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.wiz-photo {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 15px;
  background: #f5eee8;
}

.wiz-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wiz-photo__cover {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #241a17;
  font-size: 9px;
  font-weight: 700;
}

.wiz-photo__tools {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  gap: 4px;
}

.wiz-photo__tools button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(36, 26, 23, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.wiz-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 18px 12px;
  border: 1.5px dashed #d9c8bc;
  border-radius: 16px;
  background: #fdfbf9;
  cursor: pointer;
}

.wiz-upload.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.wiz-upload__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #fbe9e7;
  color: #c92a2a;
}

.wiz-upload__icon .icon {
  width: 19px;
  height: 19px;
}

.wiz-upload__text {
  font-size: 13.5px;
  font-weight: 700;
}

.wiz-upload em {
  font-size: 10.5px;
  font-style: normal;
  color: #8a7a72;
}

/* ---------- дополнительно ---------- */

.wiz-more {
  padding: 0;
  overflow: hidden;
}

.wiz-more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.wiz-more summary::-webkit-details-marker {
  display: none;
}

.wiz-more summary em {
  font-size: 10.5px;
  font-style: normal;
  font-weight: 500;
  color: #8a7a72;
}

.wiz-more[open] summary {
  border-bottom: 1px solid #f0e7df;
}

.wiz-more > :not(summary) {
  margin: 14px 20px;
}

/* ---------- состав ---------- */

.wiz-comp-summary {
  padding: 15px 18px;
  border: 1px solid #f2ded9;
  border-radius: 18px;
  background: #fbe9e7;
}

.wiz-comp-summary strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #241a17;
}

.wiz-comp-summary span {
  font-size: 11.5px;
  color: #8a5a55;
}

.wiz-comp {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid #ece1d8;
  border-radius: 18px;
  background: #fff;
}

.wiz-comp__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wiz-comp__head strong {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.wiz-badge {
  flex: none;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f4ede7;
  color: #8a7a72;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.wiz-badge--catalog {
  background: #fbe9e7;
  color: #c92a2a;
}

.wiz-remove {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: #f7f1ec;
  color: #8a7a72;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}

.wiz-comp__row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.wiz-field--mini {
  flex: 0 0 84px;
}

.wiz-field--mini + .wiz-field--mini {
  margin-top: 0;
}

.wiz-field--mini .wiz-input {
  height: 44px;
  padding: 0 10px;
  font-size: 14px;
}

.wiz-comp__unit {
  padding-bottom: 13px;
  font-size: 11.5px;
  color: #8a7a72;
}

.wiz-comp__sum {
  margin-left: auto;
  padding-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wiz-link {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: #c92a2a;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.wiz-comp-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.wiz-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 52px;
  border: 1px solid #e6d9cf;
  border-radius: 15px;
  background: #fff;
  color: #241a17;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.wiz-secondary .icon {
  width: 16px;
  height: 16px;
  color: #c92a2a;
}

.wiz-note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #8a7a72;
}

.wiz-empty {
  padding: 26px 18px;
  border: 1.5px dashed #ddcec3;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.wiz-empty__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background: #fbe9e7;
  color: #c92a2a;
  font-size: 24px;
  font-weight: 300;
}

.wiz-empty strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.wiz-empty p {
  max-width: 36ch;
  margin: 5px auto 0;
  font-size: 11.5px;
  color: #8a7a72;
}

/* ---------- расчёт ---------- */

.wiz-cost-row,
.wiz-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f3eae3;
  font-size: 12.5px;
  color: #8a7a72;
}

.wiz-cost-row strong,
.wiz-total strong {
  color: #241a17;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.wiz-total {
  margin-top: 6px;
  border-bottom: 0;
  border-top: 1px solid #ece1d8;
  font-size: 14px;
  font-weight: 700;
  color: #241a17;
}

.wiz-total strong {
  font-size: 17px;
}

.wiz-price-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: #8a7a72;
}

.wiz-input--price {
  height: 62px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #c92a2a;
}

.wiz-profit {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: #8a7a72;
}

.wiz-warn {
  margin: 8px 0 0;
  padding: 9px 11px;
  border-radius: 12px;
  background: #fdf1df;
  color: #8a5a12;
  font-size: 11.5px;
}

/* ---------- публикация ---------- */

.wiz-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.wiz-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wiz-switch span {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: #e2d5ca;
  transition: background 0.15s ease;
  flex: none;
}

.wiz-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.wiz-switch input:checked + span {
  background: #c92a2a;
}

.wiz-switch input:checked + span::after {
  transform: translateX(18px);
}

/* ---------- нижняя панель ---------- */

.wiz-foot {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(760px, 100%);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(244, 240, 234, 0.97);
  border-top: 1px solid rgba(221, 206, 195, 0.6);
  box-shadow: 0 -18px 34px -30px rgba(60, 30, 20, 0.5);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}

.wiz-error {
  padding: 9px 12px;
  border-radius: 12px;
  background: #fdecea;
  color: #b42318;
  font-size: 12px;
  line-height: 1.4;
}

.wiz-submit {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 18px;
  background: #c92a2a;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 28px -16px rgba(180, 30, 20, 0.75);
}

.wiz-submit:disabled {
  opacity: 0.7;
  cursor: default;
}

.wiz-hint {
  margin: 0;
  font-size: 10px;
  text-align: center;
  color: #8a7a72;
}

/* ---------- шторки ---------- */

.wiz-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 40px;
  background: rgba(24, 12, 9, 0.45);
  backdrop-filter: blur(3px);
}

.wiz-sheet[hidden] {
  display: none;
}

.wiz-sheet__panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(560px, 100%);
  max-height: 88dvh;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, 0.35);
}

.wiz-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wiz-sheet__head strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wiz-sheet__head .wiz-icon {
  width: 38px;
  height: 38px;
}

.wiz-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 12px;
  border: 1px solid #ddcec3;
  border-radius: 14px;
  background: #fdfbf9;
}

.wiz-search .icon {
  width: 17px;
  height: 17px;
  color: #8a7a72;
  flex: none;
}

.wiz-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  outline: none;
}

.wiz-sheet__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding-bottom: 6px;
}

.wiz-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #ece1d8;
  border-radius: 14px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.wiz-cat:hover {
  background: #faf6f2;
}

.wiz-cat__copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.wiz-cat__copy strong {
  font-size: 13px;
  font-weight: 700;
}

.wiz-cat__copy span {
  font-size: 10.5px;
  color: #8a7a72;
}

.wiz-cat__add {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: auto;
  border-radius: 50%;
  background: #fbe9e7;
  color: #c92a2a;
  font-size: 18px;
  flex: none;
}

.wiz-sheet .wiz-field + .wiz-field {
  margin-top: 10px;
}

/* ---------- адаптив ---------- */

@media (max-width: 560px) {
  .wiz-grid--3 {
    grid-template-columns: 1fr;
  }

  .wiz-card {
    padding: 16px;
  }

  .wiz-more summary {
    padding: 14px 16px;
  }

  .wiz-more > :not(summary) {
    margin: 12px 16px;
  }

  .wiz-comp__row {
    flex-wrap: wrap;
  }

  .wiz-comp__sum {
    margin-left: 0;
    padding-bottom: 0;
  }
}

@media (min-width: 900px) {
  .wiz-head,
  .wiz-stepper {
    padding-inline: 20px;
  }

  .wiz-body {
    padding-inline: 20px;
  }
}
