*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

* {
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  display: none;
}

:root {
  --content-max: 1200px;
  --content-pad: 1.5rem;
  --bg: #f5f5f0;
  --surface: #ffffff;
  --surface-alt: #fafaf7;
  --border: #e5e5dc;
  --text: #1a1a1a;
  --text-muted: #6b6b60;
  --primary: #2d5a27;
  --primary-light: #e8f0e6;
  --primary-hover: #3d7a34;
  --accent: #c45d1e;
  --accent-light: #fdf0e8;
  --danger: #c0392b;
  --success: #27ae60;
  --highlight: #fffbe6;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0.7rem var(--content-pad);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-header:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-header.has-location {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-header-text-only {
  background: none;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}

.btn-header-text-only:hover {
  color: var(--primary);
}

.btn-header-primary {
  background: var(--primary);
  color: white;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.btn-header-primary:hover {
  background: var(--primary-hover);
}

.header-actions {
  position: relative;
}

.user-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
  transition: border-color 0.2s;
}

.user-avatar-btn:hover {
  border-color: var(--primary);
}

.user-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 200px;
  z-index: 1000;
  overflow: hidden;
}

.user-menu.hidden {
  display: none;
}

.user-menu-info {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.user-menu-info strong {
  font-size: 0.9rem;
}

.user-menu-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-menu-logout {
  width: 100%;
  padding: 0.7rem 1rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}

.user-menu-logout:hover {
  background: var(--bg);
}

.btn-header-icon {
  font-size: 1.1rem;
}

.count-pill {
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  min-width: 1.2em;
  text-align: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--primary);
  vertical-align: middle;
  line-height: 1;
}

.logo:hover {
  opacity: 0.8;
}

.logo-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.logo strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* Main */
main {
  max-width: calc(var(--content-max) + 2 * var(--content-pad));
  margin: 0 auto;
  padding: 2rem var(--content-pad) 4rem;
}

/* Steps */
.step {
  display: none;
}

.step.active {
  display: block;
}

.step-header {
  margin-bottom: 1.5rem;
}

.step-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.step-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Search */
.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.search-bar input,
#search-btn,
.search-bar .filter-btn-inline {
  height: 42px;
  box-sizing: border-box;
  font-size: 1rem;
  font-family: inherit;
  border-radius: var(--radius-sm);
  margin: 0;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
}

.search-bar input {
  flex: 1;
  min-width: 0;
  padding: 0 2rem 0 1rem;
  border: 2px solid var(--border);
  background: var(--surface);
  transition: border-color 0.2s;
}

.search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.search-clear:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.search-clear.hidden {
  display: none;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
}

#search-btn {
  padding: 0 1.5rem;
  background: var(--primary);
  color: white;
  border: 2px solid var(--primary);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#search-btn:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* Browse layout */
.browse-layout {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

/* Filter bottom sheet (mobile) */
.filter-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.filter-modal:not(.hidden) {
  display: block;
}

.filter-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.filter-modal:not(.hidden) .filter-modal-backdrop {
  opacity: 1;
}

.filter-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 75vh;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.filter-modal:not(.hidden) .filter-sheet {
  transform: translateY(0);
}

.filter-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.filter-sheet-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.filter-sheet-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.filter-sheet-close:hover {
  color: var(--text);
}

.filter-sheet-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  max-height: 60vh;
}

.filter-sheet-nav .cat-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  border: none;
  border-radius: 0;
  text-align: left;
  border-bottom: none;
}

@media (min-width: 769px) {
  .filter-modal {
    display: none !important;
  }
}

.search-bar .filter-btn-inline {
  display: none;
  flex-shrink: 0;
  position: relative;
  width: 42px;
  min-width: 42px;
  padding: 0;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  cursor: pointer;
}

.search-bar .filter-btn-inline .filter-clear {
  display: none;
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  background: var(--danger);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  border-radius: 50%;
  z-index: 1;
}

.search-bar .filter-btn-inline.has-filter .filter-clear {
  display: block;
}

