/**
 * Banner si panou de preferinte pentru cookie-uri.
 * Toate clasele sunt prefixate cu .cc- ca sa nu se ciocneasca cu Bootstrap
 * sau cu stilurile mostenite din webshopStyles74.
 *
 * Culoarea de accent se poate suprascrie per brand definind --cc-accent
 * pe :root, in CSS-ul brandului.
 */
:root {
    --cc-accent: #e8001d;
    --cc-accent-dark: #b5001a;
    --cc-text: #222222;
    --cc-muted: #555555;
    --cc-border: #e2e2e2;
    --cc-surface: #ffffff;
}

/* ------------------------------------------------------------------ banner */

.cc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: var(--cc-surface);
    border-top: 3px solid var(--cc-accent);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .14);
    transform: translateY(110%);
    transition: transform .25s ease-out;
    font-size: 14px;
    line-height: 1.6;
    color: var(--cc-text);
}

.cc-banner.is-visible {
    transform: translateY(0);
}

.cc-banner__inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cc-banner__copy {
    flex: 1 1 380px;
    min-width: 0;
}

.cc-banner__title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
}

.cc-banner__text {
    margin: 0;
    color: var(--cc-muted);
}

.cc-link {
    color: var(--cc-accent);
    text-decoration: underline;
}

.cc-link:hover {
    color: var(--cc-accent-dark);
}

.cc-banner__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ------------------------------------------------------------------ butoane */

.cc-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 9px 18px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s, color .15s, border-color .15s;
}

.cc-btn:focus-visible {
    outline: 2px solid var(--cc-accent);
    outline-offset: 2px;
}

.cc-btn--primary {
    background: var(--cc-accent);
    color: #fff;
}

.cc-btn--primary:hover {
    background: var(--cc-accent-dark);
}

.cc-btn--outline {
    background: transparent;
    color: var(--cc-text);
    border-color: var(--cc-border);
}

.cc-btn--outline:hover {
    border-color: var(--cc-muted);
}

.cc-btn--ghost {
    background: transparent;
    color: var(--cc-muted);
    text-decoration: underline;
    padding-left: 8px;
    padding-right: 8px;
}

.cc-btn--ghost:hover {
    color: var(--cc-text);
}

/* ------------------------------------------------------------------- modal */

.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity .2s ease-out;
}

.cc-modal.is-visible {
    opacity: 1;
}

.cc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
}

.cc-modal__card {
    position: relative;
    background: var(--cc-surface);
    border-radius: 10px;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
    color: var(--cc-text);
    font-size: 14px;
    line-height: 1.6;
}

.cc-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--cc-border);
}

.cc-modal__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.cc-modal__close {
    appearance: none;
    background: none;
    border: 0;
    font-size: 26px;
    line-height: 1;
    color: var(--cc-muted);
    cursor: pointer;
    padding: 0 4px;
}

.cc-modal__close:hover {
    color: var(--cc-text);
}

.cc-modal__body {
    padding: 8px 20px;
    overflow-y: auto;
}

.cc-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--cc-border);
}

/* ---------------------------------------------------------------- categorii */

.cc-cat {
    padding: 14px 0;
    border-bottom: 1px solid var(--cc-border);
}

.cc-cat:last-child {
    border-bottom: 0;
}

.cc-cat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cc-cat__name {
    font-weight: 600;
}

.cc-cat__locked {
    font-size: 12px;
    color: var(--cc-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

.cc-cat__desc {
    margin: 4px 0 0;
    color: var(--cc-muted);
}

/* Comutator on/off construit peste un checkbox real, ca sa ramana accesibil
   la tastatura si pentru cititoarele de ecran. */
.cc-switch {
    position: relative;
    flex-shrink: 0;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.cc-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.cc-switch__track {
    position: absolute;
    inset: 0;
    background: #c9c9c9;
    border-radius: 999px;
    transition: background-color .15s;
    pointer-events: none;
}

.cc-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform .15s;
}

.cc-switch input:checked + .cc-switch__track {
    background: var(--cc-accent);
}

.cc-switch input:checked + .cc-switch__track::after {
    transform: translateX(20px);
}

.cc-switch input:focus-visible + .cc-switch__track {
    outline: 2px solid var(--cc-accent);
    outline-offset: 2px;
}

body.cc-modal-open {
    overflow: hidden;
}

/* ------------------------------------------------------------------ mobil */

@media (max-width: 767px) {
    .cc-banner__inner {
        padding: 14px 16px;
        gap: 12px;
    }

    .cc-banner__actions {
        width: 100%;
    }

    .cc-banner__actions .cc-btn--outline,
    .cc-banner__actions .cc-btn--primary {
        flex: 1 1 0;
    }

    .cc-banner__actions .cc-btn--ghost {
        order: 3;
        width: 100%;
        text-align: center;
    }

    .cc-modal__foot .cc-btn {
        flex: 1 1 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cc-banner,
    .cc-modal,
    .cc-switch__track,
    .cc-switch__track::after {
        transition: none;
    }
}
