/**
 * Banner y panel de preferencias de cookies.
 *
 * Todo va bajo el prefijo .busae-cc y con los tamaños en píxeles porque el
 * banner convive con AdminLTE, Bootstrap 3 y el CSS del login, cada uno con
 * sus propias reglas para button/label/input.
 */

.busae-cc,
.busae-cc *,
.busae-cc *::before,
.busae-cc *::after {
    box-sizing: border-box;
}

.busae-cc [hidden] {
    display: none !important;
}

.busae-cc {
    position: relative;
    z-index: 20000;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #24313d;
}

/* ------------------------------------------------------------------ */
/* Banner                                                              */
/* ------------------------------------------------------------------ */

.busae-cc__banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20001;
    background: #ffffff;
    border-top: 4px solid #125781;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.18);
    padding: 18px 20px;
}

.busae-cc__banner-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.busae-cc__text {
    flex: 1 1 420px;
    min-width: 260px;
}

.busae-cc__title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: bold;
    color: #125781;
}

.busae-cc__description {
    margin: 0;
    font-size: 14px;
}

.busae-cc__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

/* ------------------------------------------------------------------ */
/* Botones                                                             */
/* ------------------------------------------------------------------ */

.busae-cc__btn {
    display: inline-block;
    margin: 0;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.busae-cc__btn:focus {
    outline: 2px solid #125781;
    outline-offset: 2px;
}

.busae-cc__btn--primary {
    background: #125781;
    border-color: #125781;
    color: #ffffff;
}

.busae-cc__btn--primary:hover,
.busae-cc__btn--primary:focus {
    background: #0d405f;
    border-color: #0d405f;
    color: #ffffff;
}

.busae-cc__btn--secondary {
    background: #ffffff;
    border-color: #125781;
    color: #125781;
}

.busae-cc__btn--secondary:hover,
.busae-cc__btn--secondary:focus {
    background: #eef4f8;
    color: #0d405f;
}

.busae-cc__btn--link {
    padding: 10px 8px;
    color: #125781;
    font-weight: normal;
    text-decoration: underline;
}

.busae-cc__btn--link:hover,
.busae-cc__btn--link:focus {
    color: #0d405f;
}

.busae-cc__link {
    color: #125781;
    text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/* Panel de preferencias                                               */
/* ------------------------------------------------------------------ */

.busae-cc__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20002;
    background: rgba(0, 0, 0, 0.55);
}

.busae-cc__panel {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 20003;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    max-width: 640px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.35);
}

.busae-cc__panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8ee;
}

.busae-cc__panel-title {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #125781;
}

.busae-cc__close {
    padding: 0 6px;
    border: 0;
    background: none;
    font-size: 26px;
    line-height: 1;
    color: #6b7c8c;
    cursor: pointer;
}

.busae-cc__close:hover,
.busae-cc__close:focus {
    color: #24313d;
}

.busae-cc__panel-body {
    padding: 18px 20px;
    overflow-y: auto;
}

.busae-cc__panel-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e2e8ee;
}

.busae-cc__intro {
    margin: 0 0 16px;
}

/* ------------------------------------------------------------------ */
/* Categorías                                                          */
/* ------------------------------------------------------------------ */

.busae-cc__group {
    padding: 14px 0;
    border-top: 1px solid #e2e8ee;
}

.busae-cc__group:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.busae-cc__group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.busae-cc__group-title {
    margin: 0;
    font-size: 15px;
    font-weight: bold;
}

.busae-cc__group-text {
    margin: 0;
    font-size: 13px;
    color: #52616f;
}

.busae-cc__always {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: bold;
    color: #2e7d32;
}

/* Interruptor: el checkbox real queda accesible pero oculto tras el dibujo. */
.busae-cc__switch {
    position: relative;
    flex: 0 0 auto;
    display: inline-block;
    width: 48px;
    height: 26px;
    margin: 0;
}

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

.busae-cc__switch-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #b9c4ce;
    border-radius: 26px;
    transition: background 0.15s ease-in-out;
    pointer-events: none;
}

.busae-cc__switch-slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.15s ease-in-out;
}

.busae-cc__switch input:checked + .busae-cc__switch-slider {
    background: #125781;
}

.busae-cc__switch input:checked + .busae-cc__switch-slider::before {
    transform: translateX(22px);
}

.busae-cc__switch input:focus + .busae-cc__switch-slider {
    outline: 2px solid #125781;
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Móvil                                                               */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
    .busae-cc__banner {
        padding: 16px;
        max-height: 80vh;
        overflow-y: auto;
    }

    .busae-cc__actions {
        width: 100%;
    }

    .busae-cc__actions .busae-cc__btn {
        flex: 1 1 140px;
    }

    .busae-cc__panel-footer .busae-cc__btn {
        flex: 1 1 140px;
    }
}
