/* ============================================================
   Nordik — retours de clic (toasts, conditions, avis, favoris, chat)
   Fichier dédié : ne modifie pas style.css ni les feuilles partielles.
   ============================================================ */

:root {
    --nordik-blue: #0058a3;
    --nordik-yellow: #ffdb00;
    --nordik-ink: #111111;
    --nordik-grey: #484848;
    --nordik-line: #dfdfdf;
}

/* ----------------------------- toasts ----------------------------- */
/* Spécification référence : 360 px de large, top:32 / right:32 (x=1048 à 1440).
   Une ligne = 66 px de haut ; deux lignes / toast avec action empilée = 117 px. */
.nordik-toasts {
    position: fixed;
    top: 32px;
    right: 32px;
    z-index: 3200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 360px;
    max-width: calc(100vw - 64px);
    pointer-events: none;
}

.nordik-toast {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    height: 66px;
    min-height: 66px;
    overflow: hidden;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 44px 12px 16px;
    background: var(--nordik-ink);
    color: #fff;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
    animation: nordik-toast-in 0.22s ease-out;
}

@keyframes nordik-toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.nordik-toast.is-leaving {
    animation: nordik-toast-out 0.18s ease-in forwards;
}

@keyframes nordik-toast-out {
    to { opacity: 0; transform: translateY(-6px); }
}

.nordik-toast__body {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    line-height: 1.45;
}

.nordik-toast__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
}

.nordik-toast__text strong {
    font-weight: 700;
}

.nordik-toast__actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
    margin: 0;
}

.nordik-toast__action {
    color: #9cc6f2;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    text-decoration: none;
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.nordik-toast__action:hover { text-decoration: underline; }

/* Toast « deux lignes » / avec action empilée : 117 px */
.nordik-toast--stacked {
    height: 117px;
    min-height: 117px;
    align-items: flex-start;
    padding: 14px 44px 14px 16px;
}

.nordik-toast--stacked .nordik-toast__body {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 13px;
    line-height: 1.45;
}

.nordik-toast--stacked .nordik-toast__text {
    font-size: 13px;
    line-height: 1.45;
}

.nordik-toast--stacked .nordik-toast__actions { margin-top: 0; }
.nordik-toast--stacked .nordik-toast__action { font-size: 13px; }

.nordik-toast__close {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: 0;
    padding: 0;
    background: none;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}

.nordik-toast--stacked .nordik-toast__close {
    top: 14px;
    transform: none;
}

.nordik-toast__close:hover { opacity: 1; }
.nordik-toast__close svg { width: 16px; height: 16px; }

/* ------------------------- styles de base modale ------------------------- */
html.nordik-scroll-lock,
html.nordik-scroll-lock body { overflow: hidden; }

.nordik-fb-modal[hidden] { display: none; }

.nordik-fb-modal {
    position: fixed;
    inset: 0;
    z-index: 3100;
    display: flex;
}

.nordik-fb-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.45);
}

.nordik-fb-modal__dialog {
    position: relative;
    background: #fff;
    z-index: 1;
}

