/**
 * WooCommerce EU Compliance — Banner de cookies GDPR.
 * Sin frameworks. Los colores llegan como variables CSS inline desde
 * gdpr.js (wcecGdpr.colors), con estos valores como base.
 */

.wcec-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 999999;
    box-sizing: border-box;
    background: var(--wcec-bar-bg, #1d2327);
    color: var(--wcec-text, #ffffff);
    padding: 16px 20px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.35);
}

.wcec-banner--bottom { bottom: 0; }
.wcec-banner--top { top: 0; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }

.wcec-banner--modal {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(560px, calc(100% - 32px));
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.wcec-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.wcec-banner--modal .wcec-banner__inner,
.wcec-panel__inner {
    flex-direction: column;
    align-items: stretch;
}

.wcec-banner__content {
    flex: 1 1 320px;
    min-width: 0;
}

.wcec-banner__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
    color: inherit;
}

.wcec-banner__message {
    margin: 0 0 6px;
}

.wcec-banner__links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.wcec-banner__link {
    color: inherit;
    text-decoration: underline;
    font-size: 13px;
}

.wcec-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
}

.wcec-btn {
    appearance: none;
    border: 0;
    border-radius: 4px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
}

.wcec-btn:focus-visible,
.wcec-reopen:focus-visible,
.wcec-panel__close:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.wcec-btn--accept {
    background: var(--wcec-accept-bg, #00a32a);
    color: var(--wcec-accept-color, #ffffff);
}

.wcec-btn--reject {
    background: var(--wcec-reject-bg, #6c757d);
    color: var(--wcec-reject-color, #ffffff);
}

.wcec-btn--settings {
    background: var(--wcec-settings-bg, #2271b1);
    color: var(--wcec-settings-color, #ffffff);
}

/* Panel de preferencias */

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

.wcec-panel__close {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}

.wcec-panel__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.wcec-panel__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.wcec-panel__item input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.wcec-panel__item input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.wcec-panel__item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wcec-panel__item-label {
    font-weight: 600;
}

.wcec-panel__item-desc {
    font-size: 13px;
    opacity: 0.85;
}

.wcec-panel__actions {
    justify-content: flex-end;
}

/* Gestor reabrible */

.wcec-reopen {
    position: fixed;
    z-index: 999998;
    appearance: none;
    border: 0;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: var(--wcec-bar-bg, #1d2327);
    color: var(--wcec-text, #ffffff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
}

.wcec-reopen:hover {
    opacity: 1;
}

.wcec-reopen--bottom-left { left: 16px; bottom: 16px; }
.wcec-reopen--bottom-right { right: 16px; bottom: 16px; }

@media (max-width: 600px) {
    .wcec-banner__actions,
    .wcec-panel__actions {
        width: 100%;
        flex-direction: column;
    }

    .wcec-btn {
        width: 100%;
    }
}
