/* ============================================================
   Banyoles Ocupació — Banner de consentiment de cookies
   Estils autònoms (no depenen del Sass del theme ni de Bootstrap).
   Paleta del theme SOM: marca #0095b2, text #3e3e3e, Montserrat.
   Els botons i interruptors usen #007489 (variant fosca de la marca): amb text blanc
   arriba a contrast AA (5,4:1); el #0095b2 només arriba a 3,5:1.
   Prefix de classe: .oc-cc → evita col·lisions amb el theme.
   Marcatge: Controls/Cookies.ascx · Lògica: js/cookies.js
   ============================================================ */

.oc-cc {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: none;
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    color: #3e3e3e;
    border-top: 3px solid #0095b2;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
    font-family: Montserrat, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    -webkit-text-size-adjust: 100%;
}

.oc-cc.is-visible { display: block; }

.oc-cc:focus { outline: none; }

.oc-cc *,
.oc-cc *::before,
.oc-cc *::after { box-sizing: border-box; }

.oc-cc__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px calc(20px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 28px;
}

.oc-cc__body { flex: 1 1 420px; min-width: 260px; }

.oc-cc .oc-cc__title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: #3e3e3e;
}

.oc-cc p {
    margin: 0;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.55;
    color: #3e3e3e;
}

.oc-cc a,
.oc-cc a:visited {
    color: #007489;
    font-weight: 600;
    text-decoration: underline;
}

.oc-cc a:hover,
.oc-cc a:focus { color: #004f5e; }

/* -------- Botons -------- */
.oc-cc__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

.oc-cc .oc-cc__btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-block;
    min-height: 44px;
    margin: 0;
    padding: 11px 20px;
    cursor: pointer;
    border: 2px solid #007489;
    border-radius: 4px;
    background: #fff;
    color: #007489;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    text-align: center;
    text-transform: none;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.oc-cc .oc-cc__btn:hover { background: #e6f4f7; }

/* «Rebutja» i «Accepta-ho tot» comparteixen aquest estil: mateix pes visual. */
.oc-cc .oc-cc__btn--primary {
    background: #007489;
    border-color: #007489;
    color: #fff;
}

.oc-cc .oc-cc__btn--primary:hover {
    background: #005f70;
    border-color: #005f70;
    color: #fff;
}

.oc-cc .oc-cc__btn:focus-visible,
.oc-cc-fab:focus-visible,
.oc-cc__switch input:focus-visible + .oc-cc__slider {
    outline: 3px solid #0095b2;
    outline-offset: 2px;
}

/* -------- Panell de preferències -------- */
.oc-cc__prefs {
    flex-basis: 100%;
    display: none;
    flex-wrap: wrap;
    gap: 16px 32px;
    margin-top: 6px;
    padding-top: 16px;
    border-top: 1px solid #d9d9d9;
}

.oc-cc.is-prefs-open .oc-cc__prefs { display: flex; }

.oc-cc__row {
    flex: 1 1 280px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.oc-cc .oc-cc__ct { display: block; flex: 1; }

.oc-cc .oc-cc__ct b {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #3e3e3e;
}

.oc-cc .oc-cc__ct span {
    display: block;
    margin-top: 3px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #595959;
}

.oc-cc .oc-cc__ct code {
    padding: 0;
    background: none;
    color: inherit;
    font-size: inherit;
}

.oc-cc__row--action {
    flex-basis: 100%;
    justify-content: flex-end;
    align-items: center;
}

/* -------- Interruptor (switch) accessible -------- */
.oc-cc .oc-cc__switch {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 46px;
    height: 26px;
    margin: 2px 0 0;
    padding: 0;
    cursor: pointer;
}

.oc-cc .oc-cc__switch input {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.oc-cc .oc-cc__switch input:disabled { cursor: not-allowed; }

.oc-cc__slider {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 26px;
    background: #767676;
    transition: background-color 0.2s;
    pointer-events: none;
}

.oc-cc__slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}

.oc-cc__switch input:checked + .oc-cc__slider { background: #007489; }
.oc-cc__switch input:checked + .oc-cc__slider::before { transform: translateX(20px); }
.oc-cc__switch input:disabled + .oc-cc__slider { opacity: 0.6; }

/* -------- Botó flotant per reobrir les preferències --------
   (la home no té peu: aquest botó és present a tots els skins un cop hi ha decisió) */
.oc-cc-fab {
    -webkit-appearance: none;
    appearance: none;
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 99990;
    display: none;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #007489;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transition: background-color 0.2s, transform 0.2s;
}

.oc-cc-fab.is-visible { display: flex; }
.oc-cc-fab:hover { background: #005f70; transform: scale(1.06); }

.oc-cc-fab svg {
    display: block;
    width: 24px;
    height: 24px;
    fill: currentColor;
    pointer-events: none;
}

/* -------- Responsiu -------- */
@media (max-width: 767px) {
    .oc-cc__inner { padding: 16px; gap: 12px; }
    .oc-cc__actions { width: 100%; }
    .oc-cc .oc-cc__btn { flex: 1 1 auto; }
    .oc-cc__row { flex-basis: 100%; }
    .oc-cc__row--action .oc-cc__btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .oc-cc .oc-cc__btn,
    .oc-cc__slider,
    .oc-cc__slider::before,
    .oc-cc-fab { transition: none; }
    .oc-cc-fab:hover { transform: none; }
}

@media print {
    .oc-cc,
    .oc-cc-fab { display: none !important; }
}
