/* ============================================================================
   cookie-consent.css
   Styly k znovupoužitelné cookie liště (cookie-consent.js).
   Barvy přebírá z proměnných webu, ale má fallbacky – funguje i samostatně
   na jiném projektu, stačí přiložit tenhle soubor + JS.
   ============================================================================ */

.cc-root {
    --cc-ink:     var(--ink, #15243B);
    --cc-surface: var(--surface, #ffffff);
    --cc-muted:   var(--muted, #5A6573);
    --cc-line:    var(--line, #E2E1DA);
    --cc-brand:   var(--brand, #0C7C72);
    --cc-accent:  var(--accent, #FF6B4A);
    --cc-accent-fg: #2A0F08;
    --cc-radius:  16px;
    font-family: var(--font-body, system-ui, -apple-system, "Segoe UI", sans-serif);
}

/* Skryjeme dokud JS nerozhodne, že se má lišta zobrazit */
.cc-root[hidden] { display: none; }

/* ---------------------------------------------------------------------------
   LIŠTA (první vrstva)
--------------------------------------------------------------------------- */
.cc-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 9999;
    max-width: 760px;
    margin-inline: auto;
    background: var(--cc-surface);
    color: var(--cc-ink);
    border: 1px solid var(--cc-line);
    border-radius: var(--cc-radius);
    box-shadow: 0 20px 50px rgba(21, 36, 59, .22);
    padding: 1.4rem 1.5rem;
    animation: cc-slide-up .4s cubic-bezier(.22, 1, .36, 1) both;
}
.cc-banner__title {
    font-family: var(--font-display, inherit);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 .5rem;
    color: var(--cc-ink);
}
.cc-banner__text {
    font-size: .95rem;
    line-height: 1.6;
    color: var(--cc-muted);
    margin: 0 0 1.1rem;
}
.cc-banner__text a {
    color: var(--cc-brand);
    text-decoration: underline;
}
.cc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

/* ---------------------------------------------------------------------------
   TLAČÍTKA – „Přijmout" i „Odmítnout" mají stejnou váhu (požadavek EU)
--------------------------------------------------------------------------- */
.cc-btn {
    flex: 1 1 auto;
    min-width: 140px;
    padding: .8rem 1.2rem;
    font: inherit;
    font-weight: 600;
    font-size: .95rem;
    line-height: 1;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, background-color .2s ease, border-color .2s ease;
}
.cc-btn:hover { transform: translateY(-2px); }
.cc-btn:active { transform: translateY(0); }
.cc-btn:focus-visible {
    outline: 3px solid var(--cc-brand);
    outline-offset: 3px;
}
.cc-btn--accept {
    background: var(--cc-accent);
    color: var(--cc-accent-fg);
}
.cc-btn--accept:hover { background: var(--cc-accent, #ED5230); filter: brightness(.95); }
.cc-btn--reject {
    background: var(--cc-ink);
    color: #fff;
}
.cc-btn--settings {
    background: transparent;
    color: var(--cc-ink);
    border-color: var(--cc-line);
    flex-basis: 100%;
    flex-grow: 0;
}

/* ---------------------------------------------------------------------------
   MODAL S NASTAVENÍM (druhá vrstva)
--------------------------------------------------------------------------- */
.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.cc-modal[hidden] { display: none; }
.cc-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 27, 45, .55);
    animation: cc-fade .3s ease both;
}
.cc-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--cc-surface);
    color: var(--cc-ink);
    border-radius: var(--cc-radius);
    box-shadow: 0 24px 60px rgba(21, 36, 59, .3);
    padding: clamp(1.5rem, 4vw, 2.25rem);
    animation: cc-slide-up .35s cubic-bezier(.22, 1, .36, 1) both;
}
.cc-modal__title {
    font-family: var(--font-display, inherit);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 .5rem;
}
.cc-modal__intro {
    font-size: .95rem;
    line-height: 1.6;
    color: var(--cc-muted);
    margin: 0 0 1.5rem;
}

/* Jednotlivé kategorie cookies */
.cc-cat {
    border: 1px solid var(--cc-line);
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    margin-bottom: .85rem;
}
.cc-cat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .4rem;
}
.cc-cat__name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--cc-ink);
}
.cc-cat__desc {
    font-size: .88rem;
    line-height: 1.55;
    color: var(--cc-muted);
    margin: 0;
}

/* Přepínač (toggle) */
.cc-switch {
    position: relative;
    flex: none;
    width: 46px;
    height: 26px;
}
.cc-switch input {
    position: absolute;
    opacity: 0;
    width: 100%; height: 100%;
    margin: 0;
    cursor: pointer;
}
.cc-switch__track {
    position: absolute;
    inset: 0;
    background: #C9CBD0;
    border-radius: 999px;
    transition: background-color .2s ease;
    pointer-events: none;
}
.cc-switch__track::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s ease;
}
.cc-switch input:checked + .cc-switch__track { background: var(--cc-brand); }
.cc-switch input:checked + .cc-switch__track::after { transform: translateX(20px); }
.cc-switch input:focus-visible + .cc-switch__track {
    outline: 3px solid var(--cc-brand);
    outline-offset: 2px;
}
.cc-switch input:disabled + .cc-switch__track { background: var(--cc-brand); opacity: .55; cursor: not-allowed; }
.cc-switch input:disabled { cursor: not-allowed; }

.cc-cat__locked {
    font-size: .78rem;
    font-weight: 600;
    color: var(--cc-brand);
    white-space: nowrap;
}

.cc-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-top: 1.5rem;
}

/* ---------------------------------------------------------------------------
   ANIMACE + OMEZENÝ POHYB
--------------------------------------------------------------------------- */
@keyframes cc-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }
}
@keyframes cc-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .cc-banner,
    .cc-modal__overlay,
    .cc-modal__dialog { animation: none; }
    .cc-btn:hover { transform: none; }
}

/* ---------------------------------------------------------------------------
   RESPONZIVITA
--------------------------------------------------------------------------- */
@media (min-width: 560px) {
    .cc-btn--settings { flex-basis: auto; }
}
