/* ============================================================
   Bewed Cookie Consent – Standalone CSS (sans Bootstrap)
   Reproduit fidèlement le design du module PrestaShop
   ============================================================ */

/* ---------- Reset local ---------- */
#cookie-consent-banner *,
#cookie-settings-modal * {
    box-sizing: border-box;
    font-family: "Nunito", sans-serif;
}

/* ---------- Backdrop ---------- */
.bewed-cookie-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.bewed-cookie-modal.is-open {
    display: flex;
}

.bewed-cookie-modal .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

/* ---------- Dialog wrapper ---------- */
.bewed-cookie-modal .modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    margin: 1rem auto;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

/* ---------- Banner : layout deux colonnes ---------- */
#cookie-consent-banner .modal-dialog {
    display: flex;
    flex-direction: row;
}

.modal-image {
    display: none;
    flex-shrink: 0;
    width: 300px;
    background: #fff;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .modal-image {
        display: block;
    }
}

/* Colonne droite */
#cookie-consent-banner .modal-right {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
/* Boutons */
.bewed-cookie-modal button {
    text-decoration: none;
}
.bewed-cookie-modal button:hover {
    text-decoration: underline;
}

/* ---------- Header ---------- */
.bewed-cookie-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px;
    border-bottom: none;
}

.bewed-cookie-modal .modal-header img {
    height: 20px;
    width: auto;
}

/* Bouton "Continuer sans accepter" */
.bewed-cookie-modal .btn-link-deny {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    padding: 0;
    font-family: inherit;
}

.bewed-cookie-modal .btn-link-deny:hover {
    color: #111;
}

/* ---------- Title wrapper ---------- */
.modal-title-wrapper {
    margin-bottom: 1rem;
    margin-left: 1rem;
    margin-right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.modal-title-wrapper h4 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
}

/* Image mobile (visible seulement < 640px) */
.modal-title-wrapper .img-mobile {
    display: block;
    flex-shrink: 0;
    width: 72px;
}

.modal-title-wrapper .img-mobile img {
    width: 100%;
}

@media (min-width: 640px) {
    .modal-title-wrapper .img-mobile {
        display: none;
    }
}

/* ---------- Body ---------- */
.bewed-cookie-modal .modal-body {
    padding: 0 20px 20px;
    flex: 1;
}

.modal-body .title-description {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2751C5;
}

.modal-body ul {
    list-style: disc;
    padding-left: 18px;
    font-size: 13px;
    color: #444;
    margin-bottom: 10px;
    line-height: 1.6;
}
.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-body .info-link {
    font-size: 12px;
    color: #555;
}

.modal-body .info-link a {
    color: inherit;
    text-decoration: underline;
}

/* ---------- Actions banner ---------- */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

@media (min-width: 640px) {
    .modal-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.btn-settings {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-decoration: underline;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    font-family: inherit;
}

.btn-settings:hover { color: #111; }

.btn-settings svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn-accept-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #2751C5;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    transition: background 0.2s;
}

@media (min-width: 640px) {
    .btn-accept-all { width: auto; }
}

.btn-accept-all:hover { background: #036660; }

.btn-accept-all svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ---------- Settings modal ---------- */
#cookie-settings-modal .modal-dialog {
    max-width: 800px;
    display: flex;
    flex-direction: column;
}

#cookie-settings-modal .modal-header {
    padding: 16px 16px 8px 16px;
    border-bottom: 1px solid #e5e5e5;
}

#cookie-settings-modal .modal-header h5 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #464646;
}

.btn-close-modal {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    line-height: 1;
    font-family: inherit;
    font-size: 30px;
}

.btn-close-modal:hover { color: #111; }

#cookie-settings-modal .modal-body {
    padding: 16px 20px;
}

/* Liste des options */
.modal-body ul.cookie-options {
    list-style: none;
    padding: 0;
}

.modal-body li.cookie-option {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e5e5e5;
}

.cookie-option:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.option-header .title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
}

.option-description {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

/* Badge "Toujours actif" */
.badge-always-on {
    font-size: 11px;
    font-weight: 600;
    background: #2751C5;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    display: inline-block;
    width: 30px;
    height: 15px;
    background: #fff;
    border: 1px solid #2CA66E;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: -2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transform: translateX(4px);
    background: #2CA66E;
}

.toggle-switch input:checked + .toggle-track {
    background: #2CA66E;
}

.toggle-switch input:checked + .toggle-track::after {
    background: #fff;
    transform: translateX(20px);
}

/* ---------- Footer settings ---------- */
#cookie-settings-modal .modal-footer {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.btn-back {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    text-decoration: underline;
    padding: 0;
    font-family: inherit;
}

.btn-back:hover { color: #111; }

.footer-actions {
    display: flex;
    gap: 8px;
}

.btn-accept-all-small,
.btn-save {
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-accept-all-small {
    background: #2751C5;
    color: #fff;
}

.btn-accept-all-small:hover { background: #d4d4d4; }

.btn-save {
    background: #2751C5;
    color: #fff;
}

.btn-save:hover { background: #036660; }

.btn-save.saved {
    background: #2d9e5f;
}

/* ---------- Scroll lock body ---------- */
body.bewed-cookie-open {
    overflow: hidden;
}