/* ==========================================================
   Cookie Consent — Aldmobil
   ========================================================== */

:root {
    --cc-primary: #1e3a5f;
    --cc-primary-hover: #2a4d7d;
    --cc-text: #1e293b;
    --cc-muted: #64748b;
    --cc-bg: #ffffff;
    --cc-border: #e2e8f0;
    --cc-shadow: 0 -8px 30px rgba(15, 23, 42, 0.18);
    --cc-radius: 12px;
}

/* ---------- Banner ---------- */
.cookie-banner {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 9998;
    background: var(--cc-bg);
    color: var(--cc-text);
    border-top: 3px solid var(--cc-primary);
    box-shadow: var(--cc-shadow);
    padding: 20px 24px;
    font-family: 'Open Sans', system-ui, -apple-system, Segoe UI, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    animation: cc-slide-up .35s ease-out;
}
.cookie-banner[hidden] { display: none; }

.cookie-banner__inner {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
}

.cookie-banner__title {
    margin: 0 0 6px 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--cc-primary);
}

.cookie-banner__text p {
    margin: 0;
    color: var(--cc-text);
}

.cookie-link {
    color: var(--cc-primary);
    text-decoration: underline;
    font-weight: 600;
}
.cookie-link:hover { color: var(--cc-primary-hover); }

.cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

/* ---------- Buttons ---------- */
.cookie-btn {
    border: 0;
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all .18s ease;
    line-height: 1.2;
    white-space: nowrap;
}
.cookie-btn--primary {
    background: var(--cc-primary);
    color: #fff;
}
.cookie-btn--primary:hover {
    background: var(--cc-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(30, 58, 95, 0.25);
}
.cookie-btn--outline {
    background: #fff;
    color: var(--cc-primary);
    border: 1.5px solid var(--cc-primary);
}
.cookie-btn--outline:hover {
    background: var(--cc-primary);
    color: #fff;
}
.cookie-btn--ghost {
    background: transparent;
    color: var(--cc-muted);
    border: 1.5px solid var(--cc-border);
}
.cookie-btn--ghost:hover {
    background: #f1f5f9;
    color: var(--cc-text);
}

/* ---------- Reopen floating button ---------- */
.cookie-reopen {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 9997;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--cc-primary);
    color: #fff;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
    transition: transform .18s ease, background .18s ease;
}
.cookie-reopen[hidden] { display: none; }
.cookie-reopen:hover {
    background: var(--cc-primary-hover);
    transform: scale(1.05);
}

/* ---------- Modal ---------- */
.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cc-fade-in .25s ease-out;
}
.cookie-modal[hidden] { display: none; }

.cookie-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
}

.cookie-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 760px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
    font-family: 'Open Sans', system-ui, sans-serif;
    color: var(--cc-text);
    overflow: hidden;
    animation: cc-pop-in .28s cubic-bezier(.16,.84,.44,1);
}

.cookie-modal__header {
    padding: 22px 28px 16px;
    border-bottom: 1px solid var(--cc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.cookie-modal__header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--cc-primary);
}
.cookie-modal__close {
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    color: var(--cc-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background .15s;
}
.cookie-modal__close:hover { background: #f1f5f9; color: var(--cc-text); }

.cookie-modal__body {
    padding: 18px 28px 24px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.cookie-modal__body::-webkit-scrollbar { width: 6px; }
.cookie-modal__body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.cookie-modal__intro {
    font-size: 14px;
    color: var(--cc-text);
    margin: 0 0 18px;
    line-height: 1.65;
}

.cookie-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--cc-primary);
    margin: 22px 0 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ---------- Category (collapsible) ---------- */
.cookie-category {
    border: 1px solid var(--cc-border);
    border-radius: 10px;
    margin-bottom: 10px;
    background: #fff;
    overflow: hidden;
}

.cookie-category__head {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    background: #f8fafc;
    list-style: none;
    user-select: none;
}
.cookie-category__head::-webkit-details-marker { display: none; }

.cookie-category__name {
    font-weight: 700;
    font-size: 14px;
    color: var(--cc-text);
}

.cookie-category__toggle {
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--cc-muted);
    border-bottom: 2px solid var(--cc-muted);
    transform: rotate(45deg);
    transition: transform .2s ease;
}
.cookie-category[open] .cookie-category__toggle {
    transform: rotate(-135deg);
}

.cookie-category--toggle .cookie-category__head {
    cursor: default;
    background: #fff;
    border-bottom: 1px solid var(--cc-border);
}

.cookie-category__body {
    padding: 14px 18px 18px;
    font-size: 13.5px;
    color: var(--cc-text);
    line-height: 1.65;
}

.cookie-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.cookie-badge--always {
    background: #dcfce7;
    color: #166534;
}

/* ---------- Switch ---------- */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.cookie-switch__slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background .2s;
}
.cookie-switch__slider::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s;
}
.cookie-switch input:checked + .cookie-switch__slider {
    background: var(--cc-primary);
}
.cookie-switch input:checked + .cookie-switch__slider::before {
    transform: translateX(20px);
}
.cookie-switch input:disabled + .cookie-switch__slider {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: .85;
}

/* ---------- Details / table ---------- */
.cookie-details {
    margin-top: 12px;
    border-top: 1px dashed var(--cc-border);
    padding-top: 10px;
}
.cookie-details > summary {
    cursor: pointer;
    color: var(--cc-primary);
    font-weight: 600;
    font-size: 13px;
    user-select: none;
    list-style: none;
}
.cookie-details > summary::-webkit-details-marker { display: none; }
.cookie-details > summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform .2s;
}
.cookie-details[open] > summary::before {
    content: "▾ ";
}

.cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 6px;
    font-size: 12.5px;
}
.cookie-table th,
.cookie-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--cc-border);
    vertical-align: top;
}
.cookie-table thead th {
    background: #f1f5f9;
    font-weight: 700;
    color: var(--cc-primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.cookie-table code {
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11.5px;
    color: #be185d;
}

.cookie-meta {
    font-size: 12.5px;
    color: var(--cc-muted);
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 8px;
    margin: 10px 0 0;
    line-height: 1.55;
}

.cookie-list {
    padding-left: 20px;
    margin: 8px 0;
}
.cookie-list li {
    margin-bottom: 4px;
}

/* ---------- Footer ---------- */
.cookie-modal__footer {
    padding: 16px 28px;
    border-top: 1px solid var(--cc-border);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.cookie-modal__footer-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---------- Animations ---------- */
@keyframes cc-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes cc-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes cc-pop-in {
    from { transform: scale(.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 16px;
    }
    .cookie-banner__inner {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .cookie-banner__actions {
        justify-content: stretch;
    }
    .cookie-banner__actions .cookie-btn {
        flex: 1 1 auto;
        text-align: center;
    }
    .cookie-modal__dialog {
        max-height: 95vh;
    }
    .cookie-modal__header,
    .cookie-modal__body,
    .cookie-modal__footer {
        padding-left: 18px;
        padding-right: 18px;
    }
    .cookie-modal__footer {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-modal__footer .cookie-btn,
    .cookie-modal__footer-right {
        width: 100%;
    }
    .cookie-modal__footer-right .cookie-btn {
        flex: 1;
    }
    .cookie-table {
        font-size: 11.5px;
    }
    .cookie-table th,
    .cookie-table td {
        padding: 6px 6px;
    }
}

/* Prevent body scroll when modal is open */
body.cookie-modal-open {
    overflow: hidden;
}
