/* ===== Popup by button: centred card on desktop, bottom sheet on mobile ===== */
.hm-pop {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: grid;
    place-items: center;
    padding: 24px;
    font-family: var(--hm-font-body);
}
.hm-pop[hidden] { display: none; }
.hm-pop__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    transition: opacity .3s var(--hm-ease);
}
.hm-pop.is-open .hm-pop__backdrop { opacity: 1; }

.hm-pop__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    max-height: calc(100svh - 48px);
    overflow: hidden;
    border-radius: var(--hm-radius-card);
    background: var(--hm-c-bg);
    color: var(--hm-c-text);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
    opacity: 0;
    transform: translateY(24px) scale(.98);
    transition: opacity .3s var(--hm-ease), transform .4s var(--hm-ease);
    outline: none;
}
.hm-pop.is-open .hm-pop__dialog { opacity: 1; transform: none; }
.hm-pop__scroll { overflow-y: auto; overscroll-behavior: contain; }

.hm-pop__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--hm-c-text);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
    cursor: pointer;
    transition: transform var(--hm-dur) var(--hm-ease), background-color var(--hm-dur);
}
.hm-pop__close:hover { transform: rotate(90deg); background: #fff; }
.hm-pop__close svg { width: 22px; height: 22px; }

.hm-pop__media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--hm-c-alt); }
.hm-pop__img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); }

.hm-pop__body { display: flex; flex-direction: column; padding: 28px 32px 32px; }
.hm-pop__title {
    margin: 0;
    font-family: var(--hm-font-head);
    font-size: var(--hm-fs-h3);
    font-weight: var(--hm-head-weight);
    line-height: var(--hm-head-lh);
    text-wrap: balance;
}
.hm-pop__title em { font-style: var(--hm-accent-style); }
.hm-pop__subtitle {
    margin: 8px 0 0;
    color: var(--hm-c-muted);
    font-size: var(--hm-fs-small);
    font-weight: 400;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.hm-pop__text { margin-top: 18px; font-size: 14.5px; }
.hm-pop__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hm-pop__actions:empty { display: none; }

/* ---------- Mobile: bottom sheet ---------- */
@media (max-width: 767px) {
    .hm-pop { place-items: end stretch; padding: 0; }
    .hm-pop__dialog {
        width: 100%;
        max-height: calc(100svh - 32px);
        border-radius: var(--hm-radius-card) var(--hm-radius-card) 0 0;
        opacity: 1;
        transform: translateY(100%);
        transition: transform .38s var(--hm-ease);
    }
    .hm-pop__close { top: 12px; right: 12px; width: 38px; height: 38px; }
    .hm-pop__media { aspect-ratio: 3 / 2; }
    .hm-pop__body { padding: 22px 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
    .hm-pop__actions { flex-direction: column; }
    .hm-pop__actions .hm-btn { width: 100%; }
}

/* ---------- Layout "choice": no photo, title + stacked buttons ---------- */
.hm-pop--choice .hm-pop__dialog { width: min(440px, 100%); }
.hm-pop--choice .hm-pop__body { align-items: stretch; padding: 48px 36px 36px; text-align: center; }
.hm-pop--choice .hm-pop__text { margin-top: 10px; color: var(--hm-c-muted); }
.hm-pop--choice .hm-pop__actions { flex-direction: column; margin-top: 24px; }
.hm-pop--choice .hm-pop__actions .hm-btn { width: 100%; }
@media (max-width: 767px) {
    .hm-pop--choice .hm-pop__dialog { width: 100%; }
    .hm-pop--choice .hm-pop__body { padding: 44px 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
}
