/************************************************************************************
адаптивность бизнес-каталога
*************************************************************************************/
@media screen and (max-width: 620px) {

    /* схема проезда и служебные блоки карты — резиновые */
    #map, #footer, #messageHeader, #message {
        max-width: 100%;
        width: auto;
    }
}


/************************************************************************************
БЭМ: карточка фирмы (viewfirm)
*************************************************************************************/
.firm-page {
    margin: 10px 0 10px var(--content-gap);   /* обход флоата .menubar, как у .block_firms */
    padding-top: 5px;
}

.firm-page__rule {
    height: 6px;
    margin: 0 0 5px 0;                /* сверху 0 — стык с линией меню, снизу 5px — как у td.vn */
    background: url(../../img/i/lm.gif) repeat-x;
}

.firm-card {
    margin-bottom: 10px;
    padding: 7px;
    border: 1px solid #cccccc;
    font-size: 14px;
    line-height: 13.9pt;
    text-align: left;
}

.firm-card__header {
    display: flex;
    align-items: center;     /* текст и маркер — по вертикальному центру полоски */
    gap: 4px;
    margin: 0 0 4px;
    padding: 0;
    height: 26.5px;
    overflow: hidden;
    font-weight: bold;
    font-size: 9pt;
    color: #4f6b84;
    font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
    background: url(../img/i/bgspace.gif) repeat-x left top;
}

.firm-card__marker {
    flex-shrink: 0;
    display: block;
    align-self: flex-start;   /* маркер у верха, текст по центру */
}

.firm-card__title {
    font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
    font-size: 9pt;
    color: #4f6b84;
}

.firm-card__layout {
    display: grid;
    grid-template-columns: 170px auto;
    align-items: start;
}

.firm-card__side {
    text-align: center;
}

.firm-card__logo {
    width: 100%;
    height: auto;
}

.firm-card__doc {
    display: block;
    margin: 8px 4px;
    padding: 4px;
    border: 1px solid #cccccc;
    text-decoration: none;
}

.firm-card__doc-label {
    display: block;
    padding: 2px;
    background: #cccccc;
    font-size: 12px;
}

/* модификаторы вместо выбора картинки по буквам в имени файла */
.firm-card__doc--word::before,
.firm-card__doc--excel::before,
.firm-card__doc--ppt::before {
    content: '';
    display: block;
    height: 32px;
    margin-bottom: 4px;
    background: center / contain no-repeat;
}
.firm-card__doc--word::before  { background-image: url(./img/images/iword.gif); }
.firm-card__doc--excel::before { background-image: url(./img/images/iexcel.gif); }
.firm-card__doc--ppt::before   { background-image: url(./img/images/ippt.gif); }

.firm-card__description {
    padding-left: 5px;
    text-align: left;
}

.firm-attr {
    text-align: left;
}

.firm-attr__label {
    display: inline-block;
    width: 170px;
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid #cccccc;
    text-align: right;
    color: #4e99e5;
    vertical-align: top;
}

.firm-attr__value {
    display: inline-block;
    margin-top: 2px;
    padding-left: 5px;
    text-align: left;
    vertical-align: top;
}

.firm-scheme {
    padding: 5px;
    text-align: center;
}

.firm-scheme__img {
    max-width: 100%;
    height: auto;
}

.firm-card__views {
    padding: 3px 5px;
    text-align: right;
    color: #990000;
}

@media screen and (max-width: 620px) {
    .firm-card__layout {
        display: block;
    }
    .firm-card__logo {
        max-width: 150px;
    }
    .firm-attr__label {
        width: 100%;
        text-align: left;
    }
}

/************************************************************************************
БЭМ: форма регистрации фирмы (addfirm)
*************************************************************************************/
.firm-form {
    margin-bottom: 15px;
    text-align: center;
}

.firm-form__rule {
    height: 6px;
    background: url(../../img/i/lm.gif) repeat-x;
}

.firm-form__header {
    display: flex;
    align-items: center;
    height: 31px;
    padding-left: 5px;
    background: #ffffff;
    text-align: left;
    font-size: 9pt;
}

.firm-form__back {
    flex: none;
}

.firm-form__crumb {
    white-space: nowrap;
}

.firm-form__body {
    width: 620px;
    max-width: 100%;
    margin: 15px auto 0;
    text-align: left;
}

.firm-form__field {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.firm-form__label {
    flex: 0 0 170px;
    padding-top: 6px;
    text-align: left;
}

/* подпись с инлайн-кнопкой (Адрес + Проверить) */
.firm-form__label--inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 3px;
}

.firm-form__req {
    color: red;
}

.firm-form__control {
    flex: 1;
    text-align: left;
}

/* ---------- поле ввода ---------- */
.firm-form__input {
    height: 28px;
    width: 380px;
    box-sizing: border-box;
    padding: 4px;
    margin: 3px;
    border: 1px solid #999;
    border-radius: 3px;
    box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0);
    transition: .17s linear;
}

