// Комплексные поля: core-field-organization, -license, -address, -identification-doc, -requisite

.complex-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  border-radius: var(--COMPLEX-FIELD-RADIUS, 4px);
  min-height: var(--COMPLEX-FIELD-MIN-HEIGHT, 100px);
  height: 100%;
  position: relative;
  width: 100%;
  margin: 0 auto;
  border: var(--COMPLEX-FIELD-BORDER-WIDTH, 1.8px) solid var(--COMPLEX-FIELD-BORDER-COLOR, var(--GRAY));
  background: var(--COMPLEX-FIELD-BG, linear-gradient(160deg, #e2e2e2 -165.42%, var(--WHITE) 78.95%));

  button {
    width: var(--COMPLEX-FIELD-ACTION-WIDTH, 150px);
    border: none;
    background: none;
    height: var(--COMPLEX-FIELD-ACTION-HEIGHT, 70px);
    cursor: pointer;
    border-left: var(--COMPLEX-FIELD-ACTION-BORDER-LEFT, 1px solid var(--GRAY));
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.complex-field .sln-complex-field__title {
  font-family: var(--font-bold);
  margin: 0;
  font-size: var(--COMPLEX-FIELD-TITLE-FONT-SIZE, 13px);
  margin-bottom: var(--COMPLEX-FIELD-TITLE-MARGIN-BOTTOM, 5px);
  letter-spacing: var(--COMPLEX-FIELD-TITLE-LETTER-SPACING, 0.01em);
  text-transform: var(--COMPLEX-FIELD-TITLE-TRANSFORM, uppercase);
  color: var(--COMPLEX-FIELD-TITLE-COLOR, var(--MIDLE-GRAY));
}

.complex-field .sln-complex-field__title.required::after,
.complex-field h6.required::after {
  color: var(--DANGER);
  content: ' *';
}

.complex-field h2 {
  margin: 0;
  font-weight: var(--COMPLEX-FIELD-VALUE-FONT-WEIGHT, 500);
  font-family: var(--font-medium);
  color: var(--COMPLEX-FIELD-VALUE-COLOR, var(--MIDLE-GRAY));
  font-size: var(--COMPLEX-FIELD-VALUE-FONT-SIZE, 18px);

  .sln-complex-field-copy {
    width: var(--COMPLEX-FIELD-VALUE-WIDTH, 86%);
    display: block;
  }

  span {
    display: block;
  }

  .sln-complex-field-requisites {
    display: flex;
    flex-wrap: wrap;
    column-gap: 16px;

    .sln-complex-field-copy {
      display: inline;
      width: auto;
    }
  }
}

.complex-field-info,
.complex-field-info-readony {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--COMPLEX-FIELD-INFO-PADDING-Y, 20px) var(--COMPLEX-FIELD-INFO-PADDING-X, 30px);
  width: var(--COMPLEX-FIELD-INFO-WIDTH, 80%);
  margin-bottom: -2px !important;
  position: relative;
}

.complex-field-info::after,
.complex-field-info-readony::after {
  content: '';
  width: var(--COMPLEX-FIELD-DIVIDER-WIDTH, 0);
  height: var(--COMPLEX-FIELD-DIVIDER-HEIGHT, 0);
  right: var(--COMPLEX-FIELD-DIVIDER-RIGHT, auto);
  position: absolute;
  // background: var(--COMPLEX-FIELD-DIVIDER-COLOR, var(--LIGHT-GRAY));
}

// Карточка с шапкой и сеткой полей (пока core-field-requisite)
.complex-field--details {
  align-items: stretch;
  min-height: auto;
  height: auto;

  .complex-field-info,
  .complex-field-info-readony {
    width: 100%;
    justify-content: flex-start;
    padding: var(--COMPLEX-FIELD-INFO-PADDING-Y, 16px)
      var(--COMPLEX-FIELD-INFO-PADDING-X, 16px);
    margin-bottom: 0 !important;
  }

  .complex-field-info::after,
  .complex-field-info-readony::after {
    content: none;
  }

  .sln-complex-field__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
  }

  .sln-complex-field__title {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
    font-family: var(--COMPLEX-FIELD-HEADING-FONT, var(--font));
    font-size: var(--COMPLEX-FIELD-HEADING-FONT-SIZE, 14px);
    text-transform: var(--COMPLEX-FIELD-HEADING-TRANSFORM, none);
    color: var(--COMPLEX-FIELD-HEADING-COLOR, var(--DARK-GREY));
    line-height: 18px;
  }

  .sln-complex-field__action {
    width: var(--COMPLEX-FIELD-ACTION-BTN-SIZE, 29px);
    min-width: var(--COMPLEX-FIELD-ACTION-BTN-SIZE, 29px);
    height: var(--COMPLEX-FIELD-ACTION-BTN-SIZE, 29px);
    border-left: none;
    border-radius: var(--COMPLEX-FIELD-ACTION-BTN-RADIUS, 6px);
    background: var(--COMPLEX-FIELD-ACTION-BTN-BG, transparent);
    padding: 0;
    flex-shrink: 0;
  }

  .sln-complex-field__edit-icon {
    display: block;
    width: var(--COMPLEX-FIELD-ACTION-ICON-SIZE, 16px);
    height: var(--COMPLEX-FIELD-ACTION-ICON-SIZE, 16px);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
  }

  .sln-complex-field__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--COMPLEX-FIELD-GRID-COLUMN-GAP, 24px);
    row-gap: var(--COMPLEX-FIELD-GRID-ROW-GAP, 16px);
    margin-top: var(--COMPLEX-FIELD-GRID-MARGIN-TOP, 16px);
    width: fit-content;
    max-width: 100%;

    &:has(> :only-child) {
      grid-template-columns: 1fr;
      width: 100%;
    }

    &--cols-3 {
      grid-template-columns: 1fr 1fr 1fr;
    }
  }

  .sln-complex-field__item {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .sln-complex-field__label {
    font-family: var(--font-medium);
    font-size: var(--COMPLEX-FIELD-LABEL-FONT-SIZE, 12px);
    line-height: 12px;
    color: var(--COMPLEX-FIELD-LABEL-COLOR, var(--GRAY));
    text-transform: var(--COMPLEX-FIELD-LABEL-TRANSFORM, uppercase);
  }

  .sln-complex-field__value {
    display: block;
    width: 100%;
    font-family: var(--COMPLEX-FIELD-DATA-FONT, var(--font-bold));
    font-size: var(--COMPLEX-FIELD-DATA-FONT-SIZE, 14px);
    font-weight: var(--COMPLEX-FIELD-DATA-FONT-WEIGHT, 700);
    color: var(--COMPLEX-FIELD-DATA-COLOR, var(--DARK-GREY));
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
}
