:root {
  --bg: #ededed;
  --surface: #f6f6f6;
  --text-primary: #6f6f6f;
  --text-strong: #8a8a8a;
  --border: #d9d9d9;
  --focus: #1d4ed8;

  --radius-sm: 10px;
  --radius-bar: 20px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --footer-note-height: 76px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: "Inter", "Avenir Next", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100%;
  max-width: 100%;
  overflow-x: clip;
  overscroll-behavior-y: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

.sticky-block,
.topbar,
.months-section,
.toggle,
.toggle-btn,
.month-nav,
.month-item,
.back-now {
  touch-action: manipulation;
}

.app {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 calc(var(--footer-note-height) + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 10px;
  --visible-month-count: 3;
}

.sticky-block {
  position: sticky;
  top: 0;
  z-index: 12;
  background: var(--bg);
  display: grid;
  gap: 10px;
  padding-top: 10px;
  padding-inline: 10px;
  margin-top: 0;
  margin-inline: 0;
}

.topbar {
  padding-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.toggle {
  --active-x: 2px;
  --active-w: 0px;
  background: #e2e2e2;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 2px;
  display: inline-flex;
  gap: 2px;
  width: fit-content;
  min-width: 0;
  position: relative;
  isolation: isolate;
}

.toggle::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  height: calc(100% - 4px);
  width: var(--active-w);
  transform: translateX(var(--active-x));
  border-radius: var(--radius-pill);
  background: #f8f8f8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    width 220ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

.toggle-btn {
  min-height: 32px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0 16px;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.12rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: background-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 150ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.toggle-btn.is-active {
  background: transparent;
  color: var(--text-strong);
}

.toggle-btn:active {
  transform: scale(0.98);
}

.range-toggle {
  --active-x: 2px;
  --active-w: 0px;
  background: #e2e2e2;
  border-radius: var(--radius-pill);
  padding: 2px;
  display: inline-flex;
  gap: 2px;
  flex: 0 0 auto;
  position: relative;
  isolation: isolate;
}

.range-toggle::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  height: calc(100% - 4px);
  width: var(--active-w);
  transform: translateX(var(--active-x));
  border-radius: var(--radius-pill);
  background: #f8f8f8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    width 220ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

.range-btn {
  min-height: 32px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0 13px;
  background: transparent;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: background-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 150ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.range-btn.is-active {
  background: transparent;
  color: var(--text-strong);
}

.range-btn:active {
  transform: scale(0.98);
}

.months-section {
  position: relative;
  overflow: hidden;
  margin-top: 2px;
}

.months-scroller {
  --drag-offset: 0px;
  display: grid;
  grid-template-columns: repeat(var(--visible-month-count, 3), minmax(0, 1fr));
  gap: var(--space-2);
  overflow: hidden;
  touch-action: pan-x pinch-zoom;
  cursor: grab;
  user-select: none;
  padding-inline: 0;
}

.months-scroller.is-dragging {
  cursor: grabbing;
}

.month-item {
  min-height: 58px;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: "Inter", sans-serif;
  color: #d6d6d6;
  font-size: 1.38rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  position: relative;
  transform: translateX(var(--drag-offset));
  transition: transform 180ms ease, opacity 180ms ease, color 180ms ease;
}

.month-item-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.month-item.is-current .month-item-content {
  gap: 4px;
}

.months-scroller.is-compact-labels .month-item {
  letter-spacing: 0;
}

.months-scroller.is-compact-labels .month-item-content {
  display: flex;
  width: 100%;
  justify-content: center;
  gap: 0;
  position: relative;
}

.months-scroller.is-compact-labels .month-item::after {
  right: calc(var(--space-2) / -2);
}

.months-scroller.is-compact-labels .month-item.is-centered .month-dot {
  position: absolute;
  left: 50%;
  top: calc(50% + 11px);
  transform: translateX(-50%);
}

.month-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.month-item:not(.is-centered) {
  cursor: pointer;
}

.month-item:not(.is-centered):active {
  color: #b8b8b8;
}

.months-scroller.is-dragging .month-item {
  transition: none;
}

.months-scroller.is-shifting-next .month-item {
  animation: month-shift-next 220ms ease;
}

.months-scroller.is-shifting-prev .month-item {
  animation: month-shift-prev 220ms ease;
}

.month-item::after {
  content: "";
  position: absolute;
  right: 0;
  top: 10px;
  width: 1px;
  height: 36px;
  background: #cfcfcf;
}

.month-item:last-child::after {
  display: none;
}

.month-item.is-centered {
  color: #9b9b9b;
}

@keyframes month-shift-next {
  0% {
    transform: translateX(16px);
    opacity: 0.84;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes month-shift-prev {
  0% {
    transform: translateX(-16px);
    opacity: 0.84;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.month-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 24px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: rgba(237, 237, 237, 0.85);
  color: #9f9f9f;
  font-size: 1.6rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.month-nav-prev {
  left: 0;
}

.month-nav-next {
  right: 0;
}

.actions {
  position: relative;
  min-height: 0;
  pointer-events: none;
}

.products {
  margin-inline: 0;
}

.back-now {
  position: absolute;
  top: -6px;
  right: 0;
  z-index: 3;
  min-height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid #d4d4d4;
  background: #f7f7f7;
  color: #8c8c8c;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
  pointer-events: auto;
  max-width: min(100%, calc(100vw - 20px));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.products-list {
  display: grid;
  gap: 4px;
}

.app-note {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  margin: 0;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: 1px solid var(--border);
  color: #8d8d8d;
  font-size: 0.82rem;
  line-height: 1.45;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.app-note-credit {
  display: block;
}

.app-note a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.app-note a:hover,
.app-note a:focus-visible {
  opacity: 0.85;
}

.product-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: repeat(var(--visible-month-count, 3), 1fr);
  align-items: center;
  gap: var(--space-2);
}

.product-bar {
  min-height: 40px;
  min-width: 0;
  border-radius: var(--radius-bar);
  font-family: "Inter", sans-serif;
  color: #ffffff;
  font-size: 1.7rem; 
  font-weight: 700;
  line-height: 1.12;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--space-3);
  transition: background-color 220ms ease, box-shadow 220ms ease;
}

.product-label {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.product-bar.is-muted {
  box-shadow: none;
  color: #b9b9b9; /* changer la couleur de police des produits hors saison ici */
}

.product-bar.flat-left {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.product-bar.flat-right {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: #ababab;
  font-size: 1rem;
  font-weight: 600;
}

button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 390px) {
  .topbar {
    gap: 8px;
  }

  .toggle {
    flex: 1 1 auto;
  }

  .toggle-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 14px;
    font-size: 1.08rem;
  }

  .range-btn {
    padding: 0 10px;
    font-size: 0.94rem;
  }

  .month-item {
    font-size: 1.24rem;
  }

  .product-bar {
    font-size: 1.48rem;
  }
}

@media (max-width: 360px) {
  .sticky-block {
    padding-inline: 8px;
  }

  .topbar {
    gap: 6px;
  }

  .toggle-btn {
    padding: 0 12px;
    font-size: 1rem;
  }

  .range-btn {
    padding: 0 9px;
    font-size: 0.88rem;
  }

  .back-now {
    font-size: 0.82rem;
    padding: 0 10px;
  }
}

@media (min-width: 768px) {
  .app {
    max-width: none;
    padding: 0 0 calc(var(--footer-note-height) + env(safe-area-inset-bottom, 0px));
  }

  .month-item {
    font-size: 1.58rem;
  }

  .product-bar {
    min-height: 40px;
    font-size: 1.7rem;
  }
}
