/* ——— Shopping list · 2026 SaaS / grocery ——— */

.list-app {
  --list-bg: #f6f7f9;
  --list-surface: #ffffff;
  --list-surface-2: #f0f2f5;
  --list-text: #111418;
  --list-muted: #6b7280;
  --list-border: rgb(17 20 24 / 8%);
  --list-shadow: 0 1px 2px rgb(17 20 24 / 4%), 0 8px 24px rgb(17 20 24 / 6%);
  --list-shadow-sm: 0 1px 3px rgb(17 20 24 / 5%);
  --list-radius: 16px;
  --list-radius-sm: 12px;
  --list-discount: #c2410c;
  --list-discount-soft: #fff7ed;
  --list-accent: #0d6e4f;
  --list-accent-soft: #e8f5f0;
  background: var(--list-bg);
  color: var(--list-text);
}

.list-app .header {
  background: rgb(255 255 255 / 88%);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--list-border);
}

.list-app .list-page {
  max-width: 1200px;
  padding: 1.25rem 1.25rem calc(5.5rem + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
  .list-app .list-page {
    padding: 2rem 2rem 3rem;
  }
}

/* ——— Page head ——— */

.list-app .list-page__head {
  margin-bottom: 1.25rem;
}

.list-app .list-page-head__title {
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.list-app .list-page-head__hint {
  font-size: 0.9375rem;
  line-height: 1.5;
  max-width: 42rem;
}

.list-app .list-badge {
  border: none;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  padding: 0.28rem 0.65rem;
}

.list-app .list-badge--local {
  background: var(--list-surface-2);
  color: var(--list-muted);
}

.list-app .list-badge--cloud {
  background: var(--list-accent-soft);
  color: var(--list-accent);
}

/* ——— Quick add / SearchBar ——— */

.list-quick-add {
  margin-bottom: 1.25rem;
  position: sticky;
  top: calc(3.5rem + env(safe-area-inset-top));
  z-index: 12;
}

.list-quick-add__card {
  background: var(--list-surface);
  border: 1px solid var(--list-border);
  border-radius: var(--list-radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--list-shadow);
}

.list-quick-add__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--list-muted);
  margin-bottom: 0.55rem;
}

.list-quick-add__row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}

.list-quick-add__input {
  flex: 1;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--list-border);
  border-radius: var(--list-radius-sm);
  background: var(--list-surface-2);
  font: inherit;
  font-size: 1rem;
  color: var(--list-text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.list-quick-add__input::placeholder {
  color: #9ca3af;
}

.list-quick-add__input:hover {
  background: var(--list-surface);
}

.list-quick-add__input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--list-accent) 45%, transparent);
  background: var(--list-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--list-accent) 14%, transparent);
}

.list-app .list-quick-add .btn--primary {
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border-radius: var(--list-radius-sm);
  font-weight: 600;
  white-space: nowrap;
  border: none;
  box-shadow: var(--list-shadow-sm);
}

/* ——— Shop mode toggle ——— */

.list-mode {
  margin-top: 0.75rem;
}

.list-mode .check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-radius: var(--list-radius-sm);
  background: var(--list-surface-2);
  border: 1px solid var(--list-border);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--list-text);
  transition: background 0.15s, border-color 0.15s;
}

.list-mode .check:hover {
  background: var(--list-accent-soft);
  border-color: color-mix(in srgb, var(--list-accent) 20%, transparent);
}

.list-mode .check input {
  appearance: none;
  width: 2.75rem;
  height: 1.5rem;
  margin: 0;
  flex-shrink: 0;
  background: #d1d5db;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.list-mode .check input::after {
  content: '';
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 18%);
  transition: transform 0.2s;
}

.list-mode .check input:checked {
  background: var(--list-accent);
}

.list-mode .check input:checked::after {
  transform: translateX(1.25rem);
}

.list-mode .check input:focus-visible {
  outline: 2px solid var(--list-accent);
  outline-offset: 2px;
}

/* ——— Hints / deal scroll ——— */

.list-hints {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--list-border);
}

.list-hints__lead {
  margin: 0 0 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--list-muted);
  line-height: 1.4;
}

.list-hints__lead strong {
  color: var(--list-accent);
  font-weight: 700;
}

.list-hints__empty {
  margin: 0;
  color: var(--list-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.hint-mini-scroll-wrap {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.hint-mini-scroll-wrap::before,
.hint-mini-scroll-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 14px;
  width: 2rem;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s;
}

.hint-mini-scroll-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--list-surface) 30%, transparent);
}

.hint-mini-scroll-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--list-surface) 30%, transparent);
}

.hint-mini-scroll-wrap.is-scrollable-left::before,
.hint-mini-scroll-wrap.is-scrollable-right::after {
  opacity: 1;
}

.hint-mini-scroll {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0.15rem 0.75rem;
  margin: 0;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0.25rem;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--list-accent) 40%, transparent) transparent;
  cursor: grab;
}

.hint-mini-scroll:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--list-accent) 45%, transparent);
  outline-offset: 2px;
  border-radius: var(--list-radius-sm);
}

