/* =========================================================
   Demo stránka košíku – styly.
   ========================================================= */

:root {
    --demo-color-bg:      #f3f4f6;
    --demo-color-surface: #ffffff;
    --demo-color-border:  #e5e7eb;
    --demo-color-text:    #111827;
    --demo-color-muted:   #6b7280;
    --demo-color-primary: #2563eb;
    --demo-color-primary-hover: #1d4ed8;
    --demo-color-success: #059669;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: var(--demo-color-text);
    background: var(--demo-color-bg);
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
    padding: 1px 5px;
    background: #f3f4f6;
    border-radius: 4px;
}

/* --- Hlavička --------------------------------------------------- */
.demo-header {
    background: var(--demo-color-surface);
    border-bottom: 1px solid var(--demo-color-border);
}

.demo-header__inner {
    max-width: 880px;
    margin: 0 auto;
    padding: 24px 20px;
}

.demo-header__title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
}

.demo-header__subtitle {
    margin: 0;
    color: var(--demo-color-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* --- Hlavní obsah ----------------------------------------------- */
.demo-main {
    max-width: 880px;
    margin: 0 auto;
    padding: 24px 20px 64px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.demo-section {
    background: var(--demo-color-surface);
    border: 1px solid var(--demo-color-border);
    border-radius: 10px;
    padding: 20px 22px;
}

.demo-section__title {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.demo-section__hint {
    margin: 0 0 12px;
    color: var(--demo-color-muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.demo-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--demo-color-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

/* --- Karta dopravy --------------------------------------------- */
.demo-shipping-card {
    border: 1px solid var(--demo-color-border);
    border-radius: 8px;
    padding: 16px 18px;
    background: #fafbfc;
}

.demo-shipping-card__label {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--demo-color-muted);
}

.demo-shipping-card__empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.demo-shipping-card__empty-text {
    margin: 0;
    color: var(--demo-color-muted);
    font-size: 13px;
}

.demo-shipping-card__selected {
    /* žádné speciální styly – obsah řídí demo-shipping-card__selected-head */
}

.demo-shipping-card__selected-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.demo-shipping-card__selected-name {
    margin: 0 0 4px;
    font-weight: 600;
    font-size: 14px;
}

.demo-shipping-card__selected-address {
    margin: 0 0 8px;
    color: var(--demo-color-muted);
    font-size: 12.5px;
}

.demo-shipping-card__selected-meta {
    margin: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* --- Tlačítka -------------------------------------------------- */
.demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    font-family: inherit;
}

.demo-btn--primary {
    background: var(--demo-color-primary);
    color: #fff;
    border-color: var(--demo-color-primary);
}

.demo-btn--primary:hover {
    background: var(--demo-color-primary-hover);
    border-color: var(--demo-color-primary-hover);
}

.demo-btn--ghost {
    background: transparent;
    color: var(--demo-color-primary);
    border-color: var(--demo-color-border);
}

.demo-btn--ghost:hover {
    border-color: var(--demo-color-primary);
    color: var(--demo-color-primary-hover);
}

.demo-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .35);
}

/* --- Pilly s metadaty výběru ----------------------------------- */
.demo-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2px;
}

/* --- Debug výpis ---------------------------------------------- */
.demo-debug {
    margin: 0;
    padding: 14px 16px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    line-height: 1.55;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* --- Modal ---------------------------------------------------- */
.demo-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.demo-modal[hidden] {
    display: none;
}

.demo-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
}

.demo-modal__panel {
    position: relative;
    z-index: 1;
    margin: auto;
    /*
     * Iframe vyplňuje prakticky celé okno – widget (sidebar 560 px +
     * mapa) si svůj vnitřní layout řídí sám. Maximální šířka se
     * ponechává jen jako pojistka proti roztažení na ultraširokých
     * displejích (4K), kde by pravý okraj mapy zbytečně utíkal.
     */
    width: min(1900px, calc(100% - 16px));
    height: min(900px, calc(100% - 16px));
    background: var(--demo-color-surface);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.demo-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--demo-color-border);
}

.demo-modal__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.demo-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--demo-color-muted);
    transition: background .15s, color .15s, border-color .15s;
}

.demo-modal__close:hover {
    background: #f3f4f6;
    color: var(--demo-color-text);
    border-color: var(--demo-color-border);
}

.demo-modal__iframe {
    flex: 1;
    border: 0;
    width: 100%;
    height: 100%;
}

/* --- Responzivita ---------------------------------------------- */
@media (max-width: 600px) {
    .demo-header__inner,
    .demo-main {
        padding-left: 14px;
        padding-right: 14px;
    }

    .demo-modal__panel {
        width: calc(100% - 8px);
        height: calc(100% - 8px);
        border-radius: 8px;
    }
}