/**
 * Ameet Conscience — Cookie Consent UI
 * Style cohérent avec la marque : or doux, crème, Cormorant Garamond / Jost.
 */

:root {
    --accc-bg: #FFFDF9;
    --accc-text: #2E2A24;
    --accc-muted: #7A6F62;
    --accc-gold: #C8B89A;
    --accc-gold-dk: #6A5530;
    --accc-border: #D9C9AF;
}

/* ====== Bandeau ====== */
.accc-banner {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    z-index: 999999;
    background: #fff;
    color: var(--accc-text);
    border: 1px solid var(--accc-border);
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(106,85,48,0.18), 0 4px 12px rgba(0,0,0,0.06);
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    animation: accc-slide-up 0.35s ease-out;
}
@keyframes accc-slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.accc-banner-inner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}
.accc-banner-text { flex: 1 1 320px; }
.accc-banner-title {
    margin: 0 0 .35rem !important;
    padding: 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--accc-text);
    line-height: 1.2;
}
.accc-banner-desc { margin: 0; color: var(--accc-muted); }
.accc-banner-policy { margin: .5rem 0 0 !important; font-size: .82rem; }
.accc-banner-policy a {
    color: var(--accc-gold-dk);
    text-decoration: underline;
}
.accc-banner-actions {
    display: flex; gap: .6rem; flex-wrap: wrap;
    flex-shrink: 0;
}

/* ====== Boutons ====== */
.accc-btn {
    display: inline-block;
    padding: .65rem 1.2rem;
    border-radius: 30px;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: .9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    border: 1px solid var(--accc-border);
    transition: background .2s ease, border-color .2s ease, color .2s ease;
    line-height: 1;
}
.accc-btn:focus { outline: 2px solid var(--accc-gold-dk); outline-offset: 2px; }
.accc-btn-primary {
    background: var(--accc-gold-dk);
    color: #fff;
    border-color: var(--accc-gold-dk);
}
.accc-btn-primary:hover { background: #523f23; border-color: #523f23; color: #fff; }
.accc-btn-secondary {
    background: #fff;
    color: var(--accc-text);
}
.accc-btn-secondary:hover { background: #F5F0EB; border-color: var(--accc-gold); }

/* ====== FIX : l attribut [hidden] doit TOUJOURS masquer ======
   Sans ca, .accc-modal{display:flex} ecrase le display:none du [hidden]
   et laisse une couche invisible qui bloque tous les clics (menu, etc.). */
.accc-banner[hidden],
.accc-modal[hidden],
.accc-modal-overlay[hidden],
.accc-floating-btn[hidden] {
    display: none !important;
}

/* ====== Modal ====== */
.accc-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(46, 42, 36, 0.65);
    z-index: 999998;
    backdrop-filter: blur(2px);
    animation: accc-fade-in 0.25s ease-out;
}
@keyframes accc-fade-in { from { opacity: 0; } to { opacity: 1; } }

.accc-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    max-width: 560px;
    max-height: calc(100vh - 32px);
    background: var(--accc-bg);
    color: var(--accc-text);
    border: 1px solid var(--accc-border);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25);
    z-index: 999999;
    font-family: 'Jost', system-ui, sans-serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.accc-modal-inner { display: flex; flex-direction: column; height: 100%; max-height: calc(100vh - 32px); }

.accc-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #EBE0CC;
}
.accc-modal-title {
    margin: 0 !important; padding: 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--accc-text);
}
.accc-modal-close {
    background: none; border: 0; font-size: 1.75rem;
    color: var(--accc-muted); cursor: pointer;
    line-height: 1; padding: 0 .25rem;
}
.accc-modal-close:hover { color: var(--accc-text); }

.accc-modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
}
.accc-modal-intro {
    margin: 0 0 1.2rem;
    color: var(--accc-muted);
    font-size: .92rem;
    line-height: 1.6;
}

.accc-category {
    border: 1px solid #EBE0CC;
    border-radius: 8px;
    padding: .9rem 1.1rem;
    margin-bottom: .7rem;
    background: #fff;
}
.accc-category-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
    margin-bottom: .35rem;
}
.accc-category-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accc-text);
}
.accc-category-desc {
    margin: 0;
    color: var(--accc-muted);
    font-size: .85rem;
    line-height: 1.5;
}

/* ====== Toggle switch ====== */
.accc-toggle {
    position: relative;
    width: 44px; height: 24px;
    flex-shrink: 0;
    display: inline-block;
    cursor: pointer;
}
.accc-toggle-input { display: none; }
.accc-toggle-slider {
    position: absolute; inset: 0;
    background: #D6D2CB;
    border-radius: 24px;
    transition: background .2s ease;
}
.accc-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.accc-toggle-input:checked + .accc-toggle-slider { background: var(--accc-gold-dk); }
.accc-toggle-input:checked + .accc-toggle-slider::before { transform: translateX(20px); }

/* Toggle "verrouillé" (toujours actif - essentiels) */
.accc-toggle-locked {
    cursor: default; padding: .35rem .7rem; width: auto; height: auto;
    background: #E8DFD2; color: var(--accc-gold-dk);
    border-radius: 30px; font-size: .75rem; font-weight: 500;
    display: inline-flex; align-items: center;
}

.accc-modal-policy { margin: 1rem 0 0; font-size: .82rem; text-align: center; }
.accc-modal-policy a { color: var(--accc-gold-dk); }

.accc-modal-footer {
    display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap;
    padding: 1rem 1.5rem;
    border-top: 1px solid #EBE0CC;
    background: #fff;
}

/* ====== Bouton flottant "Cookies" ====== */
.accc-floating-btn {
    position: fixed;
    left: 16px; bottom: 16px;
    z-index: 999997;
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .55rem .9rem;
    background: #fff;
    color: var(--accc-gold-dk);
    border: 1px solid var(--accc-border);
    border-radius: 30px;
    font-family: 'Jost', system-ui, sans-serif;
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(106,85,48,0.12);
    transition: background .2s ease, transform .2s ease;
}
.accc-floating-btn:hover {
    background: #F5F0EB;
    transform: translateY(-2px);
}
.accc-floating-btn svg { color: var(--accc-gold-dk); }

/* ====== Responsive ====== */
@media (max-width: 640px) {
    .accc-banner { left: 8px; right: 8px; bottom: 8px; }
    .accc-banner-inner { padding: 1rem; gap: 1rem; }
    .accc-banner-actions { width: 100%; }
    .accc-banner-actions .accc-btn { flex: 1 1 auto; text-align: center; }

    .accc-modal-footer { flex-direction: column-reverse; }
    .accc-modal-footer .accc-btn { width: 100%; text-align: center; }

    .accc-floating-btn { padding: .5rem .75rem; font-size: .75rem; }
}
