/* Дополнения к карточке партнёрского тура. Основное оформление берётся
   из tour-package-preview.css — здесь только то, чего нет у наших карточек. */

/* Одно фото отеля — крупнее и выше, чтобы уравновесить блок с параметрами */
.kompas-tour-item .tour-package-preview__hotel:has(.tour-package-preview__hotel-photos) {
    grid-template-columns: 118px minmax(0, 1fr);
    align-items: flex-start;
    gap: 14px;
}

.kompas-tour-item .tour-package-preview__hotel-photo {
    width: 118px;
    height: 128px;
    flex: 0 0 118px;
    border-radius: 9px;
}

.kompas-tour-item .tour-package-preview__hotel-photo::after {
    border-bottom-left-radius: 9px;
    border-bottom-right-radius: 9px;
}

.kompas-tour-item .tour-package-preview__hotel-photo small {
    right: 6px;
    bottom: 5px;
    left: 6px;
    font-size: 9px;
}

/* У партнёров нет кнопки «изменить отель» — не оставляем под неё пустое место */
.kompas-tour-item .tour-package-preview__hotel-topline,
.kompas-tour-item .tour-package-preview__hotel-name {
    padding-right: 0;
}

@media (max-width: 720px) {
    .kompas-tour-item .tour-package-preview__hotel:has(.tour-package-preview__hotel-photos) {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 12px;
    }

    .kompas-tour-item .tour-package-preview__hotel-photo {
        width: 96px;
        height: 108px;
        flex: 0 0 96px;
    }
}

.kompas-card__variants {
    margin-top: 8px;
    max-width: 100%;
}