.search-bar .filter-btn-inline.has-filter {
  border-color: var(--primary);
  color: var(--primary);
}

.search-bar .filter-btn-inline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface);
}

/* Next step bottom bar (mobile only) */
.next-step-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 95;
  align-items: center;
  gap: 0.75rem;
  box-sizing: border-box;
}

.next-step-list-btn {
  position: relative;
  flex-shrink: 0;
  padding: 0.5rem 0.6rem;
  background: none;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.next-step-list-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.next-step-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.next-step-bottom-btn {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 0.75rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.next-step-bottom-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.next-step-bottom-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.category-sidebar {
  width: 160px;
  min-width: 160px;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: sticky;
  top: 1rem;
  padding: 0;
  border-right: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-sidebar::-webkit-scrollbar {
  display: none;
}

.filter-overlay {
  display: none;
}

.cat-item {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  line-height: 1.3;
}

.cat-item:hover {
  background: var(--surface);
  color: var(--primary);
}

.cat-item:hover {
  background: var(--surface);
  color: var(--primary);
}

.cat-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.browse-main {
  flex: 1;
  min-width: 0;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.product-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  display: block;
  width: 100%;
}

.product-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-card.in-list {
  border-color: var(--primary);
  background: var(--primary-light);
}

.product-card .product-img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.product-card .product-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.product-card .product-category {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.product-card .product-price {
  margin-top: 0.5rem;
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

.product-card .product-price small {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.product-card .product-stores {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.product-card .check-mark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.product-card.in-list .check-mark {
  display: flex;
}

/* My Lists panel */
.my-lists-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  max-width: 100%;
  height: 100%;
  background: var(--surface);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.my-lists-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.my-lists-header h3 {
  font-size: 1.1rem;
}

.close-panel {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.close-panel:hover {
  color: var(--text);
}

.saved-lists-container {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.saved-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.15s;
}

.saved-list-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.saved-list-item .list-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.saved-list-item .list-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.saved-list-item .list-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  line-height: 1;
}

.saved-list-item .list-delete:hover {
  color: var(--danger);
}

.empty-hint {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.empty-hint p {
  margin-bottom: 0.5rem;
}

.register-cta-box {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--highlight);
}

.register-cta-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.register-cta-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.btn-register {
  width: 100%;
  padding: 0.7rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-register:hover {
  background: #a84d17;
}

.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.2s;
}

.panel-overlay:not(.hidden) {
  opacity: 1;
}

/* Shopping list – desktop sidebar */
.shopping-list-sidebar {
  width: 280px;
  min-width: 280px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}

.list-drag-handle {
  display: none;
  align-items: center;
  justify-content: center;
  height: 28px;
  margin: 0.5rem 0 0;
  touch-action: none;
  flex-shrink: 0;
}

.list-drag-handle::after {
  content: "";
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

.shopping-list-sidebar .list-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.shopping-list-sidebar .list-panel-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.list-panel-actions {
  display: flex;
  gap: 0.3rem;
}

.btn-list-action {
  padding: 0.3rem 0.5rem;
  background: none;
  border: none;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
}

.btn-list-action:hover {
  background: var(--primary-light);
}

.btn-list-action-muted {
  color: var(--text-muted);
}

.btn-list-action-muted:hover {
  background: var(--surface-alt);
  color: var(--danger);
}

.shopping-list-sidebar .list-scroll-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

.shopping-list-sidebar .list-total {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.shopping-list-sidebar .btn-primary {
  margin-bottom: 0.5rem;
}

.list-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.badge {
  background: var(--primary);
  color: white;
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

#shopping-list {
  list-style: none;
}

#shopping-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.3;
}

#shopping-list li:last-child {
  border-bottom: none;
}

#shopping-list li span {
  flex: 1;
  min-width: 0;
}

#shopping-list li small {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.1rem;
}

#shopping-list .remove-item {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.35rem 0.5rem;
  min-width: 36px;
  min-height: 36px;
  border-radius: 6px;
  font-family: inherit;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

#shopping-list .remove-item:hover {
  background: #fce4e4;
}

.list-total {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  padding: 0.5rem 0;
  border-top: 2px solid var(--border);
  margin-bottom: 0.75rem;
}

#list-estimate {
  color: var(--primary);
  font-size: 1.1rem;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 0.85rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 0.7rem 1.2rem;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-geo {
  width: 100%;
  padding: 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-geo:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.btn-geo:active {
  transform: translateY(1px);
}

.geo-icon {
  font-size: 1.2rem;
}

/* Location */
.location-options {
  position: relative;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.location-options .btn-geo {
  width: 100%;
  min-height: 42px;
  height: 42px;
  padding: 0 1.25rem;
  box-sizing: border-box;
  font-size: 0.9rem;
}

.btn-saved-addresses {
  width: 100%;
  min-height: 42px;
  height: 42px;
  padding: 0 1.25rem;
  box-sizing: border-box;
  background: none;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: border-color 0.2s, color 0.2s;
}

.btn-saved-addresses:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.address-input-wrap {
  position: relative;
  width: 100%;
}

.address-input {
  display: flex;
  align-items: center;
  gap: 0;
}

.address-locate-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, background 0.15s, border-color 0.2s;
  margin-left: 0.4rem;
  padding: 0;
}

.address-locate-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary);
}

.address-locate-btn.active {
  color: var(--primary);
}

.address-locate-btn.locating {
  animation: pulse-locate 1s ease-in-out infinite;
}

@keyframes pulse-locate {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.address-input-inner {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 42px;
}

.address-input-inner input {
  width: 100%;
}

.address-clear {
  position: absolute;
  right: 8px;
  top: 9px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  z-index: 1;
}

.address-clear:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.address-clear.hidden {
  display: none;
}

.address-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}

.address-results:not(.hidden) {
  display: block;
}

.address-results .result-item {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.address-results .result-item:last-child {
  border-bottom: none;
}

.address-results .result-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.address-input input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 2.5rem 0 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  text-overflow: ellipsis;
  overflow: hidden;
}

.address-input input:focus {
  outline: none;
  border-color: var(--primary);
}

.address-input > button:not(.address-locate-btn),
#geocode-btn {
  height: 42px;
  padding: 0 1.2rem;
  box-sizing: border-box;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

#location-status {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

#location-status.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

#location-status.error {
  background: #fce4e4;
  color: var(--danger);
  border: 1px solid #f5c6cb;
}

.mini-map {
  position: relative;
  z-index: 1;
  height: 180px;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  border: 1.5px solid var(--border);
}

.share-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-share:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.share-toast {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  transition: opacity 0.3s;
}

.share-toast.hidden {
  opacity: 0;
}

.step-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.step-actions-location {
  position: sticky;
  bottom: 0;
  padding: 1rem 0 1rem;
  margin-top: 1.5rem;
  margin-bottom: -1rem;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Results */
#results-container {
  display: flex;
  flex-direction: column;
}

.results-tabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}

.results-tab {
  padding: 0.75rem 0;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.results-tab:hover {
  color: var(--text);
}

.results-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.results-tab-panel {
  display: none;
}

.results-tab-panel.active {
  display: block;
}

.tab-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.summary-item {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
}

.summary-item .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-item .value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 0.2rem;
}

.summary-item .value.accent {
  color: var(--accent);
}

.store-list {
  margin-bottom: 1rem;
}

.store-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.store-item:last-child {
  border-bottom: none;
}

.store-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  flex-shrink: 0;
}