.nordik-fb-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--nordik-ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.nordik-fb-modal__close:hover { background: #f2f2f2; }
.nordik-fb-modal__close:focus-visible,
.nordik-fb-modal__dialog:focus-visible { outline: 2px solid var(--nordik-blue); outline-offset: 2px; }

/* --------------------------- conditions (feuille droite) --------------------------- */
.nordik-fb-modal--conditions { justify-content: flex-end; }

.nordik-conditions {
    width: 480px;
    max-width: 100vw;
    height: 100%;
    overflow-y: auto;
    padding: 44px 40px 48px;
    animation: nordik-sheet-in 0.24s ease-out;
}

@keyframes nordik-sheet-in {
    from { transform: translateX(24px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.nordik-conditions__title {
    margin: 0 0 22px;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--nordik-ink);
    padding-right: 44px;
}

.nordik-conditions__body h3 {
    margin: 22px 0 8px;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--nordik-ink);
}

.nordik-conditions__body h3:first-child { margin-top: 0; }

.nordik-conditions__body p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.62;
    color: #333333;
}

.nordik-conditions__foot {
    margin-top: 24px !important;
    font-size: 12px !important;
    color: #767676 !important;
}

/* Déclencheur « *Voir conditions » ancré dans le hero, sur la grande tuile
   image (.tile-a, position:relative) : bas gauche, sous la légende.
   position:absolute → aucun impact sur le flux, aucun top codé en dur. */
.nordik-hero-conditions {
    position: absolute;
    left: 24px;
    bottom: 2px;
    z-index: 6;
    max-width: min(560px, calc(100% - 48px));
    pointer-events: none;
}

.nordik-hero-conditions .nordik-conditions-note {
    display: block;
    margin: 0;
    padding: 0;
    font-size: 11px;
    line-height: 1.5;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

.nordik-hero-conditions .nordik-conditions-trigger {
    color: #ffffff;
    font-size: inherit;
    line-height: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    pointer-events: auto;
}

.nordik-hero-conditions .nordik-conditions-trigger:hover,
.nordik-hero-conditions .nordik-conditions-trigger:focus-visible {
    color: #ffffff;
    text-decoration-thickness: 2px;
}

.nordik-conditions-note {
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
    color: var(--nordik-grey);
}

.nordik-conditions-trigger {
    display: inline;
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.nordik-conditions-trigger:hover { color: var(--nordik-ink); }

/* --------------------------- avis clients (grande modale) --------------------------- */
.nordik-fb-modal--reviews { align-items: center; justify-content: center; padding: 40px; }

.nordik-reviews {
    width: min(1150px, 100%);
    max-height: min(86vh, 820px);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
    animation: nordik-fb-modal-in 0.2s ease-out;
}

@keyframes nordik-fb-modal-in {
    from { opacity: 0; transform: scale(0.985); }
    to { opacity: 1; transform: scale(1); }
}

.nordik-reviews .nordik-fb-modal__close { top: 18px; right: 18px; z-index: 3; }

.nordik-reviews__body {
    display: grid;
    grid-template-columns: 340px 1fr;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.nordik-reviews__loading {
    grid-column: 1 / -1;
    margin: 0;
    padding: 60px 40px;
    text-align: center;
    color: var(--nordik-grey);
    font-size: 15px;
}

.nordik-reviews__summary {
    border-right: 1px solid var(--nordik-line);
    padding: 40px 36px 32px;
    overflow-y: auto;
}

.nordik-reviews__avg {
    margin: 0;
    font-size: 46px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--nordik-ink);
}

.nordik-reviews__stars {
    margin: 10px 0 4px;
    font-size: 20px;
    letter-spacing: 3px;
    color: var(--nordik-ink);
}

.nordik-reviews__based {
    margin: 0 0 22px;
    font-size: 13px;
    color: var(--nordik-grey);
}

.nordik-reviews__bars {
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nordik-reviews__bar-row {
    display: grid;
    grid-template-columns: 32px 1fr 42px;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--nordik-grey);
}

.nordik-reviews__bar-track {
    height: 10px;
    border-radius: 999px;
    background: #ededed;
    overflow: hidden;
}

.nordik-reviews__bar-fill {
    display: block;
    height: 100%;
    background: var(--nordik-blue);
    border-radius: 999px;
}

.nordik-reviews__list {
    min-height: 0;
    overflow-y: auto;
    padding: 40px 44px 40px 40px;
}

.nordik-reviews__title {
    margin: 0 0 4px;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--nordik-ink);
}

.nordik-reviews__product {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--nordik-grey);
}

.nordik-reviews__empty {
    border: 1px solid var(--nordik-line);
    border-radius: 6px;
    padding: 22px;
    background: #fafafa;
}

.nordik-reviews__empty p { margin: 0 0 8px; font-size: 15px; color: var(--nordik-ink); }
.nordik-reviews__empty small { display: block; margin-bottom: 14px; font-size: 13px; color: var(--nordik-grey); }

.nordik-reviews__card {
    border-bottom: 1px solid var(--nordik-line);
    padding: 22px 0;
}

.nordik-reviews__card:first-of-type { padding-top: 6px; }
.nordik-reviews__card:last-child { border-bottom: 0; }

.nordik-reviews__card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.nordik-reviews__card-stars { font-size: 14px; letter-spacing: 2px; color: var(--nordik-ink); }
.nordik-reviews__card-author { font-size: 14px; font-weight: 700; color: var(--nordik-ink); }
.nordik-reviews__card-date { margin-left: auto; font-size: 12px; color: #767676; }
.nordik-reviews__card-text { margin: 0; font-size: 14px; line-height: 1.6; color: #333333; }

.nordik-reviews__card-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #0a5c2e;
    background: #e7f4ec;
    border-radius: 999px;
    padding: 3px 9px;
}

.nordik-reviews__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--nordik-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.nordik-reviews__cta:hover { background: #00427b; color: #fff; }

/* --------------------------- favoris / panier états --------------------------- */
.prod-fav.is-fav,
.quad-modal__fav.is-fav,
.ugc-like.is-fav {
    color: #cc0008 !important;
}

.prod-fav.is-fav svg,
.quad-modal__fav.is-fav svg,
.ugc-like.is-fav svg {
    fill: currentColor;
    stroke: currentColor;
}

.prod-fav[aria-pressed="true"] .icon,
.quad-modal__fav[aria-pressed="true"] .icon { fill: currentColor; }

a.prod-cart.is-loading,
button[data-add-all].is-loading {
    opacity: 0.55;
    pointer-events: none;
}

a.prod-cart.is-added {
    background: #0a5c2e !important;
}

/* --------------------------- chat : panneau enrichi --------------------------- */
.nordik-chat__panel {
    position: relative;
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: min(72vh, 560px);
    overflow-y: auto;
    padding: 18px 20px 20px;
}

.nordik-chat__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--nordik-ink);
}

.nordik-chat__close:hover { background: #f2f2f2; }
.nordik-chat__panel .nordik-chat__title { padding-right: 36px; }

.nordik-chat__form {
    margin: 14px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nordik-chat__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nordik-chat__label {
    font-size: 12px;
    font-weight: 700;
    color: var(--nordik-ink);
}

.nordik-chat__input,
.nordik-chat__textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #8a8a8a;
    border-radius: 4px;
    padding: 10px 12px;
    font: inherit;
    font-size: 13px;
    color: var(--nordik-ink);
    background: #fff;
}

.nordik-chat__textarea { resize: vertical; min-height: 84px; }

.nordik-chat__input:focus,
.nordik-chat__textarea:focus {
    outline: 2px solid var(--nordik-blue);
    outline-offset: 1px;
    border-color: var(--nordik-blue);
}

.nordik-chat__input.is-invalid,
.nordik-chat__textarea.is-invalid { border-color: #cc0008; }

.nordik-chat__submit {
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: var(--nordik-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.nordik-chat__submit:hover { background: #00427b; }

.nordik-chat__error {
    margin: 0;
    color: #cc0008;
    font-size: 12px;
}

.nordik-chat__success {
    margin: 14px 0 0;
    border-left: 3px solid #0a5c2e;
    background: #eef7f1;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #0a5c2e;
}

.nordik-chat__contact {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--nordik-line);
    font-size: 12px;
    line-height: 1.5;
    color: var(--nordik-grey);
}

.nordik-chat__contact a { color: var(--nordik-blue); }

/* --------------------------- responsive --------------------------- */
@media (max-width: 900px) {
    .nordik-toasts {
        top: auto;
        bottom: 96px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }

    .nordik-toast { width: 100%; }

    .nordik-fb-modal__dialog { animation: none; }

    .nordik-fb-modal--reviews { padding: 0; align-items: stretch; }

    .nordik-reviews {
        width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }

    .nordik-reviews__body {
        grid-template-columns: 1fr;
        overflow-y: auto;
        display: block;
    }

    .nordik-reviews__summary {
        border-right: 0;
        border-bottom: 1px solid var(--nordik-line);
        padding: 32px 24px 22px;
        overflow: visible;
    }

    .nordik-reviews__list { padding: 24px 24px 40px; overflow: visible; }

    .nordik-reviews__avg { font-size: 38px; }
    .nordik-reviews__title { font-size: 24px; }

    .nordik-fb-modal--conditions { align-items: flex-end; }

    .nordik-conditions {
        width: 100%;
        max-height: 92vh;
        height: auto;
        border-radius: 12px 12px 0 0;
        padding: 36px 22px 32px;
    }

    .nordik-conditions__title { font-size: 21px; padding-right: 40px; }

    .nordik-hero-conditions { left: 16px; bottom: 2px; max-width: calc(100% - 32px); }

    .nordik-hero-conditions .nordik-conditions-note {
        font-size: 10px;
        line-height: 1.5;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nordik-chat__panel {
        width: calc(100vw - 40px);
        max-height: 70vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nordik-toast,
    .nordik-conditions,
    .nordik-reviews { animation: none !important; }
}
