/* ==========================================================================
   МОДУЛЬ "ТОРГУНИК" (mod_checknumber) — НОВЫЙ ДИЗАЙН
   ========================================================================== */

.torg-wrap {
    width: 100%;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    box-sizing: border-box;
    color: #2B5A5C;
}

.torg-card {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 40px;
    background-color: #ffffff;
    border: 1px solid #e0eae9;
    border-radius: 8px;
    box-shadow: 0 16px 40px -12px rgba(4, 97, 118, 0.15), 0 4px 12px -4px rgba(4, 97, 118, 0.05);
    padding: 40px 48px;
    box-sizing: border-box;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    overflow: hidden;
    transition: box-shadow .3s ease, transform .3s ease;
}

/* Карта на фоне (чёрно-белая через filter) */
.torg-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('/images/2026-11-05_19-02-13.png');
    background-size: cover;
    background-position: center 50%;
    background-repeat: no-repeat;
    filter: grayscale(100%);
    opacity: 0.35; /* прозрачность, чтобы текст читался */
    z-index: 0;
    pointer-events: none;
}

/* Контент поверх карты */
.torg-card > * {
    position: relative;
    z-index: 1;
}


css
.torg-card::before {
    background-position: center 30%;
}

.torg-card:hover {
    box-shadow: 0 20px 48px -12px rgba(4, 97, 118, 0.2), 0 8px 16px -6px rgba(4, 97, 118, 0.08);
}

/* ===== ЛЕВАЯ ЧАСТЬ ===== */
.torg-left {
    flex: 1 1 55%;
    max-width: 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.torg-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 16px;
    font-size: 28px;
    font-weight: 800;
    color: #046176;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.torg-title .torg-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #FCCC8C, #DC7C48);
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 6px 16px -4px rgba(220, 124, 72, 0.4);
}

.torg-desc {
    font-size: 16px;
    line-height: 1.6;
    color: #4a6b6d;
    margin: 0 0 20px;
    max-width: 520px;
}

.torg-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #2B5A5C;
    background: #f0f7f6;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid #d1e5e3;
    width: fit-content;
    max-width: 100%;
    line-height: 1.4;
}

/* ===== ПРАВАЯ ЧАСТЬ (ФОРМА) ===== */
.torg-form-side {
    flex: 0 0 420px;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.torg-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    width: 100%;
}

.torg-input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.torg-input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #5E939C;
    line-height: 0;
    pointer-events: none;
    z-index: 2;
    transition: color 0.25s ease;
}

.torg-input {
    width: 100%;
    height: 60px;
    padding: 0 145px 0 52px;
    border: 2px solid #d1e5e3;
    border-radius: 30px;
    background: #ffffff;
    font-size: 16px;
    font-weight: 500;
    color: #046176;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: inset 0 2px 4px rgba(4, 97, 118, 0.03);
}

.torg-input::placeholder {
    color: #9ab8b6;
    font-weight: 400;
}

.torg-input:focus {
    border-color: #5E939C;
    box-shadow: 0 0 0 4px rgba(94, 147, 156, 0.15), inset 0 2px 4px rgba(4, 97, 118, 0.03);
}

.torg-input-group:focus-within .torg-input-icon {
    color: #DC7C48;
}

/* Кнопка "Очистить" (крестик) */
.torg-clear-btn {
    position: absolute;
    right: 155px;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: #e6f0ef;
    color: #5E939C;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: background 0.2s ease, color 0.2s ease;
}

.torg-clear-btn:hover {
    background: #DC7C48;
    color: #ffffff;
}

.torg-clear-btn.is-visible {
    display: inline-flex;
}

/* Кнопка "Перейти" ВНУТРИ поля */
.torg-submit {
    position: absolute;
    right: 6px;
    top: 6px;
    bottom: 6px;
    height: auto;
    padding: 0 24px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #DC7C48 0%, #c96330 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px -2px rgba(220, 124, 72, 0.4);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 3;
    white-space: nowrap;
}

.torg-submit::after {
    content: "→";
    font-size: 18px;
    line-height: 1;
    transition: transform 0.25s ease;
}

.torg-submit:hover {
    background: linear-gradient(135deg, #e88a57 0%, #d66f37 100%);
    box-shadow: 0 6px 16px -2px rgba(220, 124, 72, 0.5);
}

.torg-submit:hover::after {
    transform: translateX(3px);
}

.torg-submit:active {
    transform: scale(0.98);
}

.torg-submit:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    background: #DC7C48;
}

.torg-submit.is-loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: torg-spin 0.8s linear infinite;
    transform: none !important;
}

@keyframes torg-spin {
    to { transform: rotate(360deg); }
}

/* Ссылка "Что такое Торгуник?" */
.torg-help-wrapper {
    text-align: right;
    margin-top: 4px;
    margin-bottom: 8px;
}

.torg-help-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #5E939C;
    text-decoration: underline;
    text-decoration-color: #9ab8b6;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.torg-help-link:hover {
    color: #DC7C48;
    text-decoration-color: #DC7C48;
}

/* ===== СООБЩЕНИЯ (Ошибки/Успех) ===== */
.torg-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    animation: torg-fade-in 0.3s ease;
}

@keyframes torg-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.torg-error {
    background: #fff0ed;
    color: #c0392b;
    border: 1px solid #fadbd8;
}

.torg-error::before {
    content: "⚠";
    font-size: 16px;
    flex-shrink: 0;
}

.torg-success {
    background: #f0faf4;
    color: #27ae60;
    border: 1px solid #d1f2dd;
}

.torg-success::before {
    content: "✓";
    font-size: 16px;
    flex-shrink: 0;
}