.firm-form__input:focus {
    outline: none;
    border: 1px solid #FF7F00;
}

/* состояние ошибки: подсветку вешает input_validation.js классом input_error */
.firm-form__input--error {
    outline: none;
    margin: 3px;
    border: 1px solid #f33;
    box-shadow: 0 0 1px 1px #f33;
}

/* многострочное поле (Род деятельности) */
.firm-form__input--area {
    height: 100px;
    margin-right: 0;
}

/* множественный select категорий */
.firm-form__select-multi {
    font-size: 14pt;
    color: #4f6b84;
    font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
}

/* ---------- кнопка ---------- */
.firm-form__btn {
    display: inline-block;
    font-size: 11px;
    color: rgb(68,68,68);
    text-decoration: none;
    user-select: none;
    padding: 0.5em;
    margin: 3px;
    outline: none;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 2px;
    background: rgb(245,245,245) linear-gradient(#f4f4f4, #f1f1f1);
    transition: all .218s ease 0s;
    height: 28px;
    width: 74px;
    text-align: center;
    cursor: pointer;
}

/* кнопка внутри file-контейнера: ширина по содержимому, без переноса */
.firm-form__file .firm-form__btn {
    width: auto;
    min-width: 74px;
    padding: 0 14px;
    line-height: 26px;
    white-space: nowrap;
    box-sizing: border-box;
}

/* hover/active виден и при наведении на прозрачный инпут поверх кнопки */
.firm-form__file:hover .firm-form__btn,
.firm-form__btn:hover {
    color: rgb(24,24,24);
    border: 1px solid rgb(198,198,198);
    background: #f7f7f7 linear-gradient(#f7f7f7, #f1f1f1);
    box-shadow: 0 1px 2px rgba(0,0,0,.1);
}

.firm-form__file:active .firm-form__btn,
.firm-form__btn:active {
    color: rgb(51,51,51);
    border: 1px solid rgb(204,204,204);
    background: rgb(238,238,238) linear-gradient(rgb(238,238,238), rgb(224,224,224));
    box-shadow: 0 1px 2px rgba(0,0,0,.1) inset;
}

/* бывший инлайн style="color: #FF7F00" */
.firm-form__btn--accent {
    color: #FF7F00;
}

/* ---------- выбор файла под видом кнопки ---------- */
.firm-form__file {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.firm-form__file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    margin: 0;
    padding: 0;
    border: 0;
    cursor: pointer;
    z-index: 2;
}

/* строка: кнопка выбора + имя файла */
.firm-form__file-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.firm-form__file-name {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    font-size: x-small;
    color: #555555;
}

/* ---------- превью выбранного файла ---------- */
.firm-form__preview {
    margin-top: 6px;
    width: 380px;
    max-width: 100%;
}

.firm-form__preview img {
    display: none;
    max-width: 100%;
    height: auto;
    border: 1px solid #cccccc;
    padding: 2px;
    box-sizing: border-box;
}

.firm-form__preview img.firm-form__preview--shown {
    display: block;
}

/* ---------- карта, примечания, действия ---------- */
/* ---------- блок проверки адреса ---------- */
.firm-form__map {
    margin: 10px 0 0 3px;      /* по левому краю инпутов (у них margin: 3px) */
    text-align: center;
}

.firm-form__map-notice {
    margin: 0 0 6px;
    font-size: x-small;
    color: #555555;
    text-align: left;
}

.firm-form__map-view {
    width: 380px;              /* ровно ширина инпутов формы */
    height: 300px;
    margin: 0 auto;            /* карта по центру колонки */
    border: 1px solid #cccccc;
}

.firm-form__map-footer {
    margin-top: 8px;
    width: 380px;
    font-size: x-small;
    line-height: 1.4;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: anywhere;   /* перенос длинной строки координат */
}


.firm-form__note {
    margin: 10px 0;
    text-align: center;
    font-size: x-small;
    color: #555555;
}

.firm-form__hint {
    display: flex;
    gap: 8px;
    margin: 15px 0;
    font-size: x-small;
}

.firm-form__hint-label {
    flex: 0 0 170px;
    text-align: left;
}

.firm-form__actions {
    margin-top: 15px;
    text-align: right;
}

.firm-message {
    width: 420px;
    max-width: 90%;
    margin: 0 auto;
    padding: 6px;
    text-align: center;
}

.firm-message--success {
    background: #ff3333;
    color: #ffffff;
}

.firm-message--error {
    background: #ff3333;
    color: #ffffff;
}

.firm-message--error-list {
    color: #ff0000;
    font-size: small;
}

@media screen and (max-width: 620px) {
    .firm-form__field {
        display: block;
    }
    .firm-form__label,
    .firm-form__hint-label {
        width: 100%;
        text-align: left;
        margin-bottom: 3px;
    }
    .firm-form__body input[type=text],
    .firm-form__body select,
    .firm-form__body textarea {
        max-width: 95%;
    }
}

.firm-form__input--tel {
    width: 180px;
}

.firm-form__input--note {
    width: 180px;
    margin-left: 6px;
}

/************************************************************************************
БЭМ: поиск фирм (searchfirm)
*************************************************************************************/
.firms-search {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    padding-top: 5px;
}

.firms-search__body {
    padding: 3px;
    text-align: justify;
}

.firms-search__results {
    padding: 10px 0 0;
    text-align: left;
}

.firms-search__item {
    padding: 3px 0;
}

.firms-search__num {
    font-size: 9pt;
}

.firms-search__name {
    color: #4f6b84;
    font-size: 9pt;
    text-decoration: none;
}

.firms-search__name:hover {
    text-decoration: underline;
}

.firms-search__address {
    font-size: 9pt;
}

.firms-search__cat {
    text-align: right;
    font-size: 9px;
}

/* ---------- пагинация ---------- */
.firms-pager {
    text-align: right;
    padding: 5px 3px;
    font-size: 9pt;
}


/************************************************************************************
БЭМ: шапка каталога фирм (firms-hat)
*************************************************************************************/
.firms-hat {
    margin-bottom: 10px;
    background: #ffffff;
}

.firms-hat__rule {
    height: 6px;
    background: url(../../img/i/lm.gif) repeat-x;
}

.firms-hat__bar {
    display: flex;
    min-height: 31px;
    padding: 4px 5px;
    font-size: 9pt;
}

.firms-hat__back {
    flex: none;
    margin-right: 4px;
}

.firms-hat__title {
    flex: 1;
    white-space: nowrap;
    color: #333333;
}

.firms-hat__nav {
    flex: none;
    padding-left: 10px;
}

.firms-hat__select {
    width: 480px;
    max-width: 100%;
    height: 28px;
    box-sizing: border-box;
    font-size: 11pt;
    color: #4f6b84;
    border: 1px solid transparent; /* место под рамку занято заранее */
    font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
}

.firms-hat__select:focus {
    outline: none;
    border: 1px solid #FF7F00;
}

.firms-hat__optgroup {
    color: #000000;
    font-weight: bold;
}

.firms-hat__option {
    color: #4f6b84;
}

.firms-hat__search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 5px 10px;
    font-size: 11pt;
}

