/* ============================================================
   UNITRACK — Panier latéral
   D'après la maquette « Panier UNITRACK » (design system UNITRACK).
   Les polices ne sont pas fournies : le site doit déjà charger
   Alfabet et Nimbus Sans Extended. Pour changer les familles :
   .utpl{ --utpl-font: …; --utpl-font-display: …; }
   ============================================================ */

.utpl,
.utpl-header-btn {
  --utpl-bleu: #0031E5;
  --utpl-blanc: #FFFFFF;
  --utpl-encre: #0F1220;
  --utpl-bordure: #E1E4EF;
  --utpl-panneau: #EDF0F8;
  --utpl-survol-clair: #002FB2;
  --utpl-survol-fonce: #1545F5;
  --utpl-font: var(--ut-font-texte, 'Alfabet', 'Archivo', Arial, sans-serif);
  --utpl-font-display: var(--ut-font-logo, 'Nimbus Extd', 'Nimbus Sans Extended', 'Nimbus Sans Extd', 'Arial Black', Arial, sans-serif);
  --utpl-r-bouton: 11px;
  --utpl-r-carte: 16px;
  --utpl-pad: 28px;
}

/* ---------- Conteneur ---------- */
.utpl[hidden] { display: none !important; }
.utpl {
  position: fixed;
  inset: 0;
  z-index: 999999;
  font-family: var(--utpl-font);
  -webkit-font-smoothing: antialiased;
}
.utpl *, .utpl *::before, .utpl *::after { box-sizing: border-box; }
html.utpl-lock, html.utpl-lock body { overflow: hidden; }

.utpl-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 8, 40, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .25s ease;
}
.utpl-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 460px;
  max-width: 100%;
  background: var(--utpl-bleu);
  color: var(--utpl-blanc);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  outline: none;
}
.utpl.is-open .utpl-overlay { opacity: 1; }
.utpl.is-open .utpl-drawer { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .utpl-overlay, .utpl-drawer { transition: none; }
}

.utpl-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition: opacity .15s;
}
.utpl-panel.is-busy { opacity: .6; pointer-events: none; }

.utpl button { font-family: inherit; }
.utpl a { color: inherit; }
.utpl :focus-visible { outline: 2px solid var(--utpl-blanc); outline-offset: 2px; }
.utpl-item :focus-visible { outline-color: var(--utpl-bleu); }

/* ---------- En-tête ---------- */
.utpl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(22px + env(safe-area-inset-top, 0px)) var(--utpl-pad) 16px;
}
.utpl-head__title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.utpl .utpl-title,
.utpl h2.utpl-title {
  margin: 0 !important;
  padding: 0 !important;
  color: var(--utpl-blanc) !important;
  background: none !important;
  font-family: var(--utpl-font-display);
  font-weight: 900;
  font-size: 30px;
  line-height: .9;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--utpl-blanc);
}
.utpl-head__count { font-weight: 600; font-size: 15px; }
.utpl .utpl-close {
  flex: none;
  display: grid !important;
  place-items: center;
  width: 40px !important;
  height: 40px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 100px !important;
  background: var(--utpl-blanc) !important;
  color: var(--utpl-bleu) !important;
  box-shadow: none !important;
  outline: none;
  line-height: 0 !important;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.utpl .utpl-close:hover,
.utpl .utpl-close:focus { background: var(--utpl-panneau) !important; color: var(--utpl-bleu) !important; border: 0 !important; }
.utpl .utpl-close:focus-visible { outline: 2px solid var(--utpl-blanc); outline-offset: 3px; }
.utpl .utpl-close svg { display: block; width: 16px; height: 16px; }

/* ---------- Bandeau retrait ---------- */
.utpl-pickup {
  margin: 0 var(--utpl-pad) 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--utpl-blanc);
  border-radius: var(--utpl-r-bouton);
  padding: 10px 14px;
}
.utpl-pickup__icon { flex: none; width: 30px; height: 30px; display: flex; }
.utpl-pickup__icon svg { width: 100%; height: 100%; }
.utpl-pickup p { margin: 0; font-size: 14px; font-weight: 300; line-height: 1.35; color: inherit; }
.utpl-pickup strong { font-weight: 600; }

/* ---------- Corps ---------- */
.utpl-body {
  flex: 1 0 auto;
  padding: 0 var(--utpl-pad);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.utpl-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }

.utpl-item {
  margin: 0;
  background: var(--utpl-blanc);
  color: var(--utpl-bleu);
  border-radius: var(--utpl-r-carte);
  padding: 14px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
}
.utpl-item__media {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  background: var(--utpl-panneau);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.utpl-item__media a { display: contents; }
.utpl-item__media img,
.utpl .utpl-item__img {
  width: auto !important;
  height: auto !important;
  max-width: 92% !important;
  max-height: 92% !important;
  object-fit: contain;
  margin: 0 !important;
  border-radius: 4px;
}
.utpl-item__main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.utpl-item__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.utpl-item__info { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.utpl-badge {
  background: var(--utpl-bleu);
  color: var(--utpl-blanc);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 100px;
}
.utpl .utpl-item__name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.15;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--utpl-bleu);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.utpl a.utpl-item__name:hover { color: var(--utpl-survol-clair); }
.utpl-item__meta { font-weight: 300; font-size: 13px; color: var(--utpl-encre); }
.utpl .utpl-remove {
  flex: none;
  background: none;
  border: 0;
  padding: 2px 0;
  color: var(--utpl-bleu);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  line-height: 1.2;
}
.utpl .utpl-remove:hover { color: var(--utpl-survol-clair); background: none; }

.utpl-item__bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.utpl-qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--utpl-bordure);
  border-radius: 8px;
  overflow: hidden;
}
.utpl .utpl-qty button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--utpl-blanc);
  color: var(--utpl-bleu);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.utpl .utpl-qty button:hover { background: var(--utpl-panneau); }