.store-info {
  flex: 1;
}

.store-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.store-address {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.store-distance {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.store-nav-link {
  font-size: 0.8rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.store-nav-link:hover {
  text-decoration: underline;
}

.assignment-list {
  margin-bottom: 1rem;
}

/* Cheapest cart – store selector bar */
@keyframes recalcFlash {
  0% { outline: 3px solid var(--primary); outline-offset: 0; opacity: 0.5; }
  50% { outline: 3px solid var(--primary); outline-offset: 4px; opacity: 1; }
  100% { outline: 3px solid transparent; outline-offset: 0; opacity: 1; }
}

.recalc-flash {
  animation: recalcFlash 0.5s ease-out;
}

.cheapest-missing {
  background: #fce4e4;
  color: #c62828;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.cheapest-missing-list {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  opacity: 0.95;
}

.cheapest-missing-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.cheapest-missing-name {
  flex: 1;
  min-width: 0;
}

.cheapest-missing-unavailable {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.cheapest-missing-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--surface);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.cheapest-missing-btn:hover {
  background: var(--primary-light);
}

.cheapest-missing-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.cheapest-missing-btn.active:hover {
  background: var(--primary-hover);
}

.cheapest-store-tabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.cheapest-store-tab {
  padding: 0.75rem 0;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.cheapest-store-tab:hover {
  color: var(--text);
}

.cheapest-store-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Cheapest cart – grouped by store */
.cart-store-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.cart-store-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.cart-store-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-store-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.cart-store-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.store-nav-btn {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
}

.store-nav-btn:hover {
  background: var(--primary);
  color: white;
}

.cart-store-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.cart-store-subtotal {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
}

.cart-store-items {
  border-top: 1px solid var(--border);
  padding-top: 0.4rem;
}

.cart-product {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.82rem;
}

.cart-product-name {
  flex: 1;
  color: var(--text);
}

.cart-product-price {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  margin-left: 0.5rem;
}

.result-map {
  height: 300px;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  border: 1.5px solid var(--border);
}

/* Single store results */
.single-store-item .rank {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-muted);
  width: 2rem;
  text-align: center;
}

.single-store-item.best .rank {
  color: var(--accent);
}

.single-store-details {
  flex: 1;
}

.single-store-details .store-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

.single-store-details .store-title-row .store-name {
  margin-bottom: 0;
}

.single-store-total {
  text-align: right;
}

.single-store-total .price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

.single-store-total .coverage {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.missing-badge {
  background: #fce4e4;
  color: var(--danger);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Radius selector */
.radius-options {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.radius-btn {
  flex: 1;
  padding: 0.45rem 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-align: center;
  white-space: nowrap;
}

.radius-btn:hover:not(:disabled),
.radius-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.radius-btn:disabled,
.radius-btn.empty {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* Shop list */
.shops-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.shops-header h3 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
}

.btn-link:hover {
  background: var(--primary-light);
}

.shops-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.shop-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.shop-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.shop-card.excluded {
  opacity: 0.45;
  background: var(--surface-alt);
}

.shop-card-toggle {
  flex-shrink: 0;
}

.toggle-switch {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--border);
  position: relative;
  transition: background 0.2s;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}

.toggle-switch.on {
  background: var(--primary);
}

.toggle-switch.on::after {
  transform: translateX(16px);
}

.shop-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  flex-shrink: 0;
}

.shop-info {
  flex: 1;
  min-width: 0;
}

.shop-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-address {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-meta {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.15rem;
}

.shop-distance {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
}

.shop-coverage {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Breakdown in single-store results */
.breakdown-toggle {
  display: block;
  width: 100%;
  flex-basis: 100%;
  padding: 0.5rem;
  margin-top: 0.5rem;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  border-top: 1px solid var(--border);
}

.breakdown-toggle:hover {
  background: var(--primary-light);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.breakdown {
  flex-basis: 100%;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--surface-alt);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.breakdown-item.missing {
  color: var(--text-muted);
}

.breakdown-missing-badge {
  background: #fce4e4;
  color: #c62828;
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
}

.breakdown-item:last-child {
  border-bottom: none;
}

.breakdown-price {
  font-weight: 600;
  color: var(--primary);
}

.full-badge {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.25rem;
}

.single-store-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  background: var(--surface-alt);
  position: relative;
}

.single-store-item.best {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Loading / Empty */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.shops-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2.5rem;
  margin: 1rem 0;
  background: var(--surface-alt);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.shops-loading p {
  margin: 0;
  font-size: 0.95rem;
}

.shops-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: shops-spin 0.7s linear infinite;
}

@keyframes shops-spin {
  to { transform: rotate(360deg); }
}

.shops-error {
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.shops-error.hidden {
  display: none !important;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-style: italic;
}

.hidden {
  display: none !important;
}

/* Modals */
.modal,
.modal[open] {
  padding: 0;
  padding-inline: 0;
}
.modal {
  border: none;
  padding: 0;
  margin: auto;
  margin-inline: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  width: 400px;
  overflow: hidden;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  padding: 1.5rem;
  box-sizing: border-box;
}

.modal-content h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.modal-content label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.modal-content input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  margin-bottom: 1rem;
  font-family: inherit;
}

.modal-content input:focus {
  outline: none;
  border-color: var(--primary);
}

.location-modal {
  width: 460px;
  max-width: 95vw;
  max-height: 80vh;
  overflow-y: auto;
  margin: 0;
  inset: unset;
}

.location-modal-content {
  padding: 1.5rem;
}

.location-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.location-modal-header h3 {
  font-size: 1.2rem;
  margin: 0;
}

.location-done-bar {
  position: sticky;
  bottom: 0;
  background: white;
  padding: 0.75rem 0 0.25rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.location-done-bar .btn-primary {
  width: 100%;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.modal-signin {
  position: relative;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.modal-signin h3 {
  margin: 0 0 0.25rem;
}

.signin-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.modal-signin .btn-google-signin {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.btn-google-signin:hover {
  border-color: #4285F4;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.15);
}

.btn-google-signin svg {
  flex-shrink: 0;
}

.signin-terms {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
  line-height: 1.5;
}

.signin-terms a {
  color: var(--primary);
  text-decoration: underline;
}

.modal-close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0.25rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  color: var(--text);
}

.legal-page {
  max-width: 640px;
  margin: 0 auto;
}

.legal-page h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-page h2 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-page p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-legal {
  margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }
  .btn-header-text {
    display: none;
  }
  .btn-header {
    padding: 0.5rem 0.75rem;
  }
  .my-lists-panel {
    width: 100%;
    left: 0;
  }
  .browse-layout {
    flex-direction: column;
    gap: 0.75rem;
  }
  .category-sidebar {
    display: none;
  }
  .search-bar .filter-btn-inline {
    display: flex;
  }
  .next-step-bottom-bar:not(.hidden) {
    display: flex;
  }
  #step-search {
    padding-bottom: 5rem;
  }
  .shopping-list-sidebar.empty {
    display: none !important;
  }
  .list-drag-handle {
    display: flex;
  }
  .shopping-list-sidebar:not(.empty) {
    position: fixed;
    bottom: 4rem;
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    max-height: 70vh;
    border-radius: var(--radius) var(--radius) 0 0;
    margin: 0;
    top: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 90;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  }
  .shopping-list-sidebar.open-mobile {
    transform: translateY(0);
  }
  .list-scroll-wrap {
    max-height: 40vh;
    flex: 1;
    min-height: 120px;
  }
  .shopping-list-sidebar #next-step-btn {
    display: none;
  }
}

.list-overlay-mobile {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 85;
}

@media (max-width: 768px) {
  .list-overlay-mobile:not(.hidden) {
    display: block;
  }
}

@media (min-width: 769px) {
  .next-step-bottom-bar {
    display: none !important;
  }
  .list-overlay-mobile {
    display: none !important;
  }
}

@media (max-width: 600px) {
  header { padding: 0.5rem 0.75rem; }
  main { padding: 1.5rem 1rem 3rem; }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  .product-card .product-img { height: 80px; }
  .step-actions { flex-direction: column; }
  .summary { grid-template-columns: 1fr 1fr; }

  .location-modal {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    height: 100vh !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
  }

  .location-modal-content {
    padding: 1rem;
    min-height: 100%;
    box-sizing: border-box;
  }
}
