/**
 * Wimakeit_Gdpr — Cookie Consent Banner v3
 * Compatible: Luma, Hyva, Breeze
 */

/* Overlay */
.wm-gdpr-overlay {
    position: fixed; inset: 0; z-index: 9998;
    background: rgba(0,0,0,0.3); backdrop-filter: blur(3px);
    opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.wm-gdpr-overlay.active { opacity: 1; pointer-events: auto; }

/* Wall mode */
.wm-gdpr-wall { overflow: hidden !important; }

/* Banner base */
.wm-gdpr-banner {
    position: fixed; z-index: 9999;
    background: #fff;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s;
    opacity: 0; pointer-events: none;
}
.wm-gdpr-banner.active { opacity: 1; pointer-events: auto; }

/* Bar bottom-left */
.wm-gdpr-banner.bar-bottom {
    bottom: 20px; left: 20px; right: auto;
    max-width: 420px; width: calc(100% - 40px);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
    transform: translateY(30px) scale(0.97);
}
.wm-gdpr-banner.bar-bottom.active { transform: translateY(0) scale(1); }

/* Bar top-left */
.wm-gdpr-banner.bar-top {
    top: 20px; left: 20px; right: auto;
    max-width: 420px; width: calc(100% - 40px);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
    transform: translateY(-30px) scale(0.97);
}
.wm-gdpr-banner.bar-top.active { transform: translateY(0) scale(1); }

/* Modal centered */
.wm-gdpr-banner.modal {
    top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.92);
    max-width: 480px; width: calc(100% - 32px); border-radius: 20px;
    max-height: 85vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
}
.wm-gdpr-banner.modal.active { transform: translate(-50%, -50%) scale(1); }

