/* frontend/css/views/shopping.css — feuille Liste de courses (#/courses).
   Maquette : design/maquettes/C_Courses.dc.html. Briques communes (feuille, cases, pastilles, bandeau,
   barre d'ajout, états) dans css/components.css ; ici seulement ce qui est propre à la liste (préfixe
   shop__). Couleurs par variables de tokens.css : le thème sombre suit tout seul. */

/* Bandeau « Hors ligne · liste du … » sous le titre (maquette : 12 px sous l'en-tête). */
.shop__notice { margin-top: -2px; }

.shop__main { padding-top: 12px; }

/* ---------- Articles à prendre, par rayon ---------- */

.shop__group { display: flex; flex-direction: column; }
.shop__group + .shop__group { margin-top: 8px; }

.shop__aisle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  height: 24px;
  margin: 0 0 2px;
  padding: 0 10px;
  border-radius: 12px;
  background: var(--menthe);
  color: var(--ink);
  font-size: 12px;
  line-height: 15px;
  font-weight: 600;
}

.shop__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.shop__row-main {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.shop__name,
.shop__by {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop__name { font-size: 15px; line-height: 19px; font-weight: 500; }
.shop__by { font-size: 12px; line-height: 15px; color: var(--mute); }

.shop__qty { max-width: 40%; overflow: hidden; text-overflow: ellipsis; }

/* « Tout est dans le panier. » */
.shop__allin {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border-radius: var(--r-card);
}
.shop__allin-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  line-height: 28px;
}

/* ---------- Modification d'un article ---------- */

.shop__edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0 14px;
}
.shop__edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.shop__edit-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.shop__edit select.field__input { padding-right: 12px; }

/* ---------- Panier replié ---------- */

.shop__basket-wrap { flex: none; padding: 6px 20px 8px; }

.shop__basket { border-radius: var(--r-card); overflow: hidden; }

.shop__basket-toggle {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.shop__basket-label { flex: 1; font-size: 15px; font-weight: 600; }
.shop__basket-count {
  height: 26px;
  min-width: 26px;
  padding: 0 8px;
  border-radius: 13px;
  background: var(--surface);
  font-size: 13px;
  line-height: 26px;
  font-weight: 600;
  text-align: center;
}
.shop__chev { transition: transform 0.2s ease; }
.shop__basket.is-open .shop__chev { transform: rotate(180deg); }

.shop__basket-list {
  max-height: 206px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 14px 4px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.shop__done-name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  line-height: 19px;
  color: var(--mute);
  text-decoration: line-through;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop__done-qty {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--mute);
  white-space: nowrap;
}
.shop__basket-empty {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 19px;
  color: var(--mute);
}
.shop__more { align-self: flex-start; color: var(--mute); }
.shop__clear { align-self: flex-start; }

@media (prefers-reduced-motion: reduce) {
  .shop__chev { transition: none; }
}