.utpl .utpl-qty button:disabled { opacity: .35; cursor: default; background: var(--utpl-blanc); }
.utpl-qty span { min-width: 28px; text-align: center; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.utpl-unique { font-size: 12px; font-weight: 600; color: var(--utpl-encre); }
.utpl-price { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.utpl-price del { font-size: 12px; font-weight: 400; color: var(--utpl-encre); text-decoration: line-through; }
.utpl-price span { font-weight: 700; font-size: 17px; }

/* ---------- Réassurance ---------- */
.utpl-reassure {
  list-style: none;
  margin: 0;
  padding: 12px 0 4px;
  display: grid;
  grid-template-columns: repeat(var(--utpl-cols, 3), minmax(0, 1fr));
  gap: 8px;
}
.utpl-reassure li {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
}
.utpl-reassure svg { width: 26px; height: 26px; }

/* ---------- Panier vide ---------- */
.utpl-empty {
  flex: 1;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 40px 0;
}
.utpl-empty__icon { width: 64px; height: 64px; display: flex; }
.utpl-empty__icon svg { width: 100%; height: 100%; }
.utpl-empty p { margin: 0; color: inherit; }
.utpl-empty__title { font-weight: 700; font-size: 20px; text-transform: uppercase; }
.utpl-empty__text { font-weight: 300; font-size: 15px; }

/* ---------- Pied ---------- */
.utpl-foot {
  position: sticky;
  bottom: 0;
  flex: none;
  margin-top: 12px;
  padding: 16px var(--utpl-pad) 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--utpl-blanc);
  background: var(--utpl-bleu);
}
.utpl-lines { margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; font-weight: 300; }
.utpl-lines div { display: flex; justify-content: space-between; gap: 12px; }
.utpl-lines dt, .utpl-lines dd { margin: 0; font-weight: inherit; }
.utpl-lines dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.utpl-lines dd.utpl-light { font-weight: 300; }
.utpl-total { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.utpl-total span { font-weight: 700; font-size: 15px; text-transform: uppercase; }
.utpl-total strong {
  font-family: var(--utpl-font-display);
  font-weight: 900;
  font-size: 34px;
  line-height: .85;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Boutons ---------- */
.utpl .utpl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 10px 20px;
  border-radius: var(--utpl-r-bouton);
  border: 1px solid var(--utpl-blanc);
  font-family: var(--utpl-font);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: .01em;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.utpl .utpl-btn--light { min-height: 48px; background: var(--utpl-blanc); color: var(--utpl-bleu); text-transform: uppercase; }
.utpl .utpl-btn--light:hover { background: var(--utpl-panneau); color: var(--utpl-survol-clair); }
.utpl .utpl-btn--outline { background: transparent; color: var(--utpl-blanc); }
.utpl .utpl-btn--outline:hover { background: var(--utpl-survol-fonce); color: var(--utpl-blanc); }
.utpl-empty .utpl-btn { width: auto; text-transform: uppercase; }

/* ---------- Message d'erreur ---------- */
.utpl-error {
  margin: 0 var(--utpl-pad) 12px;
  padding: 10px 14px;
  border-radius: var(--utpl-r-bouton);
  background: var(--utpl-blanc);
  color: var(--utpl-bleu);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Bouton d'en-tête [unitrack_panier] : carré, icône seule ---------- */
.utpl-header-btn {
  display: inline-grid !important;
  place-items: center;
  width: var(--utpl-btn-size, 48px);
  height: var(--utpl-btn-size, 48px);
  padding: 0 !important;
  border-radius: var(--utpl-btn-radius, 11px);
  background: var(--utpl-bleu);
  color: var(--utpl-blanc) !important;
  line-height: 0;
  text-decoration: none !important;
  transition: background .2s;
}
.utpl-header-btn:hover,
.utpl-header-btn:focus-visible { background: var(--utpl-survol-clair); color: var(--utpl-blanc) !important; }
.utpl-header-btn svg {
  display: block;
  width: var(--utpl-btn-icon, calc(var(--utpl-btn-size, 48px) * .45));
  height: var(--utpl-btn-icon, calc(var(--utpl-btn-size, 48px) * .45));
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
  .utpl { --utpl-pad: 18px; }
  .utpl-drawer { width: 100%; }
  .utpl-title { font-size: 26px; }
  .utpl-item { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .utpl-item__media { width: 76px; height: 76px; }
  .utpl-total strong { font-size: 28px; }
}