/* ===== МОДАЛЬНОЕ ОКНО "ЧТО ТАКОЕ ТОРГУНИК?" ===== */
.torg-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgb(82 84 85 / 40%);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: torg-fade-in 0.3s ease;
}

.torg-popup {
    position: relative;
    width: 90%;
    max-width: 450px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 64px -12px rgba(4, 97, 118, 0.4);
    padding: 32px;
    animation: torg-popup-zoom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes torg-popup-zoom {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.torg-popup h4 {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 800;
    color: #046176;
    padding-right: 24px;
    line-height: 1.3;
}

.torg-popup-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.torg-popup-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.torg-popup-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.torg-popup-list li div strong {
    display: block;
    font-size: 15px;
    color: #2B5A5C;
    margin-bottom: 4px;
}

.torg-popup-list li div p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #6a8b8d;
}

.torg-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #f0f7f6;
    color: #5E939C;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.torg-popup-close:hover {
    background: #e6f0ef;
    color: #DC7C48;
    transform: rotate(90deg);
}

.torg-popup-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: #DC7C48;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.torg-popup-btn:hover {
    background: #c96330;
}

.torg-popup-btn:active {
    transform: scale(0.98);
}

/* ===== АДАПТИВ ===== */
@media (max-width: 992px) {
    .torg-card {
        flex-direction: column;
        padding: 32px 24px;
        gap: 32px;
        text-align: center;
    }
    .torg-left,
    .torg-form-side {
        max-width: 100%;
        flex: 1 1 100%;
    }
    .torg-title {
        justify-content: center;
    }
    .torg-note {
        margin: 0 auto;
    }
    .torg-desc {
        margin-left: auto;
        margin-right: auto;
    }
    .torg-help-wrapper {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .torg-card {
        padding: 24px 16px;
        border-radius: 8px;
        /* Мобильная карта — сдвиг вверх, чтобы была видна улица */
        background-position: center 30%;
    }
    .torg-title {
        font-size: 22px;
    }
    .torg-title .torg-emoji {
        width: 40px;
        height: 40px;
    }
    .torg-title .torg-emoji svg {
        width: 20px;
        height: 20px;
    }
    .torg-desc {
        font-size: 14px;
    }
    .torg-input {
        padding-right: 110px;
        padding-left: 48px;
        height: 54px;
    }
    .torg-submit {
        padding: 0;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        top: 6px;
        right: 6px;
        bottom: auto;
    }
    .torg-submit span {
        display: none;
    }
    .torg-submit::after {
        content: "→";
        margin: 0;
        font-size: 20px;
    }
    .torg-clear-btn {
        right: 56px;
    }
}

/* ПК — центр карты */
@media (min-width: 769px) {
    .torg-card {
        background-position: center 50%;
    }
}

/* ===== КОМПАКТНЫЙ РЕЖИМ (dir-search-listing-top) ===== */
.torg-compact .torg-left {
    flex: 1 1 auto;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.torg-compact .torg-title {
    font-size: 16px;
    margin-bottom: 4px;
    gap: 8px;
    color: #2B5A5C;
}
.torg-compact .torg-title .torg-emoji {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}
.torg-compact .torg-title .torg-emoji svg {
    width: 16px;
    height: 16px;
}
.torg-compact .torg-desc {
    font-size: 12px;
    margin-bottom: 0;
    line-height: 1.3;
    color: #6a8b8d;
}
.torg-compact .torg-note {
    display: none;
}
.torg-compact .torg-card {
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    background: #ffffff;
    border: 1px solid #e0eae9;
    border-radius: 8px;
    max-width: 100%;
    margin: 0;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}
.torg-compact .torg-form-side {
    flex: 1 1 auto;
    max-width: 100%;
    margin-top: 0;
}
.torg-compact .torg-form {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    flex-wrap: nowrap;
}
.torg-compact .torg-input-group {
    flex: 1 1 100%;
    width: 100%;
}
.torg-compact .torg-input {
    height: 44px;
    border-radius: 22px;
    padding-left: 44px;
    padding-right: 130px;
    font-size: 14px;
}
.torg-compact .torg-input-icon {
    left: 16px;
}
.torg-compact .torg-submit {
    height: 36px;
    padding: 0 16px;
    top: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: 18px;
    font-size: 13px;
}
.torg-compact .torg-clear-btn {
    right: 90px;
    width: 20px;
    height: 20px;
}
.torg-compact .torg-help-wrapper {
    display: block;
    text-align: right;
    margin-top: -4px;
}
.torg-compact .torg-help-link {
    font-size: 12px;
}
.torg-compact .torg-message {
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 8px;
}

/* Скрываем все копии модуля, кроме первой (для главной страницы) */
.torg-wrap + .torg-wrap {
    display: none !important;
}

/* =========================================================
   ФИКС ВЫВОДА В JBD (Страница "Торговые точки")
   ========================================================= */

#jbd-geo-bar,
.jbd-geo-bar,
.jbd-geo-bar__checknumber,
.jbd-geo-bar__checknumber-form,
.jbd-geo-bar__checknumber-form .moduletable {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}

.jbd-geo-bar__checknumber-form .torg-wrap,
.jbd-geo-bar__checknumber-form .torg-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.jbd-geo-bar__checknumber-form .torg-card {
    padding: 24px 32px !important;
    margin-bottom: 20px !important;
}

.jbd-geo-bar__checknumber-form .torg-form-side {
    flex: 0 1 380px !important;
    max-width: 380px !important;
    min-width: 0 !important;
}

.jbd-geo-bar__checknumber-form .torg-submit {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10 !important;
    position: absolute !important;
    right: 6px !important;
    top: 6px !important;
    bottom: 6px !important;
}