/* ── Overlay ── */
#cm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 999999;
    padding: 0 16px 20px;
    box-sizing: border-box;
}

#cm-overlay.cm-hidden {
    display: none;
}

/* ── Modal ── */
#cm-modal {
    background: #AF754D;
    border-radius: 24px;
    max-width: 960px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.3);
}

/* ── Inner layout ── */
.cm-inner {
    display: flex;
    align-items: flex-end;
    gap: 0;
}

/* ── Left: mascot ── */
.cm-left {
    flex-shrink: 0;
    width: 28%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px 0 0 20px;
}

.cm-mascot {
    width: 100%;
    max-width: 220px;
    display: block;
}

/* ── Right: content ── */
.cm-right {
    flex: 1;
    padding: 28px 36px 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.cm-title {
    width: 100%;
    max-width: 480px;
    height: auto;
    min-height: 40px;
    display: block;
}

.cm-subtitle {
    width: 100%;
    max-width: 260px;
    height: auto;
    min-height: 20px;
    display: block;
}

.cm-desc {
    width: 100%;
    max-width: 440px;
    height: auto;
    min-height: 50px;
    display: block;
}

/* ── Buttons ── */
.cm-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.cm-btn {
    border: none;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.18s, transform 0.12s;
    line-height: 1;
}

.cm-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.cm-btn:active {
    transform: translateY(0);
}

.cm-btn img {
    height: 15px;
    width: auto;
    display: block;
}

.cm-btn-predvolby { background: #C28C65; }
.cm-btn-souhlasim { background: #FAEDE5; }
.cm-btn-odmitam   { background: #C28861; }

/* ── Preferences panel ── */
#cm-predvolby-panel {
    display: none;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    padding: 18px 20px;
    flex-direction: column;
    gap: 10px;
}

#cm-predvolby-panel.cm-open {
    display: flex;
}

.cm-pref-row label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #fff;
    cursor: pointer;
}

.cm-pref-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #FAEDE5;
}

.cm-pref-row span {
    font-size: 14px;
    font-weight: 600;
}

.cm-pref-row small {
    display: block;
    font-size: 12px;
    opacity: 0.75;
    font-weight: 400;
}

.cm-btn-potvrdit {
    align-self: flex-start;
    margin-top: 4px;
    color: #AF754D;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 10px 22px;
    border-radius: 10px;
}

/* ── Více informací link ── */
.cm-vice {
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    padding: 0;
    display: inline-block;
    transition: opacity 0.18s;
}

.cm-vice:hover { opacity: 0.7; }

.cm-vice img {
    height: 14px;
    width: auto;
    display: block;
}

/* ── Tablet (max 900px) ── */
@media (max-width: 900px) {
    .cm-left  { width: 28%; }
    .cm-right { padding: 32px 32px 32px 16px; }
    .cm-btn   { padding: 11px 18px; }
    .cm-btn img { height: 16px; }
}

/* ── Mobile (max 640px) ── */
@media (max-width: 640px) {
    #cm-overlay { padding: 0; align-items: flex-end; }

    #cm-modal { border-radius: 22px 22px 0 0; max-height: 92vh; }

    .cm-inner {
        flex-direction: column;
        align-items: center;
    }

    .cm-left {
        width: 100%;
        padding: 20px 20px 0;
        justify-content: center;
    }

    .cm-mascot { max-width: 140px; }

    .cm-right {
        padding: 18px 20px 28px;
        gap: 14px;
    }

    .cm-title { max-width: 100%; }
    .cm-desc  { max-width: 100%; }

    .cm-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .cm-btn {
        width: 100%;
        padding: 14px;
        border-radius: 14px;
    }

    .cm-btn img { height: 17px; }

    .cm-btn-potvrdit { align-self: stretch; text-align: center; }
}