.hint-mini-scroll--dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.hint-mini-scroll--dragging .hint-mini--pick {
  pointer-events: none;
}

.hint-mini-scroll::-webkit-scrollbar {
  height: 6px;
}

.hint-mini-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--list-accent) 35%, #d1d5db);
  border-radius: 999px;
}

/* ——— DealCard mini ——— */

.hint-mini {
  flex: 0 0 min(10.75rem, 74vw);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--list-border);
  border-radius: var(--list-radius-sm);
  background: var(--list-surface);
  text-align: left;
  font: inherit;
  color: inherit;
  position: relative;
  overflow: hidden;
  box-shadow: var(--list-shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.hint-mini--pick {
  cursor: pointer;
}

.hint-mini--view {
  cursor: default;
}

.hint-mini--pick:hover {
  border-color: color-mix(in srgb, var(--list-accent) 28%, transparent);
  box-shadow: var(--list-shadow);
  transform: translateY(-1px);
}

.hint-mini--pick:active {
  transform: translateY(0);
}

.hint-mini__media {
  position: relative;
  width: 100%;
  height: 5.75rem;
  border-radius: 0;
  overflow: hidden;
  background: linear-gradient(180deg, var(--list-surface-2) 0%, var(--list-surface) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hint-mini__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.35rem;
}

.hint-mini__placeholder {
  font-size: 1.75rem;
  opacity: 0.35;
}

.hint-mini__discount {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  background: var(--list-discount-soft);
  color: var(--list-discount);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid color-mix(in srgb, var(--list-discount) 18%, transparent);
}

.hint-mini__body {
  min-width: 0;
  padding: 0.65rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.15rem;
}

.hint-mini__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  align-items: center;
  margin-bottom: 0.1rem;
}

.hint-mini__tags .card__store {
  font-size: 0.625rem;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
}

.hint-mini__category {
  font-size: 0.6875rem;
  color: var(--list-muted);
}

.hint-mini__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.01em;
}

.hint-mini__desc {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--list-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hint-mini__prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.4rem;
  margin-top: 0.35rem;
}

.hint-mini__price {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--list-text);
  letter-spacing: -0.02em;
}

.hint-mini__old {
  font-size: 0.75rem;
  color: var(--list-muted);
  text-decoration: line-through;
}

.hint-mini__save {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--list-discount);
}

.hint-mini__meta {
  margin: 0.15rem 0 0;
  font-size: 0.6875rem;
  color: var(--list-muted);
}

.hint-mini__reason {
  margin: 0;
  font-size: 0.625rem;
  color: #9ca3af;
}

.hint-mini__cta {
  position: static;
  display: block;
  margin-top: 0.55rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: var(--list-accent-soft);
  color: var(--list-accent);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

.hint-mini--pick:hover .hint-mini__cta {
  background: var(--list-accent);
  color: #fff;
}

.hint-mini-plain {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.55rem;
  border: none;
  border-radius: var(--list-radius-sm);
  background: transparent;
  color: var(--list-muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: color 0.15s, background 0.15s;
}

.hint-mini-plain:hover {
  color: var(--list-accent);
  background: var(--list-accent-soft);
}

/* ——— Hero / summary ——— */

.list-app .list-hero__card {
  border: 1px solid var(--list-border);
  border-radius: var(--list-radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--list-shadow-sm);
  background: var(--list-surface);
}

.list-app .list-hero__stats {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--list-muted);
  line-height: 1.5;
}

.list-app .list-hero__stats strong {
  color: var(--list-text);
  font-weight: 700;
}

.list-app .list-hero__savings {
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--list-radius-sm);
  background: var(--list-accent-soft);
  font-size: 0.9375rem;
  color: var(--list-accent);
}

.list-app .list-hero__savings strong {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.list-app .list-hero__savings--muted {
  background: var(--list-surface-2);
  color: var(--list-muted);
}

.list-app .list-hero__toolbar {
  margin: 1rem 0 0.65rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--list-border);
}

.list-app .list-hero__filter {
  font-size: 0.875rem;
  font-weight: 500;
}

.list-app .list-share {
  gap: 0.45rem;
  margin: 0;
}

.list-app .list-share .btn {
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  min-height: 2.25rem;
  border: 1px solid var(--list-border);
}

.list-app .list-share .btn--primary {
  border-color: transparent;
  box-shadow: var(--list-shadow-sm);
}

.list-app .list-share .btn--ghost {
  background: var(--list-surface-2);
  color: var(--list-text);
}

.list-app .list-share .btn--ghost:hover {
  background: var(--list-accent-soft);
  color: var(--list-accent);
}

/* ——— Store groups ——— */

.list-app .list-by-store {
  gap: 1rem;
}

.list-app .store-group {
  border: 1px solid var(--list-border);
  border-radius: var(--list-radius);
  box-shadow: var(--list-shadow-sm);
  background: var(--list-surface);
}

.list-app .store-group__header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--list-border);
  background: var(--list-surface);
}