/* Inner layout */
.wm-gdpr-inner { padding: 20px; }
.wm-gdpr-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.wm-gdpr-icon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    background: var(--wm-gdpr-color, #ef6f14); display: flex; align-items: center; justify-content: center;
}
.wm-gdpr-title { font-size: 15px; font-weight: 700; color: #111; line-height: 1.3; }
.wm-gdpr-desc { font-size: 13px; color: #888; line-height: 1.5; margin-top: 3px; }
.wm-gdpr-desc a { color: var(--wm-gdpr-color, #ef6f14); text-decoration: underline; font-weight: 500; }

/* Categories */
.wm-gdpr-categories {
    display: flex; flex-direction: column; gap: 8px;
    margin: 16px 0; padding: 14px; border-radius: 12px;
    background: #fafafa; border: 1px solid rgba(0,0,0,0.04);
}
.wm-gdpr-cat {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 0; flex-wrap: wrap;
}
.wm-gdpr-cat + .wm-gdpr-cat { border-top: 1px solid rgba(0,0,0,0.04); }
.wm-gdpr-cat-info { flex: 1; min-width: 0; }
.wm-gdpr-cat-label { font-size: 13px; font-weight: 600; color: #111; }
.wm-gdpr-cat-desc { font-size: 11px; color: #aaa; margin-top: 1px; line-height: 1.4; }

/* Cookie detail list */
.wm-gdpr-cookies-toggle {
    background: none; border: none; cursor: pointer; font-size: 10px; font-weight: 600;
    color: #bbb; padding: 2px 0; margin-top: 4px; display: inline-flex; align-items: center; gap: 3px;
    transition: color 0.2s;
}
.wm-gdpr-cookies-toggle:hover { color: var(--wm-gdpr-color, #ef6f14); }
.wm-gdpr-cookie-list { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.wm-gdpr-cookie-item { display: flex; align-items: baseline; gap: 8px; font-size: 10px; color: #bbb; }
.wm-gdpr-cookie-name {
    font-family: 'SF Mono', Consolas, monospace; font-weight: 600; color: #999;
    background: rgba(0,0,0,0.03); padding: 1px 5px; border-radius: 3px; white-space: nowrap;
}
.wm-gdpr-cookie-provider { color: #ccc; }

/* Toggle switch */
.wm-gdpr-toggle { position: relative; width: 38px; height: 20px; flex-shrink: 0; }
.wm-gdpr-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.wm-gdpr-toggle-slider {
    position: absolute; inset: 0; border-radius: 10px;
    background: #ddd; cursor: pointer; transition: background 0.2s;
}
.wm-gdpr-toggle-slider::after {
    content: ''; position: absolute; left: 2px; top: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}
.wm-gdpr-toggle input:checked + .wm-gdpr-toggle-slider { background: var(--wm-gdpr-color, #ef6f14); }
.wm-gdpr-toggle input:checked + .wm-gdpr-toggle-slider::after { transform: translateX(18px); }
.wm-gdpr-toggle input:disabled + .wm-gdpr-toggle-slider { opacity: 0.4; cursor: not-allowed; }

/* Buttons */
.wm-gdpr-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.wm-gdpr-btn {
    flex: 1 1 140px; padding: 10px 18px; border-radius: 10px;
    font-size: 13px; font-weight: 700; line-height: 1.2;
    text-align: center; cursor: pointer; border: 1.5px solid transparent;
    white-space: nowrap; transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.wm-gdpr-btn:hover { transform: translateY(-1px); }
.wm-gdpr-btn-accept { background: var(--wm-gdpr-color, #ef6f14); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.wm-gdpr-btn-accept:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.18); }
.wm-gdpr-btn-reject { background: #f5f5f5; color: #666; }
.wm-gdpr-btn-save { background: transparent; color: var(--wm-gdpr-color, #ef6f14); border-color: var(--wm-gdpr-color, #ef6f14); }

.wm-gdpr-details-toggle {
    display: block; width: 100%; background: none; border: none;
    color: #aaa; font-size: 12px; font-weight: 600; cursor: pointer;
    padding: 10px 0 0; text-align: center; transition: color 0.2s;
}
.wm-gdpr-details-toggle:hover { color: var(--wm-gdpr-color, #ef6f14); }

/* Settings button */
.wm-gdpr-settings-btn {
    position: fixed; bottom: 20px; left: 20px; z-index: 90;
    width: 40px; height: 40px; padding: 0; border-radius: 12px;
    background: #fff; border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: box-shadow 0.2s, transform 0.2s;
    opacity: 0; transform: translateY(8px);
    animation: wmGdprBtnIn 0.3s 0.5s forwards;
}
.wm-gdpr-settings-btn > svg { flex: 0 0 auto; width: 18px; height: 18px; }
.wm-gdpr-settings-btn:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); transform: translateY(-2px); }
@keyframes wmGdprBtnIn { to { opacity: 1; transform: translateY(0); } }

.wm-gdpr-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: var(--wm-gdpr-color, #ef6f14);
    color: #fff; font-size: 9px; font-weight: 700; line-height: 16px; text-align: center;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .wm-gdpr-banner { background: #1a1a2e; }
    .wm-gdpr-title { color: #eee; }
    .wm-gdpr-desc { color: #999; }
    .wm-gdpr-categories { background: #16162a; border-color: rgba(255,255,255,0.05); }
    .wm-gdpr-cat + .wm-gdpr-cat { border-color: rgba(255,255,255,0.05); }
    .wm-gdpr-cat-label { color: #ddd; }
    .wm-gdpr-cat-desc { color: #777; }
    .wm-gdpr-btn-reject { background: #222240; color: #aaa; }
    .wm-gdpr-btn-save { background: #1a1a2e; }
    .wm-gdpr-details-toggle { color: #666; }
    .wm-gdpr-toggle-slider { background: #444; }
    .wm-gdpr-settings-btn { background: #1a1a2e; border-color: rgba(255,255,255,0.08); }
    .wm-gdpr-settings-btn svg { stroke: #ccc; }
    .wm-gdpr-cookie-name { background: rgba(255,255,255,0.05); color: #aaa; }
}

/* Mobile */
@media (max-width: 640px) {
    .wm-gdpr-banner.bar-bottom, .wm-gdpr-banner.bar-top {
        left: 12px; right: 12px; bottom: 12px; top: auto; width: auto; max-width: none;
    }
    .wm-gdpr-inner { padding: 16px; }
    .wm-gdpr-actions { flex-direction: column; }
    .wm-gdpr-settings-btn { bottom: 12px; left: 12px; width: 36px; height: 36px; }
}
