/* ========================================
   АМС MAP BLOCK — cascading selects + Yandex map + info card
   Matches the Figma "Доступные АМС" section.
   ======================================== */

.ams-map-section {
    --ams-accent: #E8912C;
    --ams-title: #1A1A1A;
    --ams-muted: #6B7280;
    --ams-value: #2F3A45;
    --ams-border: #D0D5DD;

    position: relative;
    box-sizing: border-box;
    padding: 4rem 0;
}

/* Title + selects: normal document flow, bounded by the parent column —
   never overlaps a page sidebar next to it. */
.ams-map-section__inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Map + card row: width / margin-left set by JS so it keeps the Figma width
   regardless of the parent column — see sizeAmsBleed in map.html. */
.ams-map__bleed {
    box-sizing: border-box;
}

.ams-map__bleed-inner {
    max-width: 1648px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Heading ── */

.ams-map__title {
    margin: 0 0 3.25rem;
    font-size: 2rem;
    line-height: 1.25;
    font-weight: 700;
    color: var(--ams-title);
    text-align: center;
}

/* ── Cascading selects ── */

.ams-map__selects {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem 2.25rem;
    margin-bottom: 5.25rem;
}

.ams-map__select-wrap {
    display: flex;
    flex-direction: column;
    width: 288px;
}

.ams-map__label {
    margin-bottom: 0.6rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ams-title);
}

.ams-map__select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    border: 1px solid var(--ams-border);
    border-radius: 8px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23667085'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 1.15rem;
    font-size: 1rem;
    color: var(--ams-value);
    cursor: pointer;
}

.ams-map__select:hover:not(:disabled) {
    border-color: #98A2B3;
}

.ams-map__select:focus {
    outline: none;
    border-color: var(--ams-accent);
    box-shadow: 0 0 0 3px rgba(232, 145, 44, 0.15);
}

.ams-map__select:disabled {
    cursor: not-allowed;
    color: var(--ams-muted);
    background-color: #FCFCFD;
}

/* ── Map + card row ── */

.ams-map__row {
    display: flex;
    align-items: stretch;
    gap: 1.5rem;
    margin-top: 2rem;
    width: 1600px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.ams-map__map-wrap {
    flex: 1 1 auto;
    min-width: 0;
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.12);
}

.ams-map__canvas {
    width: 100%;
    height: 100%;
}

.ams-map__external {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #00309E;
    text-decoration: underline;
}

/* ── Info card ── */

.ams-map__card {
    flex: 0 0 332px;
    width: 332px;
    height: 600px;
    box-sizing: border-box;
    padding: 1.5rem;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Fixed header (name + region, up to the divider) — stays put while the body scrolls */
.ams-card__fixed {
    flex: 0 0 auto;
}

/* Scrollable field list below the divider */
.ams-card__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.ams-card__body::-webkit-scrollbar {
    width: 6px;
}

.ams-card__body::-webkit-scrollbar-thumb {
    background: var(--ams-border);
    border-radius: 999px;
}

.ams-card__empty {
    margin: 0;
    color: var(--ams-muted);
}

.ams-card__head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.ams-card__icon {
    flex: 0 0 auto;
    width: auto;
    height: 34px;
}

.ams-card__title {
    margin: 0;
    font-size: 1.6rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--ams-title);
    word-break: break-word;
}

.ams-card__region {
    margin: 0.4rem 0 0;
    font-size: 0.95rem;
    color: var(--ams-muted);
}

.ams-card__divider {
    height: 1.5px;
    margin: 0.9rem 0 1.1rem;
    background: var(--ams-accent);
}

.ams-card__row + .ams-card__row {
    margin-top: 0.9rem;
}

.ams-card__label {
    margin: 0 0 0.15rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ams-accent);
}

.ams-card__value {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--ams-value);
    white-space: pre-line;
}

/* ── Responsive ── */

@media (max-width: 1100px) {
    .ams-map__row {
        flex-direction: column;
    }

    .ams-map__card {
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        max-height: 420px;
    }
}

@media (max-width: 640px) {
    .ams-map-section {
        padding: 2.5rem 0;
    }

    .ams-map__title {
        font-size: 1.5rem;
        margin-bottom: 1.75rem;
    }

    .ams-map__select-wrap {
        width: 100%;
    }

    .ams-map__map-wrap {
        height: 420px;
    }
}