.kompas-card__variants > small {
    display: block;
    margin-bottom: 6px;
    color: var(--package-muted, #667279);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.07em;
    line-height: 1;
    text-transform: uppercase;
}

.kompas-card__variants-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kompas-card__variants-field {
    position: relative;
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

.kompas-card__variants-select {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    min-height: 40px;
    padding: 0 36px 0 14px;
    border: 1px solid rgba(var(--package-accent-rgb, 11, 159, 109), 0.18);
    border-radius: 10px;
    background:
        #fff
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%230b9f6d' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
        no-repeat right 12px center;
    color: var(--package-ink, #17212b);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.2;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.kompas-card__variants-select:hover {
    border-color: rgba(var(--package-accent-rgb, 11, 159, 109), 0.32);
    background-color: #f8fbfa;
}

.kompas-card__variants-select:focus {
    border-color: rgba(var(--package-accent-rgb, 11, 159, 109), 0.45);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--package-accent-rgb, 11, 159, 109), 0.14);
}

/* Карандаш справа от селекта — как .tour-package-preview__edit у наших карточек */
.kompas-card__variants-edit {
    display: inline-flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(var(--package-accent-rgb, 11, 159, 109), 0.18);
    border-radius: 8px;
    background: #fff;
    color: var(--package-accent, #0b9f6d);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.kompas-card__variants-edit:hover {
    border-color: rgba(var(--package-accent-rgb, 11, 159, 109), 0.32);
    background: rgba(var(--package-accent-rgb, 11, 159, 109), 0.06);
    color: var(--package-accent, #0b9f6d);
}

.kompas-card__variants-edit:focus-visible {
    outline: 3px solid rgba(var(--package-accent-rgb, 11, 159, 109), 0.24);
    outline-offset: 2px;
}

.kompas-card__variants-edit svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kompas-card__description {
    margin: 12px 0 0;
    color: var(--package-muted, #667279);
    font-size: 13px;
    line-height: 1.5;
}

.kompas-card__advantages {
    margin-top: 10px;
}

/* Модалка заявки на тур партнёра */
.kompas-request-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483647 !important;
    isolation: isolate;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #e8edee;
}

.kompas-request-modal.active,
.kompas-request-modal:not([hidden]) {
    display: flex;
}

.kompas-request-modal[hidden] {
    display: none !important;
}

.kompas-request-modal__dialog {
    position: relative;
    display: flex;
    width: min(640px, 100%);
    max-height: calc(100dvh - 24px);
    margin: 0;
    padding: 18px 18px 14px;
    overflow: auto;
    border: 0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(0, 20, 20, 0.28);
    flex-direction: column;
}

.kompas-request-modal .popup.kompas-request-modal__dialog .popup__title,
.kompas-request-modal .popup__title {
    align-self: stretch;
    margin: 0 36px 8px;
    color: #17212b;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    text-align: center;
}

.kompas-request-modal__tour {
    align-self: stretch;
    margin: 0 0 12px;
    color: #667279;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

.kompas-request-modal__tour:empty {
    display: none;
}

.kompas-request-modal__form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.kompas-request-modal__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kompas-request-modal__field label {
    color: #586469;
    font-size: 12px;
    font-weight: 700;
}

.kompas-request-modal__field .form-control {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #dce4e1;
    border-radius: 12px;
    background: #fff;
    color: #17212b;
    font-size: 15px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.kompas-request-modal__field .form-control:focus {
    border-color: #98a2b3;
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 24, 40, 0.08);
}

.kompas-request-modal__field .form-control.is-invalid {
    border-color: var(--brand-accent, #cf454c);
    box-shadow: 0 0 0 3px rgba(var(--brand-accent-rgb, 207, 69, 76), 0.12);
}

.kompas-request-modal__field--phone .iti {
    width: 100%;
}

.kompas-request-modal__field--phone .iti__flag-container {
    border-radius: 12px 0 0 12px;
}

.kompas-request-modal__field--phone .iti--separate-dial-code .iti__selected-flag {
    background: #f0f4f3;
    border-radius: 12px 0 0 12px;
}

.kompas-request-modal__field--phone .iti input.form-control {
    padding-left: 92px;
}

.kompas-request-modal__error {
    color: var(--brand-accent, #b4372d);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.kompas-request-modal__note {
    margin: 0;
    color: #7a888e;
    font-size: 12px;
    line-height: 1.35;
}

.kompas-request-modal__consents {
    display: grid;
    gap: 10px;
    padding: 2px 0 4px;
    border: 0;
    background: transparent;
}

.kompas-request-modal__consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    color: #344054;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    user-select: none;
}

.kompas-request-modal__consent span {
    min-width: 0;
    padding-top: 1px;
}

.kompas-request-modal__consent input {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    border: 2px solid #c8d0ce;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.kompas-request-modal__consent input:hover {
    border-color: var(--brand-accent, #cf454c);
}

.kompas-request-modal__consent input:focus-visible {
    outline: none;
    border-color: var(--brand-accent, #cf454c);
    box-shadow: 0 0 0 3px rgba(var(--brand-accent-rgb, 207, 69, 76), 0.18);
}

.kompas-request-modal__consent input:checked {
    border-color: var(--brand-accent, #cf454c);
    background-color: var(--brand-accent, #cf454c);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.4 6.2l2.5 2.5 4.7-5.2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
}

.kompas-request-modal__consent input:checked:hover {
    border-color: var(--brand-accent, #cf454c);
}

.kompas-request-modal .checkout-auth--embedded {
    margin-top: 0;
}

.kompas-request-modal .checkout-auth__embedded-card {
    padding: 16px;
}

.kompas-request-modal .checkout-auth__embedded-verification {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.kompas-request-modal .checkout-auth__title {
    font-size: 18px;
}

.kompas-request-modal .checkout-auth__description {
    margin-bottom: 14px;
    font-size: 12px;
}

.kompas-request-modal .checkout-auth__overlay {
    z-index: 20;
}

.kompas-request-modal__confirmation {
    margin: 0;
    color: #17212b;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.4;
}

.kompas-request-modal:has(.checkout-profile-details:not([hidden])) .kompas-request-modal__confirmation {
    display: none;
}

.kompas-request-modal .checkout-profile-details {
    margin: 0;
    padding: 0;
}

.kompas-request-modal .checkout-profile-details__title {
    font-size: 15px;
}

.kompas-request-modal .checkout-profile-details__hint {
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.35;
}

.kompas-request-modal .checkout-profile-details__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px 10px;
}

.kompas-request-modal .checkout-profile-details__cell--wide {
    grid-column: span 2;
}

.kompas-request-modal .checkout-profile-details__grid label {
    margin-bottom: 4px;
    font-size: 11px;
}

.kompas-request-modal .checkout-profile-details__grid input.form-control {
    height: 40px;
}

.kompas-request-modal__actions {
    display: flex;
    gap: 8px;
    justify-content: stretch;
    padding-top: 2px;
}

.kompas-request-modal__submit {
    flex: 1 1 auto;
    width: auto;
    min-height: 42px;
}

.kompas-request-modal__cancel {
    flex: 0 0 auto;
    min-width: 104px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid #e1e7e5;
    border-radius: 12px;
    background: #fff;
    color: #586469;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.kompas-request-modal__cancel:hover,
.kompas-request-modal__cancel:focus-visible {
    border-color: #b7c4c0;
    outline: none;
    background: #f0f4f3;
}

.kompas-request-modal__submit.is-loading {
    opacity: 0.72;
    pointer-events: none;
}

.kompas-request-modal__status {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.4;
}

.kompas-request-modal__status.is-success {
    background: rgba(var(--red-color-rgb, 11, 159, 109), 0.1);
    color: var(--red-color, #0b7a55);
}

.kompas-request-modal__status.is-error {
    background: rgba(var(--brand-accent-rgb, 207, 69, 76), 0.1);
    color: var(--brand-accent, #b4372d);
}

@media (max-width: 640px) {
    .kompas-request-modal .checkout-profile-details__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .kompas-request-modal .checkout-profile-details__cell--wide {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .kompas-request-modal {
        padding: 8px;
        align-items: flex-end;
    }

    .kompas-request-modal__dialog {
        width: 100%;
        max-height: calc(100dvh - 12px);
        border-radius: 18px 18px 12px 12px;
        padding: 16px 14px 12px;
    }

    .kompas-request-modal .popup.kompas-request-modal__dialog .popup__title,
    .kompas-request-modal .popup__title {
        margin: 0 32px 6px;
        font-size: 22px;
    }
}

/* Без фото блок отеля занимает всю ширину — пустая колонка не нужна */
.tour-package-preview__hotel:not(:has(.tour-package-preview__hotel-photos)) {
    grid-template-columns: minmax(0, 1fr);
}

/* Попап «Подробнее» тура партнёра — та же сетка/скролл, что у нашего тура */
.kompas-popup .tour__content-head .kompas-popup__hotel {
    margin: 8px 0 0;
    color: var(--tour-popup-muted, #5b6b7f);
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.35;
}

.kompas-popup .tour__content-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kompas-popup__section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kompas-popup__description {
    margin: 0;
    color: #3d4a51;
    font-size: 14px;
    line-height: 1.55;
}

.kompas-popup__advantages {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.kompas-popup__advantages li {
    position: relative;
    padding: 10px 12px 10px 34px;
    border: 1px solid var(--tour-popup-line, #e6ebf1);
    border-radius: 12px;
    background: #fff;
    color: #3d4a51;
    font-size: 13px;
    line-height: 1.45;
}

.kompas-popup__advantages li::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tour-popup-accent, var(--brand-accent, #cf454c));
    box-shadow: 0 0 0 4px rgba(var(--tour-popup-accent-rgb, var(--brand-accent-rgb, 207, 69, 76)), 0.12);
}

.kompas-popup__facts {
    display: grid;
    gap: 0;
    margin: 0;
    border: 1px solid var(--tour-popup-line, #e6ebf1);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.kompas-popup__fact {
    display: grid;
    grid-template-columns: minmax(110px, 38%) minmax(0, 1fr);
    gap: 12px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--tour-popup-line, #e6ebf1);
    font-size: 13px;
    line-height: 1.4;
}

.kompas-popup__fact:last-child {
    border-bottom: 0;
}

.kompas-popup__fact-label {
    color: var(--tour-popup-muted, #5b6b7f);
    font-weight: 650;
}

.kompas-popup__fact-value {
    color: var(--tour-popup-ink, #1a2433);
    font-weight: 700;
}

.kompas-popup__subtitle {
    margin: 0;
    color: var(--tour-popup-ink, #1a2433);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.kompas-popup__variants {
    display: grid;
    gap: 8px;
}

.kompas-popup__variant {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--tour-popup-line, #e6ebf1);
    border-radius: 12px;
    background: #fff;
}

.kompas-popup__variant.is-current {
    border-color: rgba(11, 159, 109, 0.28);
    background: rgba(11, 159, 109, 0.08);
}

.kompas-popup__variant-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.kompas-popup__variant-main strong {
    color: var(--tour-popup-ink, #1a2433);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.35;
}

.kompas-popup__variant-main span {
    color: var(--tour-popup-muted, #5b6b7f);
    font-size: 12px;
    font-weight: 600;
}

.kompas-popup__variant-price {
    flex: 0 0 auto;
    color: var(--tour-popup-ink, #1a2433);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.kompas-popup__cta {
    margin-top: 4px;
    padding: 16px;
    border: 1px solid var(--tour-popup-line, #e6ebf1);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(var(--tour-popup-accent-rgb, var(--brand-accent-rgb, 207, 69, 76)), 0.06), #fff 46%),
        #fff;
}

.kompas-popup__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    margin-bottom: 12px;
}

.kompas-popup__price strong {
    color: var(--tour-popup-ink, #1a2433);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.kompas-popup__price small {
    color: var(--tour-popup-muted, #5b6b7f);
    font-size: 12px;
    line-height: 1.45;
}

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

/* Hidden fields must not occupy grid cells (author `input { display:block }` can override UA). */
.kompas-popup__form input[type="hidden"] {
    display: none !important;
}

.kompas-popup__form .form-control {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #dce4e1;
    border-radius: 12px;
    background: #fff;
    color: var(--tour-popup-ink, #1a2433);
    font-size: 14px;
}

.kompas-popup__form .form-control:focus {
    outline: none;
    border-color: #98a2b3;
    box-shadow: 0 0 0 3px rgba(16, 24, 40, 0.08);
}

.kompas-popup__form .kompas-popup__field-email,
.kompas-popup__form .tour-package-preview__book,
.kompas-popup__form button[type="submit"] {
    grid-column: 1 / -1;
}

.kompas-popup__form .tour-package-preview__book,
.kompas-popup__form button[type="submit"] {
    width: 100%;
    margin-top: 2px;
}

.kompas-popup__cta > .tour-package-preview__book {
    width: 100%;
    margin-top: 10px;
}

.kompas-popup__note {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--tour-popup-line, #e6ebf1);
    border-radius: 12px;
    background: rgba(var(--tour-popup-accent-rgb, var(--brand-accent-rgb, 207, 69, 76)), 0.05);
    color: var(--tour-popup-muted, #5b6b7f);
    font-size: 13px;
    line-height: 1.5;
}

/* Без галереи — компактная одноколоночная карточка, без пустой левой половины */
.kompas-popup.kompas-popup--no-media .tour {
    width: min(720px, 100%);
    height: auto;
    max-height: min(860px, calc(100vh - 48px));
    gap: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.kompas-popup.kompas-popup--no-media .tour__content,
.kompas-popup .tour:not(:has(.tour__slider)) .tour__content {
    flex: 1 1 100%;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
}

.kompas-popup.kompas-popup--no-media .tour__content-body {
    flex: 0 0 auto;
    overflow: visible;
    scrollbar-gutter: auto;
}

.kompas-popup.kompas-popup--no-media .tour__content-head {
    position: sticky;
    top: 0;
}

@media (max-width: 992px) {
    .kompas-popup .tour__content-head .kompas-popup__hotel {
        text-transform: none;
        letter-spacing: 0;
    }

    .kompas-popup.kompas-popup--no-media .tour {
        width: 100%;
        max-height: calc(100vh - 24px);
    }
}

@media (max-width: 580px) {
    .kompas-popup__fact {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .kompas-popup__form {
        grid-template-columns: 1fr;
    }

    .kompas-popup__variant {
        align-items: flex-start;
        flex-direction: column;
    }

    .kompas-popup.kompas-popup--no-media .tour {
        max-height: 100%;
        min-height: 0;
    }
}

/* На телефоне фото и параметры друг под другом во всю ширину: две колонки
   96px + остаток оставляли названию отеля и параметрам ~130px, и тексты
   обрезались («NATUR…») при свободном месте справа. Правило с :has
   перебивает мобильную укладку из tour-package-preview.css, поэтому
   стек задаём здесь той же специфичностью. */
@media (max-width: 580px) {
    .kompas-tour-item .tour-package-preview__hotel:has(.tour-package-preview__hotel-photos) {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .kompas-tour-item .tour-package-preview__hotel-photo {
        width: 100%;
        height: 150px;
        flex: 0 0 auto;
    }
}

/* Предупреждение оператора в попапе: «отель не размещает мужчин» и подобное */
.kompas-popup__operator-note {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fff5e6;
    border: 1px solid #f3d9ac;
    color: #7a5209;
    font-weight: 600;
}
