/* =============================================================
   Apoing Cookie Consent v1.0
   GDPR / LOPDGDD / ePrivacy compliant
   ============================================================= */

/* ── Banner (barra inferior) ─────────────────────────────────── */
#apoing-cb {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #fff;
    box-shadow: 0 -2px 16px rgba(0,0,0,.12);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.apoing-cb__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.apoing-cb__text {
    flex: 1;
    min-width: 220px;
}

.apoing-cb__text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    color: #111;
}

.apoing-cb__text p {
    margin: 0;
    color: #555;
}

.apoing-cb__text a {
    color: #F47D44;
    text-decoration: underline;
}

.apoing-cb__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}

/* ── Botones ─────────────────────────────────────────────────── */
.apoing-cb__btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background .2s, border-color .2s, color .2s;
    white-space: nowrap;
    line-height: 1.4;
}

.apoing-cb__btn--primary {
    background: #F47D44;
    color: #fff;
    border-color: #F47D44;
}

.apoing-cb__btn--primary:hover {
    background: #d9622e;
    border-color: #d9622e;
}

.apoing-cb__btn--secondary {
    background: transparent;
    color: #333;
    border-color: #ccc;
}

.apoing-cb__btn--secondary:hover {
    border-color: #F47D44;
    color: #F47D44;
}

.apoing-cb__btn--full {
    width: 100%;
    text-align: center;
}

/* ── Panel de preferencias (modal) ───────────────────────────── */
#apoing-cb-panel {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.apoing-cb__panel-inner {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
    margin: 16px;
}

.apoing-cb__panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.apoing-cb__panel-header strong {
    font-size: 16px;
    color: #111;
}

.apoing-cb__close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
}

.apoing-cb__close:hover {
    color: #111;
    background: #f5f5f5;
}

.apoing-cb__panel-body {
    padding: 8px 0;
    flex: 1;
}

.apoing-cb__category {
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.apoing-cb__category:last-child {
    border-bottom: none;
}

.apoing-cb__category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.apoing-cb__category-info strong {
    display: block;
    font-size: 14px;
    color: #111;
    margin-bottom: 4px;
}

.apoing-cb__category-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.apoing-cb__always-on {
    font-size: 12px;
    color: #4caf50;
    font-weight: 600;
    white-space: nowrap;
    padding-top: 2px;
    flex-shrink: 0;
}

/* Toggle switch */
.apoing-cb__toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.apoing-cb__toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.apoing-cb__toggle-slider {
    display: block;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    transition: background .2s;
    flex-shrink: 0;
}

.apoing-cb__toggle-slider::after {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    margin: 3px;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.apoing-cb__toggle input:checked ~ .apoing-cb__toggle-slider {
    background: #F47D44;
}

.apoing-cb__toggle input:checked ~ .apoing-cb__toggle-slider::after {
    transform: translateX(20px);
}

.apoing-cb__toggle input:focus ~ .apoing-cb__toggle-slider {
    outline: 2px solid #F47D44;
    outline-offset: 2px;
}

.apoing-cb__panel-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

/* ── Botón flotante ──────────────────────────────────────────── */
#apoing-cb-fab {
    position: fixed;
    bottom: 70px;
    left: 16px;
    z-index: 99998;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #ddd;
    color: #666;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color .2s, color .2s, box-shadow .2s;
}

#apoing-cb-fab:hover {
    border-color: #F47D44;
    color: #F47D44;
    box-shadow: 0 4px 12px rgba(244,125,68,.3);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .apoing-cb__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .apoing-cb__actions {
        flex-direction: column;
    }

    .apoing-cb__btn {
        text-align: center;
        width: 100%;
    }

    .apoing-cb__panel-inner {
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
        height: 100%;
    }
}
