/* RDY.cz — spodní lišta na mobilu a tabletu (templates/mobile-tabbar.php).
   Plovoucí lišta s 5 položkami + panel „Nástroje" vysouvaný zespodu. Na desktopu skrytá. */

.rdy-tabbar, .rdy-sheet, .rdy-sheet-backdrop { display: none; }

@media (max-width: 1024px) {
    :root { --rdy-tabbar-space: calc(78px + env(safe-area-inset-bottom, 0px)); }

    /* Hamburger a horní „Registrace" nahrazuje lišta */
    .mobile-menu-toggle, .rdy-header-actions .rdy-head-register, .rdy-header-actions .rdy-dash-btn { display: none !important; }
    .rdy-header-actions .btn-text-mobile-hide.rdy-head-login { display: inline-flex !important; }
    body { padding-bottom: var(--rdy-tabbar-space); }

    .rdy-tabbar {
        display: flex; position: fixed; z-index: 195; /* nad panelem nástrojů, pod cookie lištou */
        left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        max-width: 520px; margin: 0 auto; padding: 6px; gap: 4px;
        border-radius: 22px; border: 1px solid var(--border);
        background: color-mix(in srgb, var(--surface) 86%, transparent);
        -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
        box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .06);
    }
    .rdy-tab {
        flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        padding: 8px 2px 7px; border: 0; border-radius: 16px; background: transparent;
        color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; line-height: 1.1; text-decoration: none;
        cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .18s ease, color .18s ease, transform .12s ease;
    }
    .rdy-tab svg { width: 23px; height: 23px; }
    .rdy-tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .rdy-tab:active { transform: scale(.94); }
    .rdy-tab.active, .rdy-tab.open { color: var(--accent-ink); background: var(--accent-soft); }
    .rdy-tab-cta { color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #7c3aed)); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
    .rdy-tab-cta.active { color: #fff; background: var(--accent); }

    /* Panel nástrojů */
    .rdy-sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 185; background: rgba(0, 0, 0, .38); animation: rdy-fade .2s ease; }
    .rdy-sheet {
        display: block; position: fixed; z-index: 190; left: 0; right: 0; bottom: 0;
        max-height: min(78vh, 640px); overflow-y: auto; overscroll-behavior: contain;
        padding: 10px 16px calc(var(--rdy-tabbar-space) + 8px);
        border-radius: 24px 24px 0 0; background: var(--bg); box-shadow: 0 -18px 40px -16px rgba(0, 0, 0, .35);
        animation: rdy-sheet-up .26s cubic-bezier(.2, .8, .2, 1);
    }
    .rdy-sheet[hidden], .rdy-sheet-backdrop[hidden] { display: none; }
    .rdy-sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 0 auto 10px; }
    .rdy-sheet-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 12px; }
    .rdy-sheet-head strong { font-size: 17px; letter-spacing: -.01em; }
    .rdy-sheet-close { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--fg); cursor: pointer; }
    .rdy-sheet-close svg { width: 18px; height: 18px; }
    .rdy-sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .rdy-sheet-item { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--fg); text-decoration: none; min-width: 0; }
    .rdy-sheet-item.active { border-color: var(--accent); background: var(--accent-soft); }
    .rdy-sheet-ico { flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
    .rdy-sheet-ico svg { width: 21px; height: 21px; }
    .rdy-sheet-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
    .rdy-sheet-txt strong { font-size: 14px; font-weight: 600; line-height: 1.2; }
    .rdy-sheet-txt em { font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: .04em; color: var(--accent-ink); background: var(--accent-soft); padding: 1px 5px; border-radius: 999px; vertical-align: 2px; }
    .rdy-sheet-txt small { font-size: 11.5px; line-height: 1.3; color: var(--muted); }
    .rdy-sheet-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
    .rdy-sheet-links a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 999px; background: var(--surface-2); color: var(--fg); font-size: 13.5px; font-weight: 500; text-decoration: none; }
    .rdy-sheet-links a svg { width: 17px; height: 17px; color: var(--muted); }
    .rdy-sheet-links a.danger { color: var(--danger); }
    .rdy-sheet-links a.danger svg { color: var(--danger); }
    html.rdy-sheet-open { overflow: hidden; }

    /* Prvky přichycené dole posunout nad lištu */
    .webpj-bar { bottom: var(--rdy-tabbar-space); }
    #cookieSettingsIcon { bottom: calc(var(--rdy-tabbar-space) + 6px) !important; }
    #cookieConsentBanner[style*="bottom"] { bottom: var(--rdy-tabbar-space) !important; }
    .fb-fab { bottom: calc(var(--rdy-tabbar-space) + 6px); }
}
@media (max-width: 360px) { .rdy-tab { font-size: 10px; } .rdy-tab svg { width: 21px; height: 21px; } }

@keyframes rdy-sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rdy-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rdy-sheet, .rdy-sheet-backdrop { animation: none; } }
