/**
 * File: promo_bar.css
 * Verze a aktuální datum: 17-11-26 v_1.00
 */
.th-pbar {
    --pb-gold: #f9c343;
    --pb-gold-2: #ffdb7a;
    --pb-bg: rgba(20, 20, 20, 0.94);
    --pb-line: rgba(249, 195, 67, 0.38);
    --pb-text: #ffffff;
    --pb-muted: #c4c4c4;
    --pb-chip: rgba(255, 255, 255, 0.08);
    position: fixed;
    z-index: 99990;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: min(1200px, calc(100% - 32px));
    transform: translate(-50%, 24px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
    font-family: inherit;
    line-height: 1.25;
    color: var(--pb-text);
    text-align: left;
    -webkit-font-smoothing: antialiased;
}
.th-pbar[hidden] { display: none; }
.th-pbar.is-in { transform: translate(-50%, 0); opacity: 1; }
.th-pbar.is-out { transform: translate(-50%, 24px); opacity: 0; }

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

.th-pbar__card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto 36px;
    grid-template-areas: "main timer actions close";
    align-items: center;
    gap: 20px;
    padding: 12px 12px 12px 14px;
    border: 1px solid var(--pb-line);
    border-radius: 20px;
    background:
        radial-gradient(120% 160% at 0% 50%, rgba(249, 195, 67, 0.16) 0%, rgba(249, 195, 67, 0) 55%),
        var(--pb-bg);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Štítek a text */
.th-pbar__main { grid-area: main; display: flex; align-items: center; gap: 14px; min-width: 0; }
.th-pbar__badge {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    height: 52px;
    padding: 0 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--pb-gold-2) 0%, var(--pb-gold) 55%, #e9a91c 100%);
    color: #111;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.02em;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(249, 195, 67, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.th-pbar__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.th-pbar__eyebrow {
    font-size: 13px;
    font-weight: 600;
    color: var(--pb-gold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.th-pbar__title {
    font-size: 18px;
    font-weight: 800;
    color: var(--pb-text);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* Odpočet */
.th-pbar__timer { grid-area: timer; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.th-pbar__t-label { margin-right: 4px; font-size: 12px; color: var(--pb-muted); }
.th-pbar__t {
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    min-width: 40px;
    justify-content: center;
    padding: 6px 7px;
    border-radius: 9px;
    background: var(--pb-chip);
    border: 1px solid rgba(255, 255, 255, 0.07);
}
.th-pbar__t b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--pb-text); }
.th-pbar__t i { font-size: 11px; font-style: normal; color: var(--pb-muted); }

/* Kód a tlačítko */
.th-pbar__actions { grid-area: actions; display: flex; align-items: center; gap: 10px; }
.th-pbar .th-pbar__code {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    margin: 0;
    padding: 0 14px;
    border: 1.5px dashed rgba(249, 195, 67, 0.7);
    border-radius: 12px;
    background: rgba(249, 195, 67, 0.08);
    color: var(--pb-gold);
    font: inherit;
    cursor: pointer;
    text-transform: none;
    box-shadow: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.th-pbar .th-pbar__code:hover { background: rgba(249, 195, 67, 0.16); }
.th-pbar .th-pbar__code:focus-visible,
.th-pbar .th-pbar__cta:focus-visible,
.th-pbar .th-pbar__close:focus-visible { outline: 2px solid var(--pb-gold); outline-offset: 2px; }
.th-pbar__code-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--pb-muted); }
.th-pbar__code-value { font-size: 15px; font-weight: 800; letter-spacing: 0.06em; color: var(--pb-gold); white-space: nowrap; }
.th-pbar__icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.th-pbar__icon--ok { display: none; color: #5fd68a; }
.th-pbar__code.is-copied { border-style: solid; border-color: #5fd68a; background: rgba(95, 214, 138, 0.12); }
.th-pbar__code.is-copied .th-pbar__icon--copy { display: none; }
.th-pbar__code.is-copied .th-pbar__icon--ok { display: block; }
.th-pbar__copied {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    padding: 0;
    border-radius: 8px;
    background: #5fd68a;
    color: #0d2416;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
}
.th-pbar__copied:not(:empty) { padding: 4px 9px; }

.th-pbar a.th-pbar__cta,
.th-pbar a.th-pbar__cta:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--pb-gold-2) 0%, var(--pb-gold) 100%);
    color: #111;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(249, 195, 67, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.th-pbar a.th-pbar__cta:hover { color: #111; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(249, 195, 67, 0.4); }
.th-pbar__arrow { transition: transform 0.15s ease; }
.th-pbar__cta-short { display: none; }
.th-pbar a.th-pbar__cta:hover .th-pbar__arrow { transform: translateX(3px); }

.th-pbar .th-pbar__close {
    -webkit-appearance: none;
    appearance: none;
    grid-area: close;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--pb-chip);
    color: var(--pb-muted);
    cursor: pointer;
    box-shadow: none;
    transition: background 0.2s ease, color 0.2s ease;
}
.th-pbar .th-pbar__close:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

.th-pbar__sr { position: fixed; top: 0; left: -9999px; opacity: 0; }

/* Místo pro kartu na konci stránky, aby nezakrývala patičku */
html.th-pbar-on body { padding-bottom: var(--th-pbar-space, 120px); }

/* Střední šířky: odpočet pod text, akce vpravo */
@media (max-width: 1240px) {
    .th-pbar__card {
        grid-template-columns: minmax(0, 1fr) auto 36px;
        grid-template-areas:
            "main actions close"
            "timer actions close";
        row-gap: 8px;
    }
    .th-pbar__timer { padding-left: 90px; }
}

/* Telefon */
@media (max-width: 760px) {
    .th-pbar {
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        width: calc(100% - 16px);
    }
    .th-pbar__card {
        grid-template-columns: minmax(0, 1fr) 32px;
        grid-template-areas:
            "main close"
            "timer timer"
            "actions actions";
        gap: 9px;
        padding: 12px;
        border-radius: 18px;
    }
    .th-pbar__main { gap: 11px; }
    .th-pbar__badge { min-width: 60px; height: 44px; padding: 0 9px; border-radius: 12px; font-size: 18px; }
    .th-pbar__eyebrow { font-size: 12px; white-space: normal; }
    .th-pbar__title { font-size: 15px; white-space: normal; }
    .th-pbar .th-pbar__close { width: 32px; height: 32px; align-self: start; }
    .th-pbar__timer { padding-left: 0; gap: 4px; }
    .th-pbar__t { min-width: 0; padding: 3px 6px; border-radius: 7px; }
    .th-pbar__t b { font-size: 13px; }
    .th-pbar__t i { font-size: 10px; }
    .th-pbar__t-label { font-size: 12px; }
    .th-pbar__actions { gap: 8px; }
    .th-pbar .th-pbar__code { flex: 1 1 auto; min-width: 0; height: 42px; padding: 0 12px; justify-content: center; }
    .th-pbar__code-label { display: none; }
    .th-pbar__code-value { font-size: 14px; letter-spacing: 0.03em; }
    .th-pbar a.th-pbar__cta { flex: none; height: 42px; padding: 0 16px; font-size: 14px; }
    .th-pbar__cta-long { display: none; }
    .th-pbar__cta-short { display: inline; }
}

/* Úzký telefon (320–360 px) */
@media (max-width: 360px) {
    .th-pbar .th-pbar__code { padding: 0 10px; gap: 6px; }
    .th-pbar a.th-pbar__cta { padding: 0 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .th-pbar,
    .th-pbar a.th-pbar__cta,
    .th-pbar__arrow { transition: none; }
}
