/* ═══════════════════════════════════════════════════════════════════
   Главная страница киоска.
   Свёрстано mobile-first: базовые правила — для телефона,
   медиазапросы расширяют раскладку для планшета и киоска.
   ═══════════════════════════════════════════════════════════════════ */

.home-wrap { padding: 0.5rem 0 1.2rem; }

/* ─────────────────────────────────────────────────────────────────
   Строка выбора места
   ───────────────────────────────────────────────────────────────── */
.hm-place {
    background: #fff;
    border: 1px solid #e6eaef;
    border-radius: 14px;
    padding: 0.7rem 0.8rem;
    margin-bottom: 0.8rem;
    box-shadow: 0 1px 3px rgba(16,24,40,.04);
}
.hm-place-top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}
.hm-place-label {
    font-size: 0.78rem;
    color: #667085;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.hm-place-name {
    font-size: 1rem;
    font-weight: 700;
    color: #101828;
}
.hm-place-change {
    margin-left: auto;
    font-size: 0.76rem;
    color: #2b7fb8;
    background: none;
    border: none;
    padding: 0.2rem 0.3rem;
    cursor: pointer;
    text-decoration: underline;
}
.hm-place-note {
    font-size: 0.72rem;
    color: #98a2b3;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.hm-chips { display: grid; grid-template-columns: 1fr; gap: 0.45rem; }
.hm-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.7rem 0.8rem;
    border-radius: 11px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    min-height: 46px;                 /* комфортная цель для пальца */
    transition: transform .15s ease, box-shadow .15s ease;
}
.hm-chip:hover, .hm-chip:active { color:#fff; text-decoration:none; transform: translateY(-1px); }
.hm-chip-weather { background: #2bb3c0; }
.hm-chip-plant   { background: #4caf7d; }
.hm-chip-warn    { background: #e0655c; }
.hm-chip-pick    { background: #3d7fb5; }

/* ─────────────────────────────────────────────────────────────────
   Заголовок и раскладка
   ───────────────────────────────────────────────────────────────── */
.hm-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #101828;
    margin: 0 0 0.7rem;
}
.hm-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    align-items: stretch;             /* колонки одной высоты */
}
.hm-main { display: flex; flex-direction: column; gap: 0.75rem; }
.hm-side { display: flex; flex-direction: column; }

/* ─────────────────────────────────────────────────────────────────
   Плитки разделов
   ───────────────────────────────────────────────────────────────── */
.hm-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 104px;
    gap: 0.6rem;
}
.hm-tile {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    padding: 0.75rem 0.85rem;
    text-decoration: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: transform .16s ease, box-shadow .16s ease;
    box-shadow: 0 1px 3px rgba(16,24,40,.08);
}
.hm-tile:hover, .hm-tile:active {
    color:#fff; text-decoration:none;
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(16,24,40,.16);
}
.hm-tile-name { font-size: 0.92rem; font-weight: 700; line-height: 1.2; position: relative; z-index: 2; }
.hm-tile-sub  { font-size: 0.7rem; opacity: .85; margin-top: 0.2rem; line-height: 1.3; position: relative; z-index: 2; max-width: 90%; }
.hm-tile-icon { position: absolute; right: -8px; bottom: -14px; font-size: 3.6rem; opacity: .22; z-index: 1; pointer-events: none; }

.hm-tile.is-wide { grid-column: span 2; }
.hm-tile.is-wide .hm-tile-name { font-size: 1.05rem; }
.hm-tile.is-wide .hm-tile-icon { font-size: 4.6rem; }

.t-weather { background: #2bb3c0; }
.t-market  { background: #f0913f; }
.t-plant   { background: #4caf7d; }
.t-warn    { background: #e0655c; }
.t-harvest { background: #efb42b; }
.t-res     { background: #8b7ff0; }
.t-contact { background: #94a3b3; }

/* ─────────────────────────────────────────────────────────────────
   Рекламная панель: видео занимает карточку целиком
   ───────────────────────────────────────────────────────────────── */
.hm-promo {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #10314d;
    box-shadow: 0 2px 10px rgba(16,24,40,.12);
    aspect-ratio: 16 / 9;             /* на телефоне — привычная пропорция */
    width: 100%;
}
.hm-promo-body { position: absolute; inset: 0; }
.hm-promo-body video,
.hm-promo-body iframe,
.hm-promo-body img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;                /* заполняет карточку без полей */
    border: none;
    display: block;
}
.hm-promo-empty {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #9fb4c7; font-size: 0.85rem; text-align: center; padding: 1rem;
}

/* врезка предупреждения — занимает место рекламы */
.hm-alert {
    border-radius: 16px;
    flex: 1 1 auto;
    padding: 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    background: linear-gradient(160deg, #d64545 0%, #a82f2f 100%);
    box-shadow: 0 2px 10px rgba(16,24,40,.12);
    min-height: 190px;
}
.hm-alert-icon  { font-size: 2.2rem; margin-bottom: 0.5rem; }
.hm-alert-title { font-size: 1.15rem; font-weight: 800; line-height: 1.25; margin-bottom: 0.4rem; }
.hm-alert-text  { font-size: 0.88rem; line-height: 1.5; opacity: .95; }
.hm-alert.is-warning { background: linear-gradient(160deg, #e08a2e 0%, #b8691a 100%); }
.hm-alert.is-info    { background: linear-gradient(160deg, #2f7fb8 0%, #1f5f8d 100%); }
.hm-alert.is-success { background: linear-gradient(160deg, #3d9e6b 0%, #2b7650 100%); }

/* ─────────────────────────────────────────────────────────────────
   Логотип донора
   ───────────────────────────────────────────────────────────────── */
.hm-donor {
    background: #fff;
    border: 1px solid #e6eaef;
    border-radius: 15px;
    padding: 0.7rem;
    text-align: center;
}
.hm-donor img { max-width: 100%; height: auto; cursor: pointer; }

/* ─────────────────────────────────────────────────────────────────
   Модальное окно выбора места
   ───────────────────────────────────────────────────────────────── */
.hm-modal {
    position: fixed; inset: 0; z-index: 3000;
    background: rgba(16,24,40,.55);
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.hm-modal.open { display: flex; }
.hm-modal-box {
    background: #fff;
    width: 100%;
    max-height: 85vh;
    border-radius: 18px 18px 0 0;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.hm-modal-head {
    padding: 0.9rem 1rem 0.7rem;
    border-bottom: 1px solid #eef1f4;
}
.hm-modal-title { font-size: 1rem; font-weight: 700; color: #101828; margin-bottom: 0.6rem; }
.hm-modal-search {
    width: 100%;
    border: 1px solid #dfe4ea;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    outline: none;
}
.hm-modal-search:focus { border-color: #2b7fb8; }
.hm-modal-list { overflow-y: auto; padding: 0.4rem 0 0.8rem; -webkit-overflow-scrolling: touch; }
.hm-modal-group {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: .4px;
    color: #98a2b3; padding: 0.7rem 1rem 0.3rem; font-weight: 700;
}
.hm-modal-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.7rem 1rem;
    font-size: 0.92rem; color: #1d2939;
    cursor: pointer; border: none; background: none; width: 100%; text-align: left;
    min-height: 46px;
}
.hm-modal-item:hover, .hm-modal-item:active { background: #f4f7fa; }
.hm-modal-item .badge-serv {
    margin-left: auto; font-size: 0.64rem; padding: 2px 7px; border-radius: 20px;
    background: #e7f5ef; color: #2f7d5b; font-weight: 700; white-space: nowrap;
}
.hm-modal-item .badge-wx {
    margin-left: auto; font-size: 0.64rem; padding: 2px 7px; border-radius: 20px;
    background: #e8f2f8; color: #2b6f96; font-weight: 700; white-space: nowrap;
}
.hm-modal-close {
    padding: 0.8rem 1rem; border-top: 1px solid #eef1f4;
    text-align: center; font-size: 0.9rem; color: #667085;
    background: none; border-left: none; border-right: none; border-bottom: none;
    cursor: pointer; width: 100%;
}

/* ═════════════════════════════════════════════════════════════════
   ПЛАНШЕТ  ≥ 640px
   ═════════════════════════════════════════════════════════════════ */
@media (min-width: 640px) {
    .hm-chips { grid-template-columns: repeat(3, 1fr); }
    .hm-chips.is-single { grid-template-columns: minmax(200px, 260px); }
    .hm-tiles { grid-auto-rows: 112px; gap: 0.65rem; }
    .hm-modal { align-items: center; }
    .hm-modal-box { max-width: 560px; border-radius: 18px; max-height: 78vh; }
}

/* ═════════════════════════════════════════════════════════════════
   ШИРОКИЙ ЭКРАН / КИОСК  ≥ 1024px
   ═════════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
    .hm-layout { grid-template-columns: 1.45fr 1fr; gap: 1rem; }
    .hm-tiles  { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 118px; gap: 0.7rem; }
    .hm-tile.is-tall { grid-row: span 2; }
    .hm-tile.is-tall .hm-tile-name { font-size: 1.05rem; }
    .hm-tile.is-tall .hm-tile-icon { font-size: 4.6rem; }

    /* Правая колонка — flex-контейнер: и видео, и предупреждение
       занимают всю её высоту. Растяжение передаётся через обёртку
       #alert-banner, иначе height:100% считается от неё, а не от колонки. */
    .hm-side { height: 100%; }
    .hm-side > #alert-banner { display: flex; flex-direction: column; }
    .hm-side.has-alert > #alert-banner { flex: 1 1 auto; min-height: 0; }
    .hm-alert { flex: 1 1 auto; min-height: 0; height: auto; }
    .hm-promo { aspect-ratio: auto; flex: 1 1 auto; min-height: 0; height: auto; }
    .hm-alert-icon  { font-size: 2.6rem; }
    .hm-alert-title { font-size: 1.3rem; }
    .hm-alert-text  { font-size: 0.92rem; }

    .hm-donor img { max-width: 72%; }
    .hm-section-title { font-size: 1.15rem; }
}
