/* ═══════════════════════════════════════════════════
   MiniZShop GDPR — Cookie Banner
   AP-compliant: equal prominence for accept/reject
   ═══════════════════════════════════════════════════ */

/* Reset & base */
.mgdpr-banner *, .mgdpr-floating-btn * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.mgdpr-banner {
    --mgdpr-bg: rgba(255, 255, 255, 0.82);
    --mgdpr-text: #1e293b;
    --mgdpr-muted: #64748b;
    --mgdpr-border: #e2e8f0;
    --mgdpr-radius: 12px;
    --mgdpr-shadow: 0 -4px 30px rgba(0,0,0,0.10);

    position: fixed;
    z-index: 999999;
    left: 0;
    right: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--mgdpr-text);
}

/* Positions */
.mgdpr-banner--bottom {
    bottom: 0;
}

.mgdpr-banner--top {
    top: 0;
}

.mgdpr-banner--top .mgdpr-banner__container {
    box-shadow: 0 4px 30px rgba(0,0,0,0.12);
    border-radius: 0 0 var(--mgdpr-radius) var(--mgdpr-radius);
}

.mgdpr-banner--center {
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mgdpr-banner--center .mgdpr-banner__overlay {
    display: block;
}

/* Overlay (only for center/modal mode) */
.mgdpr-banner__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* Container */
.mgdpr-banner__container {
    background: var(--mgdpr-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: var(--mgdpr-shadow);
    border-radius: var(--mgdpr-radius) var(--mgdpr-radius) 0 0;
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 28px;
    position: relative;
}

.mgdpr-banner--center .mgdpr-banner__container {
    border-radius: var(--mgdpr-radius);
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 640px) {
    .mgdpr-banner__container {
        padding: 20px 16px;
        margin: 0;
        border-radius: var(--mgdpr-radius) var(--mgdpr-radius) 0 0;
        max-width: 100%;
    }
}

/* Header */
.mgdpr-banner__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--mgdpr-text);
    margin: 0 0 4px 0;
}

.mgdpr-banner__subtitle {
    font-size: 13px;
    color: var(--mgdpr-muted);
    margin: 0 0 16px 0;
}

/* Body */
.mgdpr-banner__description {
    font-size: 14px;
    color: var(--mgdpr-muted);
    margin: 8px 0 12px 0;
    line-height: 1.6;
}

.mgdpr-banner__links {
    margin: 8px 0 0 0;
}

.mgdpr-banner__links a {
    color: var(--mgdpr-primary);
    text-decoration: underline;
    font-size: 13px;
    margin-right: 16px;
}

.mgdpr-banner__links a:hover {
    opacity: 0.8;
}

/* ─── Actions ─── */
/* AP rules 4, 5, 6, 7: all buttons on same layer, equally prominent, same effort */
.mgdpr-banner__actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .mgdpr-banner__actions {
        flex-direction: column;
    }
}

/* Base button */
.mgdpr-btn {
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.15s ease;
    flex: 1;
    text-align: center;
    min-width: 140px;
}

.mgdpr-btn:focus-visible {
    outline: 2px solid var(--mgdpr-primary);
    outline-offset: 2px;
}

/* AP rule 5: reject and accept buttons are equally prominent */
.mgdpr-btn--reject {
    background: var(--mgdpr-primary);
    color: #fff;
}

.mgdpr-btn--reject:hover {
    background: var(--mgdpr-primary-hover);
}

.mgdpr-btn--accept {
    background: var(--mgdpr-primary);
    color: #fff;
}

.mgdpr-btn--accept:hover {
    background: var(--mgdpr-primary-hover);
}

.mgdpr-btn--settings {
    background: transparent;
    color: var(--mgdpr-primary);
    border: 2px solid var(--mgdpr-primary);
}

.mgdpr-btn--settings:hover {
    background: rgba(var(--mgdpr-primary-rgb), 0.06);
}

.mgdpr-btn--save {
    background: var(--mgdpr-primary);
    color: #fff;
}

.mgdpr-btn--save:hover {
    background: var(--mgdpr-primary-hover);
}

/* ─── Categories (Layer 2) ─── */
.mgdpr-banner__categories {
    margin: 16px 0;
}

.mgdpr-category {
    padding: 16px;
    border: 1px solid var(--mgdpr-border);
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8fafc;
}

.mgdpr-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mgdpr-category__label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
}

.mgdpr-category__badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
}

.mgdpr-category__badge--opt-out {
    background: #dbeafe;
    color: #1e40af;
}

.mgdpr-category__description {
    font-size: 13px;
    color: var(--mgdpr-muted);
    margin-top: 6px;
    line-height: 1.5;
}

/* Toggle switch for categories */
/* AP rule 2: toggles must be OFF by default (not pre-checked) */
.mgdpr-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.mgdpr-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mgdpr-switch__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: 0.15s;
}

.mgdpr-switch__slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.mgdpr-switch input:checked + .mgdpr-switch__slider {
    background: var(--mgdpr-primary);
}

.mgdpr-switch input:disabled + .mgdpr-switch__slider {
    background: #86efac;
    cursor: not-allowed;
}

.mgdpr-switch input:checked + .mgdpr-switch__slider::before {
    transform: translateX(20px);
}

/* ─── Floating Re-open Button ─── */
/* AP rule 8: withdrawal must be as easy as giving consent */
.mgdpr-floating-btn {
    position: fixed;
    bottom: 80px;
    left: 20px;
    z-index: 999;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.25;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.mgdpr-floating-btn:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* ─── Animation ─── */
@keyframes mgdpr-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes mgdpr-slide-down {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes mgdpr-fade-in {
    from { opacity: 0; scale: 0.95; }
    to { opacity: 1; scale: 1; }
}

.mgdpr-banner--bottom .mgdpr-banner__container {
    animation: mgdpr-slide-up 0.3s ease;
}

.mgdpr-banner--top .mgdpr-banner__container {
    animation: mgdpr-slide-down 0.3s ease;
}

.mgdpr-banner--center .mgdpr-banner__container {
    animation: mgdpr-fade-in 0.25s ease;
}

/* ─── Dark mode support ─── */
@media (prefers-color-scheme: dark) {
    .mgdpr-banner {
        --mgdpr-bg: #1e293b;
        --mgdpr-text: #f1f5f9;
        --mgdpr-muted: #94a3b8;
        --mgdpr-border: #334155;
    }

    .mgdpr-category {
        background: #0f172a;
    }

    .mgdpr-floating-btn {
        background: transparent;
    }
}

/* ─── Print: hide banner ─── */
@media print {
    .mgdpr-banner, .mgdpr-floating-btn {
        display: none !important;
    }
}