.list-app .store-group__title {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.list-app .store-group__count {
  font-size: 0.8125rem;
  color: var(--list-muted);
}

.list-app .store-group__savings {
  font-size: 0.875rem;
  font-weight: 600;
}

.list-app .store-group--checked {
  border-color: color-mix(in srgb, var(--list-accent) 35%, transparent);
  background: linear-gradient(180deg, var(--list-accent-soft) 0%, var(--list-surface) 3rem);
}

.list-app .store-group--checked .store-group__header {
  background: transparent;
}

.list-app .store-group--checked .store-group__title {
  color: var(--list-accent);
  text-transform: none;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

/* ——— List items ——— */

.list-app .list-item {
  gap: 0.85rem;
  padding: 1.1rem 1.25rem;
  border-bottom-color: var(--list-border);
  transition: background 0.12s;
}

.list-app .list-item:hover {
  background: color-mix(in srgb, var(--list-accent) 3%, transparent);
}

.list-app .list-item__title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.list-app .list-item__category {
  font-size: 0.75rem;
  color: var(--list-muted);
  margin-top: 0.1rem;
}

.list-app .list-item__price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--list-text);
  letter-spacing: -0.02em;
}

.list-app .list-item__old {
  font-size: 0.875rem;
}

.list-app .list-item__savings {
  color: var(--list-discount);
  font-size: 0.8125rem;
}

.list-app .list-item__meta {
  font-size: 0.75rem;
}

.list-app .list-item__actions .btn {
  border-radius: 999px;
  font-weight: 600;
}

.list-app .list-item__actions .btn-favorite {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--list-border);
  background: var(--list-surface-2);
  font-size: 1rem;
}

.list-app .list-item__actions .btn-favorite--on {
  background: #fef9c3;
  border-color: #fde047;
  color: #a16207;
}

.list-item__hints {
  margin-top: 0.75rem;
  min-width: 0;
  max-width: 100%;
}

.list-item__hints--chosen .hint-mini-scroll {
  padding-bottom: 0.15rem;
}

.list-item__hints--chosen .hint-mini {
  flex-basis: min(14rem, 100%);
}

.list-item__awaiting {
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--list-accent);
  background: var(--list-accent-soft);
  border-radius: 8px;
  display: inline-block;
}

.list-item--checked {
  opacity: 0.72;
  background: var(--list-surface-2);
}

.list-item--checked .list-item__title {
  text-decoration: line-through;
  color: var(--list-muted);
}

.list-item__check {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem 0 0;
  display: flex;
  align-items: flex-start;
}

.list-item__checkbox {
  width: 1.35rem;
  height: 1.35rem;
  accent-color: var(--list-accent);
  border-radius: 6px;
  cursor: pointer;
}

.list-item {
  display: flex;
  align-items: flex-start;
}

.list-item__main {
  flex: 1;
  min-width: 0;
}

.list-item__actions {
  flex-shrink: 0;
}

/* ——— Banners ——— */

.list-trip-summary__card,
.list-template-banner__card {
  border: 1px solid color-mix(in srgb, var(--list-accent) 25%, transparent);
  border-radius: var(--list-radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--list-accent-soft) 0%, var(--list-surface) 55%);
  box-shadow: var(--list-shadow-sm);
}

.list-trip-summary__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.list-trip-summary__savings {
  color: var(--list-accent);
  font-size: 1.0625rem;
  font-weight: 600;
}

.list-template-banner__card p {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.list-template-banner__card .btn {
  border-radius: 999px;
  font-weight: 600;
}

/* ——— Sections & empty ——— */

.list-app .list-section {
  border: 1px solid var(--list-border);
  border-radius: var(--list-radius);
  box-shadow: var(--list-shadow-sm);
  background: var(--list-surface);
}

.list-app .list-section__summary {
  padding: 0.95rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.list-app .list-section__body {
  border-top-color: var(--list-border);
}

.list-app .list-empty,
.list-app .empty.list-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  margin: 1rem 0;
  border-radius: var(--list-radius);
  background: var(--list-surface);
  border: 1px dashed color-mix(in srgb, var(--list-muted) 25%, transparent);
  color: var(--list-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.list-app .list-empty::before,
.list-app .empty.list-empty::before {
  content: '🛒';
  display: block;
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  opacity: 0.85;
}

.list-app .list-empty a,
.list-app .empty.list-empty a {
  color: var(--list-accent);
  font-weight: 600;
  text-decoration: none;
}

.list-app .list-empty a:hover,
.list-app .empty.list-empty a:hover {
  text-decoration: underline;
}

.list-app .list-history {
  margin-top: 1.5rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--list-radius);
  background: var(--list-surface);
  border: 1px solid var(--list-border);
}

.list-app .list-history__title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.list-app .site-footer--mobile {
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(12px);
  border-top-color: var(--list-border);
}

.list-app .site-footer__item--active {
  color: var(--list-accent);
}

@media (min-width: 900px) {
  .hint-mini {
    flex-basis: 11.25rem;
  }

  .list-app .list-item__actions {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }
}