.firms-hat__search-input {
    width: 210px;
    height: 28px;
    box-sizing: border-box;
    padding: 2px 6px;
    border: 1px solid #999;
    border-radius: 3px;
    font-size: 11pt;
}

.firms-hat__search-input:focus {
    outline: none;
    border: 1px solid #FF7F00;
}

.firms-hat__search-btn {
    display: inline-block;
    font-size: 13px;
    color: rgb(68, 68, 68);
    text-decoration: none;
    user-select: none;
    margin: 3px;
    outline: none;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 2px;
    background: rgb(245, 245, 245) linear-gradient(#f4f4f4, #f1f1f1);
    transition: all .218s ease 0s;
    width: 34px;
    height: 28px;
    text-align: center;
    cursor: pointer;
}

.firms-hat__search-btn:hover {
    color: rgb(24, 24, 24);
    border: 1px solid rgb(198, 198, 198);
    background: #f7f7f7 linear-gradient(#f7f7f7, #f1f1f1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}


/************************************************************************************
БЭМ: дерево категорий фирм (firms-tree)
*************************************************************************************/
.firms-tree {
    padding: 0 5px 10px;
}

.firms-tree__section {
    margin-bottom: 6px;
}

.firms-tree__head {
    padding: 3px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 11pt;
}

.firms-tree__toggle {
    color: #336699;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}

.firms-tree__head a img {
    vertical-align: middle;
}

.firms-tree__list {
    display: none;
    margin: 4px 0 8px;
    padding: 6px 8px;
    border: 1px dashed #cccccc;
    text-align: justify;
    font-size: 11pt;
    line-height: 1.45;
}

.firms-tree__link {
    color: #336699;
    text-decoration: none;
}

.firms-tree__link:hover {
    text-decoration: underline;
}

.firms-tree__link--current {
    font-weight: bold;
    text-decoration: underline;
}

.firms-tree__list--open {
    display: block;
}

/************************************************************************************
БЭМ: список фирм в подкатегории (firms-list)
*************************************************************************************/
.firms-list {
    padding: 5px 0;
}

.firms-list__item {
    padding: 10px 0 0;
    font-size: 9pt;
}

.firms-list__num {
    font-size: 9pt;
}

.firms-list__name {
    color: #4f6b84;
    text-decoration: none;
}

.firms-list__name:hover {
    text-decoration: underline;
}

.firms-list__name--current {
    font-weight: bold;
    color: #333333;
}

.firms-list__address {
    font-size: 9pt;
}

.firm-form__optgroup {
    color: #000000;
    font-weight: bold;
}

.firm-form__option {
    color: #4f6b84;
}

@media screen and (max-width: 1030px) {
    .firms-hat__nav {
        display: none;
    }
}