/* ============================================================
   overlays.css — panneaux superposés du site (réf. ikea.com/fr/fr)
   Chargé après style.css et les feuilles mobile : ne modifie que les
   nouveaux composants .nordik-overlay / .nordik-sheet / .nordik-modal.

   Mesures de référence (desktop 1440x900) :
     - backdrop rgba(17,17,17,.4), z au-dessus du site (400 chez IKEA)
     - drawer : 480px de large, pleine hauteur, blanc, coins intérieurs 8px
       (pays = gauche, code postal / magasin / transcription = droite)
     - header du drawer 72px, bouton fermer 40x40 à droite (16px)
     - corps : padding 0 40px ; h2 24px/30 700 ; texte 14px/22
     - footer : padding 24px ; bouton noir pleine largeur 56px, radius 64
     - magasin : fond du drawer #f5f5f5, recherche pill #f5f5f5 h48,
       items blancs 400px de large, bord 1px #dfdfdf, radius 4, padding 16
   ============================================================ */

.nordik-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
}
.nordik-overlay[hidden] { display: none !important; }

.nordik-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, .4);
  border: 0;
  padding: 0;
  cursor: pointer;
  animation: nordik-fade-in .18s ease;
}

@keyframes nordik-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nordik-slide-left { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes nordik-slide-right { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes nordik-slide-up { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

body.nordik-overlay-open { overflow: hidden; }

/* ---------- drawer (panneau latéral) ---------- */
.nordik-sheet {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 480px;
  max-width: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 24px rgba(0, 0, 0, .12);
}
.nordik-sheet--left { left: 0; border-radius: 0 8px 8px 0; animation: nordik-slide-left .22s ease; }
.nordik-sheet--right { right: 0; border-radius: 8px 0 0 8px; animation: nordik-slide-right .22s ease; }

.nordik-sheet__header {
  flex: 0 0 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 16px;
  background: #fff;
}
.nordik-sheet__close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 64px;
  background: transparent;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.nordik-sheet__close:hover { background: #f5f5f5; }
.nordik-sheet__close svg { width: 24px; height: 24px; }

.nordik-sheet__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 40px 32px;
  -webkit-overflow-scrolling: touch;
}
.nordik-sheet__body--flush { padding: 0 40px; }
.nordik-sheet__body--store { padding: 0 40px 8px; }

.nordik-sheet h2 {
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  color: #111;
  margin: 0 0 16px;
  letter-spacing: -.01em;
}
.nordik-sheet__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 22px;
  color: #111;
  text-decoration: underline;
  margin: 0 0 16px;
}
.nordik-sheet__link:hover { color: #111; }
.nordik-sheet__link svg { width: 20px; height: 20px; flex: 0 0 20px; }
.nordik-sheet__note {
  font-size: 14px;
  line-height: 22px;
  color: #767676;
  margin: 0;
  max-width: 400px;
}

.nordik-sheet__footer {
  flex: 0 0 auto;
  padding: 24px;
  background: #fff;
}
.nordik-sheet__footer--bordered { border-top: 1px solid #e5e5e5; padding: 24px 40px; }

/* ---------- boutons ---------- */
.nordik-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 64px;
  font-family: inherit;
  font-size: 14px;
  line-height: 17.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.nordik-btn--block { width: 100%; }
.nordik-btn--primary { background: #111; color: #fff; }
.nordik-btn--primary:hover { background: #333; color: #fff; }
.nordik-btn--secondary { background: #fff; color: #111; border: 1px solid #111; }
.nordik-btn--secondary:hover { background: #f5f5f5; }

/* ---------- formulaire (code postal) ---------- */
.nordik-field { margin: 0 0 16px; }
.nordik-field__label {
  display: block;
  font-size: 14px;
  line-height: 18px;
  color: #484848;
  margin: 0 0 4px;
}
.nordik-field__label .nordik-req { color: #e00751; font-weight: 700; margin-right: 2px; }
.nordik-input {
  width: 100%;
  height: 48px;
  border: 1px solid #767676;
  border-radius: 4px;
  background: #fff;
  padding: 0 12px;
  font-family: inherit;
  font-size: 16px;
  color: #111;
}
.nordik-input::placeholder { color: #767676; }
.nordik-input:focus { outline: 2px solid #0058a3; outline-offset: 0; border-color: #0058a3; }
.nordik-field__hint { font-size: 12px; line-height: 15px; color: #767676; margin: 4px 0 0; }
.nordik-sheet__consent { font-size: 14px; line-height: 22px; color: #767676; margin: 16px 0 0; }
.nordik-sheet__consent a { color: #767676; text-decoration: underline; }

/* ---------- recherche + liste de magasins ---------- */
.nordik-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 8px 0 16px;
  margin: 0 0 24px;
  background: #f5f5f5;
  border-radius: 64px;
}
.nordik-search > svg { width: 24px; height: 24px; flex: 0 0 24px; color: #111; }
.nordik-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  color: #111;
  outline: none;
}
.nordik-search__locate {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 0;
  border-radius: 64px;
  background: transparent;
  color: #111;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.nordik-search__locate:hover { background: #e8e8e8; }
.nordik-search__locate svg { width: 22px; height: 22px; }

.nordik-store-list {
  list-style: none;
  margin: 0;
  padding: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nordik-store-item {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid #dfdfdf;
  border-radius: 4px;
  padding: 16px;
  font-family: inherit;
  cursor: pointer;
}
.nordik-store-item:hover { border-color: #111; }
.nordik-store-item strong { display: block; font-size: 14px; line-height: 18px; font-weight: 700; color: #111; margin: 0 0 4px; }
.nordik-store-item span { display: block; font-size: 14px; line-height: 18px; color: #484848; }
.nordik-store-list__empty { padding: 16px; font-size: 14px; line-height: 22px; color: #767676; }

/* ---------- modale centrée (cookies) ---------- */
.nordik-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  max-width: calc(100% - 40px);
  max-height: calc(100% - 80px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
  animation: nordik-slide-up .2s ease;
}
.nordik-modal__header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 40px 0;
}
.nordik-modal__header h2 {
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  color: #111;
  margin: 0;
  letter-spacing: -.01em;
}
.nordik-modal__body { flex: 1 1 auto; overflow-y: auto; padding: 16px 40px 8px; }
.nordik-modal__intro { font-size: 14px; line-height: 22px; color: #484848; margin: 0 0 8px; }
.nordik-modal__footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 40px 32px;
}

.nordik-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid #e5e5e5;
}
.nordik-toggle-row:first-of-type { border-top: 0; }
.nordik-toggle-row h3 { font-size: 16px; line-height: 22px; font-weight: 700; color: #111; margin: 0 0 4px; }
.nordik-toggle-row p { font-size: 14px; line-height: 21px; color: #484848; margin: 0; max-width: 520px; }

.nordik-switch {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #bdbdbd;
  cursor: pointer;
  padding: 0;
  transition: background .15s ease;
}
.nordik-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s ease;
}
.nordik-switch[aria-checked="true"] { background: #0058a3; }
.nordik-switch[aria-checked="true"]::after { transform: translateX(20px); }
.nordik-switch:focus-visible { outline: 2px solid #0058a3; outline-offset: 2px; }

/* ---------- panneau transcription ---------- */
.nordik-sheet--transcript .nordik-sheet__body { padding: 32px 40px; }
.nordik-sheet--transcript h2 { font-size: 18px; line-height: 22.5px; margin: 0 0 32px; }
.nordik-transcript { font-size: 14px; line-height: 22px; color: #111; margin: 0; max-width: 400px; }

/* ---------- déclencheurs dans le header (boutons à la place des liens) ---------- */
.promo-item {
  font-family: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.promo-item:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- mobile : drawer pleine largeur, modale en bottom sheet ---------- */
@media (max-width: 900px) {
  .nordik-sheet,
  .nordik-sheet--left,
  .nordik-sheet--right {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
  }
  .nordik-sheet__header { flex: 0 0 64px; height: 64px; padding: 0 12px; }
  .nordik-sheet__body { padding: 0 20px 24px; }
  .nordik-sheet__body--store { padding: 0 20px 8px; }
  .nordik-sheet__footer { padding: 16px 20px 24px; }
  .nordik-sheet__footer--bordered { padding: 16px 20px 24px; }
  .nordik-sheet h2 { font-size: 20px; line-height: 26px; }
  .nordik-store-list { padding-bottom: 8px; }

  .nordik-modal {
    top: auto;
    bottom: 0;
    left: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    max-height: 86vh;
    border-radius: 12px 12px 0 0;
  }
  .nordik-modal__header { padding: 24px 20px 0; }
  .nordik-modal__body { padding: 12px 20px 8px; }
  .nordik-modal__footer { flex-direction: column-reverse; padding: 12px 20px 24px; }
  .nordik-modal__footer .nordik-btn { width: 100%; }
  .nordik-modal__header h2 { font-size: 20px; line-height: 26px; }
  .nordik-toggle-row { gap: 16px; }
}


/* ============================================================
   v2 — mega menu (1440x762 @ top=138), cookie en tiroir gauche,
        fenêtre de chat 300x190 @ (1092,662)
   Mesures de référence (ikea.com, 1440x900) :
     - wrapper mega : 1440x762 @(0,138) ; panneau blanc pleine largeur
     - pastilles catégories : h48, r8, texte 14/700, 1re bordée #111
     - colonne liens principaux : x=48, texte 24/700, interligne 46
     - colonnes secondaires : x=466 / x=668, titres 14/700, liens 14/400
     - carte droite : 280x278 (image 280x210 + bandeau orange 68)
     - tiroir cookie : 480x900 @x=0, X 40x40 @(424,16)
     - chat : 300x190 @(1092,662)
   ============================================================ */

/* ---------- mega menu ---------- */
.nordik-mega {
  position: fixed;
  top: 138px;
  left: 0;
  right: 0;
  height: 762px;
  z-index: 1150;
}
.nordik-mega[hidden] { display: none !important; }

.nordik-mega__backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

.nordik-mega__panel {
  position: relative;
  width: 100%;
  background: #fff;
  padding: 32px 48px 40px;
  box-shadow: 0 16px 24px rgba(0, 0, 0, .06);
}

.nordik-mega__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.nordik-mega__pills {
  display: flex;
  gap: 8px;
  margin: 0 0 46px;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nordik-mega__pills::-webkit-scrollbar { display: none; }
.nordik-mega__pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 24px;
  border: 1px solid #dfdfdf;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  color: #111;
  text-decoration: none;
  white-space: nowrap;
}
.nordik-mega__pill:hover { border-color: #111; text-decoration: none; }
.nordik-mega__pill:first-child { border-color: #111; }

.nordik-mega__cols {
  display: grid;
  grid-template-columns: 418px 202px 1fr 1fr 280px;
  align-items: start;
}
.nordik-mega__col--main { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.nordik-mega__link-main {
  font-size: 24px;
  line-height: 33px;
  font-weight: 700;
  color: #111;
  text-decoration: none;
  letter-spacing: -.01em;
}
.nordik-mega__link-main:hover { text-decoration: underline; color: #111; }
.nordik-mega__heading {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 19px;
  font-weight: 700;
  color: #111;
}
.nordik-mega__link {
  display: block;
  margin: 0 0 15px;
  font-size: 14px;
  line-height: 19px;
  color: #484848;
  text-decoration: none;
}
.nordik-mega__link:hover { color: #111; text-decoration: underline; }
.nordik-mega__card {
  display: block;
  grid-column: 5;
  grid-row: 1;
  margin-right: 16px;
  justify-self: end;
  align-self: start;
  width: 280px;
  text-decoration: none;
  color: #fff;
}
.nordik-mega__card:hover { text-decoration: none; }
.nordik-mega__card-img {
  display: block;
  width: 280px;
  height: 210px;
  background-size: cover;
  background-position: center;
}
.nordik-mega__card-label {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 8px 16px;
  background: #ca5008;
  color: #fff;
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
}

/* pièces : 7 cartes « arche » + barre de progression */
.nordik-mega__rooms {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}
.nordik-mega__room { display: block; text-decoration: none; color: #111; }
.nordik-mega__room-img {
  display: block;
  height: 190px;
  border-radius: 999px 999px 0 0;
  background-color: #f5f5f5;
  background-size: cover;
  background-position: center;
  margin: 0 6px;
}
.nordik-mega__room-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 19px;
  font-weight: 700;
  color: #111;
}
.nordik-mega__room:hover .nordik-mega__room-label { text-decoration: underline; }

.nordik-mega__progress {
  display: none;
  position: relative;
  height: 2px;
  margin-top: 24px;
  background: #dfdfdf;
}
.nordik-mega.is-pieces .nordik-mega__progress { display: block; }
.nordik-mega__progress-thumb {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  width: 33%;
  background: #111;
}

.nordik-mega__close {
  position: fixed;
  top: 72px;
  right: 88px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 64px;
  background: #fff;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1160;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .05);
}
.nordik-mega__close:hover { background: #f5f5f5; }

body.nordik-mega-open .header-icons { visibility: hidden !important; }
body.nordik-mega-open { overflow: hidden; }
.header-nav > ul > li > a.is-mega-active { text-decoration: underline; text-underline-offset: 4px; }

/* l'ancien petit dropdown ne doit plus s'ouvrir au survol (desktop) */
@media (min-width: 901px) {
  .header-nav li:hover > ul { display: none !important; }
  .header-nav > ul > li.sub-open > ul { display: none !important; }
}
@media (max-width: 900px) {
  .nordik-mega { display: none !important; }
  .nordik-mega__close { display: none !important; }
}

/* ---------- tiroir gauche « Paramètres des cookies » ---------- */
#nordik-overlay-cookies .nordik-sheet__note { max-width: 100%; }
.nordik-cookie-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid #e5e5e5;
}
.nordik-cookie-row:first-of-type { border-top: 0; padding-top: 20px; }
.nordik-cookie-row h3 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 700;
  color: #111;
}
.nordik-cookie-row p { margin: 0; font-size: 14px; line-height: 21px; color: #484848; }
.nordik-cookie-always { flex: 0 0 auto; padding-top: 2px; font-size: 12px; line-height: 16px; color: #767676; }
.nordik-sheet__footer--cookies {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid #e5e5e5;
}

/* ---------- fenêtre de chat : 300x190 @ (1092,662) ---------- */
.nordik-chat__panel {
  position: fixed !important;
  right: 48px !important;
  bottom: 48px !important;
  width: 300px !important;
  height: 190px !important;
  margin: 0 !important;
  padding: 14px 16px !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 6px 28px rgba(0, 0, 0, .22) !important;
  z-index: 940 !important;
  overflow: hidden !important;
}
.nordik-chat__panel[hidden] { display: none !important; }
.nordik-chat__title { margin: 0 26px 4px 0 !important; font-size: 15px !important; line-height: 20px !important; }
.nordik-chat__text {
  margin: 0 0 10px !important;
  font-size: 12.5px !important;
  line-height: 17px !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nordik-chat__cta { height: 36px !important; padding: 0 14px !important; font-size: 12px !important; }
.nordik-chat__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 29px;
  height: 29px;
  padding: 0;
  border: 0;
  border-radius: 64px;
  background: transparent;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.nordik-chat__close:hover { background: #f5f5f5; }

/* état « invitation » compact (réf. 300x190) : le formulaire complet
   (ajouté par theme.js) n'apparaît qu'après un clic sur le CTA. */
.nordik-chat__panel:not(.is-expanded) .nordik-chat__form,
.nordik-chat__panel:not(.is-expanded) .nordik-chat__contact,
.nordik-chat__panel:not(.is-expanded) .nordik-chat__success { display: none !important; }
.nordik-chat__panel:not(.is-expanded) .nordik-chat__cta { display: inline-flex !important; }
.nordik-chat__panel.is-expanded {
  width: 380px !important;
  height: 463px !important;
  overflow-y: auto !important;
}
@media (max-width: 900px) {
  .nordik-chat__panel {
    left: 16px !important;
    right: 16px !important;
    bottom: 88px !important;
    width: auto !important;
    height: auto !important;
    max-height: 220px;
  }
}
