/* Sistema de gestión de cookies: banner + panel de preferencias */

.cc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99998;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background-color: #1f2933;
    color: #f5f7fa;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .25);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.cc-banner[hidden] {
    display: none;
}

.cc-banner__text {
    flex: 1 1 420px;
    max-width: 860px;
}

.cc-banner__text a {
    color: #8ecdf8;
    text-decoration: underline;
}

.cc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
}

.cc-btn {
    cursor: pointer;
    border-radius: 4px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}

.cc-btn--primary {
    background-color: #2f80ed;
    color: #fff;
}

.cc-btn--primary:hover {
    background-color: #1f6fd6;
}

.cc-btn--outline {
    background-color: transparent;
    border-color: #cbd2d9;
    color: #f5f7fa;
}

.cc-btn--outline:hover {
    background-color: rgba(255, 255, 255, .1);
}

.cc-btn--text {
    background: none;
    color: #cbd2d9;
    text-decoration: underline;
}

.cc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background-color: rgba(15, 23, 32, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cc-modal-overlay[hidden] {
    display: none;
}

.cc-modal {
    background-color: #fff;
    color: #1f2933;
    border-radius: 6px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    font-family: Arial, Helvetica, sans-serif;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .3);
}

.cc-modal h2 {
    margin-top: 0;
    font-size: 20px;
}

.cc-modal p {
    font-size: 14px;
    line-height: 1.5;
}

.cc-modal__categories {
    margin: 16px 0;
    border-top: 1px solid #e4e7eb;
}

.cc-category {
    padding: 12px 0;
    border-bottom: 1px solid #e4e7eb;
}

.cc-category__header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cc-category__label {
    font-weight: 600;
    font-size: 14px;
}

.cc-category__description {
    margin: 6px 0 0;
    color: #52606d;
    font-size: 13px;
}

.cc-modal__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.cc-modal .cc-btn--outline {
    border-color: #cbd2d9;
    color: #1f2933;
}

.cc-modal .cc-btn--outline:hover {
    background-color: #f0f4f8;
}

/* Interruptor accesible tipo "switch" */
.cc-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex: 0 0 auto;
}

.cc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cc-switch__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd2d9;
    border-radius: 22px;
    transition: background-color .15s ease-in-out;
}

.cc-switch__slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform .15s ease-in-out;
}

.cc-switch input:checked + .cc-switch__slider {
    background-color: #2f80ed;
}

.cc-switch input:checked + .cc-switch__slider::before {
    transform: translateX(18px);
}

.cc-switch input:disabled + .cc-switch__slider {
    background-color: #a9dba0;
    cursor: not-allowed;
}

.cc-switch input:focus-visible + .cc-switch__slider {
    outline: 2px solid #2f80ed;
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .cc-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .cc-banner__actions {
        justify-content: stretch;
    }

    .cc-banner__actions .cc-btn {
        flex: 1 1 auto;
    }
}
