*,
*::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;
  --header-sticky-offset: 4.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;
}

html {
  overscroll-behavior-y: none;
}

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

#page-wrap {
  width: 100%;
  overflow-x: clip;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0.7rem var(--content-pad);
  width: 100%;
  box-sizing: border-box;
}

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

.header-inner {
  position: relative;
  max-width: var(--content-max);
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-sizing: border-box;
}

.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;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-lang {
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 4px;
  height: 36px;
  width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
}

.btn-lang:hover {
  transform: scale(1.15);
  background: var(--surface-hover, rgba(0,0,0,0.05));
}

.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: 1100;
  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-item,
.user-menu-logout {
  display: block;
  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);
  text-decoration: none;
  transition: background 0.15s;
}

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

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

.btn-header-arrow {
  font-size: 0.65rem;
  opacity: 0.8;
  margin-left: 0.2rem;
}

.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;
  flex-shrink: 0;
}

.logo:hover {
  opacity: 0.8;
}

.results-origin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.results-origin-row .results-origin-chip {
  margin-bottom: 0;
  min-width: 0;
}
@media (max-width: 600px) {
  .results-origin-row {
    flex-direction: column;
    align-items: stretch;
  }
  .results-origin-disclaimer {
    text-align: center;
  }
}
.results-origin-disclaimer {
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
}
.results-origin-disclaimer a {
  color: var(--text-muted);
  text-decoration: underline;
}
.results-origin-disclaimer a:hover {
  color: var(--primary);
}

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

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

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

/* Steps */
.step {
  display: none;
  max-width: 100%;
}

.step.active {
  display: block;
}

.step-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: -0.75rem;
  margin-bottom: 1rem;
}

/* Step tabs */
.step-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.step-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.step-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.step-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 600;
}

.step-tab svg {
  flex-shrink: 0;
}

/* Champions view */
.champions-view {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  max-width: 100%;
}

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

/* Store nav – reuses .category-sidebar + .cat-item */
.champions-store-nav:empty {
  display: none;
}

.cat-item-store {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
}

.cat-item-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
  flex-shrink: 0;
}

.cat-item-store-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-item-badge {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0 5px;
  line-height: 1;
}



.champions-store-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a6fb5;
  margin-top: 1.75rem;
  margin-bottom: 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

.champions-store-title:first-child {
  margin-top: 0;
}

.champions-store-title-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
}

.champions-set-location {
  width: auto;
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.7rem 1.5rem;
}

/* Champions mode – keep the shopping list bottom bar visible */

@media (max-width: 600px) {
  .step-tabs {
    gap: 0.35rem;
  }
  .step-tab {
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Search */
.search-sticky-wrap {
  position: sticky;
  top: var(--header-sticky-offset);
  z-index: 50;
  background: var(--bg);
  padding-bottom: 0.5rem;
  margin-bottom: 0;
  isolation: isolate;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  width: 100%;
}

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

/* Sort button */
.sort-btn {
  height: 42px;
  width: 42px;
  min-width: 42px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, color 0.2s;
}

.sort-btn:hover,
.sort-btn.active {
  border-color: var(--primary);
  color: var(--primary);
}

.sort-btn:focus,
.sort-sheet-option:focus,
.filter-btn-inline:focus,
.filter-sheet-nav .cat-item:focus {
  outline: none;
}

/* Sort bottom sheet */
.sort-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.25s;
}

.sort-sheet-overlay.visible {
  opacity: 1;
}

.sort-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  z-index: 10002;
  border-radius: 1rem 1rem 0 0;
  padding: 0.5rem 0 calc(1rem + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.sort-sheet.visible {
  transform: translateY(0);
}

.sort-sheet-handle {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  margin: 0.5rem auto 0.75rem;
  flex-shrink: 0;
}

.sort-sheet-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 1.25rem 0.5rem;
}

.sort-sheet-option {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border: none;
  background: none;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.sort-sheet-option:hover {
  background: var(--surface-alt);
}

.sort-sheet-option.selected {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* Sort: desktop dropdown */
@media (min-width: 769px) {
  #sort-sheet-overlay {
    display: none !important;
  }

  #sort-sheet {
    position: fixed;
    left: auto;
    bottom: auto;
    width: 220px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    padding: 0.35rem 0;
    transform: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 10001;
  }

  #sort-sheet .sort-sheet-handle,
  #sort-sheet .sort-sheet-title {
    display: none;
  }

  #sort-sheet.visible {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  #sort-sheet .sort-sheet-option {
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
  }
}

.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);
}

/* Main content + sidebar wrapper */
.step-content-layout {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  min-width: 0;
  max-width: 100%;
}

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

/* Browse layout */
.browse-layout {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-top: 0;
  min-width: 0;
  max-width: 100%;
}

.browse-main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

/* Filter bottom sheet (mobile) — reuses .sort-sheet styles */
.filter-sheet {
  max-height: 75vh;
  flex-direction: column;
}

.filter-sheet:not(.hidden) {
  display: flex;
}

.filter-sheet-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
}

.filter-sheet-nav .cat-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border: none;
  background: none;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  border-radius: 0;
  transition: background 0.15s;
}

.filter-sheet-nav .cat-item:hover {
  background: var(--surface-alt);
}

.filter-sheet-nav .cat-item.active {
  color: var(--primary);
  font-weight: 600;
}

@media (min-width: 769px) {
  #filter-sheet,
  #filter-overlay,
  #store-filter-sheet,
  #store-filter-overlay {
    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-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  white-space: nowrap;
}
.next-step-total:empty { display: none; }
.footer-best { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.footer-worst { font-size: 0.72rem; font-weight: 400; color: var(--text-muted); text-decoration: line-through; }

.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: calc(100vh - var(--header-sticky-offset) - 1rem);
  overflow-y: auto;
  overflow-x: hidden;
  position: sticky;
  top: var(--header-sticky-offset);
  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;
}


/* Product Grid */
.product-count-row {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.2;
  margin: 0 0 0.35rem 0;
  transition: font-size 0.15s;
}
.product-count-row.showing-category {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.product-count-row.showing-category .savings-inline {
  display: none;
}
.product-count-row .savings-inline {
  color: #16a34a;
  font-weight: 700;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
  max-width: 100%;
  min-width: 0;
  position: relative;
  z-index: 0;
}

.category-section {
  margin-top: 1.25rem;
}

.category-section:first-child {
  margin-top: 0;
}

.category-section-header {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.category-section .product-grid {
  margin-top: 0;
  margin-bottom: 0;
}

/* Skeleton loading cards */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

#search-loading.hidden { display: none; }
#search-results.hidden { display: none; }

.skeleton-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skeleton-img,
.skeleton-line {
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border) 50%, var(--surface-alt) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
}

.skeleton-img {
  width: 100%;
  height: 90px;
  border-radius: var(--radius-sm);
}

.skeleton-line {
  height: 0.75rem;
}

.skeleton-line.w70 { width: 70%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w50 { width: 50%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.tall { height: 1rem; }

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

/* Hover lift only for pointer devices; on touch, hover can stick and cause other cards to "move" when list re-renders */
@media (hover: hover) {
  .product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }
}

.product-card:focus {
  outline: none;
}

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

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

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

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


.price-range {
  margin-top: 0.5rem;
  background: var(--surface-alt);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.price-range-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-range-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.price-range-best .price-range-label {
  color: var(--primary);
}

.price-range-best .price-range-value {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary);
}

.price-range-worst .price-range-label {
  color: var(--text-muted);
}

.price-range-worst .price-range-value {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-range-footer {
  margin-top: 0.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
}

.price-range-stores {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.store-icon {
  vertical-align: middle;
  opacity: 0.7;
}

.price-range-save {
  font-weight: 700;
  color: var(--success);
}

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

.product-card .check-mark {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  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: none;
}

.card-info-link {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  z-index: 2;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.card-info-link:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.card-info-link svg {
  width: 14px;
  height: 14px;
}

.product-card.unavailable-in-area {
  opacity: 0.85;
}

.product-card.unavailable-in-area .unavailable-label {
  display: block;
  font-size: 0.75rem;
  color: #b45309;
  font-style: normal;
  margin-top: 0.2rem;
}

#shopping-list li.item-unavailable {
  background: #fef3c7;
  border-left: 4px solid #d97706;
  padding-left: 0.75rem;
}

#shopping-list .unavailable-badge {
  display: block;
  margin-top: 0.35rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #92400e;
  background: #fde68a;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* My Lists panel */
.my-lists-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}

.my-lists-panel:not(.hidden) {
  display: flex;
}

@media (min-width: 769px) {
  .my-lists-panel {
    left: auto;
    width: 340px;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  }
}

.my-lists-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
}

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

.panel-close-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

.panel-close-btn:hover {
  background: var(--surface-alt);
}

.panel-close-btn svg {
  display: block;
}

.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 > div:first-child {
  flex: 1;
  min-width: 0;
}

.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-edit,
.saved-list-item .list-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.saved-list-item .list-edit:hover {
  color: var(--primary);
}

.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;
}

.profile-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.profile-panel-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.profile-panel-user img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-panel-user-initial {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-panel-user-text strong {
  display: block;
  font-size: 1rem;
}

.profile-panel-user-text span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-panel-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  transition: background 0.15s;
}

.profile-panel-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.profile-panel-btn.logout {
  margin-top: 0.5rem;
  color: var(--text-muted);
}

.profile-panel-btn.logout:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* 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: var(--header-sticky-offset);
  max-height: calc(100vh - var(--header-sticky-offset) - 1rem);
  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;
  flex-shrink: 0;
}

.btn-list-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  background: var(--surface-alt, #f0f0f0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.btn-list-icon:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: scale(1.08);
}

.btn-list-icon-muted {
  opacity: 0.65;
}

.btn-list-icon-muted:hover {
  opacity: 1;
  background: var(--danger-light, #ffe0e0);
  border-color: var(--danger, #e53e3e);
}

.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);
}

.list-summary-bar {
  flex-shrink: 0;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.shopping-list-sidebar .list-summary-bar .list-total {
  padding-top: 0;
  border-top: none;
  margin-bottom: 0.5rem;
}

.shopping-list-sidebar .list-summary-bar .btn-primary {
  width: 100%;
  margin-bottom: 0.4rem;
}

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

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

.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 {
  min-width: 0;
}

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

#shopping-list li .list-item-info {
  flex: 1;
  min-width: 0;
}

#shopping-list li .list-item-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#shopping-list li .list-item-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

#shopping-list .remove-item {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem 0.35rem;
  min-width: 28px;
  min-height: 28px;
  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;
}

/* Qty pill on product cards – replaces checkmark when in list */
.card-qty-pill {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--primary, #2563eb);
  border-radius: 14px;
  height: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  z-index: 2;
  overflow: hidden;
}

.card-qty-pill .qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background 0.15s;
}

.card-qty-pill .qty-btn:hover {
  background: rgba(255,255,255,0.2);
}

.card-qty-pill .qty-btn:active {
  background: rgba(255,255,255,0.35);
}

.card-qty-pill .qty-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  min-width: 16px;
  text-align: center;
  user-select: none;
  line-height: 1;
}

@media (max-width: 768px) {
  .card-qty-pill {
    height: 26px;
    border-radius: 13px;
  }
  .card-qty-pill .qty-btn {
    width: 26px;
    font-size: 0.85rem;
  }
  .card-qty-pill .qty-value {
    font-size: 0.7rem;
    min-width: 14px;
  }
}

/* Qty stepper in shopping list sidebar */
.list-qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  height: 28px;
}

.list-qty-stepper .qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 100%;
  background: var(--surface);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background 0.15s;
}

.list-qty-stepper .qty-btn:hover {
  background: var(--border);
}

.list-qty-stepper .qty-btn:active {
  background: var(--text-muted);
  color: #fff;
}

.list-qty-stepper .qty-value {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  padding: 0 1px;
  user-select: none;
}

.cart-product-qty {
  font-size: 1em;
  font-weight: 700;
  color: var(--primary, #2563eb);
  margin-left: 0.25em;
}

.list-total {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  padding: 0.5rem 0;
  margin-bottom: 0;
}

#list-estimate {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
}

.est-prices {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.est-best {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 700;
}

.est-worst {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: line-through;
  font-weight: 400;
}

.est-saving {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--success);
}

/* 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-quick-actions {
  display: flex;
  gap: 0.5rem;
}

.location-quick-actions .btn-geo {
  flex: 1;
  min-width: 0;
}

.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: 50%;
  transform: translateY(-50%);
  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-loading {
  display: flex;
  justify-content: center;
  padding: 0.75rem;
}
.address-loading-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.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;
  gap: 2rem;
}

/* Hero – savings spotlight */
.results-hero {
  text-align: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, #1e4620 100%);
  border-radius: var(--radius);
  color: white;
  box-shadow: var(--shadow-lg);
}

.results-hero.hidden {
  display: none;
}

.results-hero-label {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

.results-savings {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}

.results-hero-sub {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 0.35rem;
}

.results-hero-breakdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.6rem;
}

.hero-bd-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.hero-bd-label {
  opacity: 0.6;
  font-size: 0.85rem;
}

.hero-bd-worst {
  text-decoration: line-through;
  opacity: 0.55;
}

.hero-bd-best {
  font-weight: 700;
}


/* Best route */

.results-route-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0;
  letter-spacing: -0.02em;
  padding: 0;
}

.results-origin-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text);
}

.results-origin-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.results-origin-text {
  font-weight: 500;
}

.results-route-stores {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.results-store-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: visible;
}

.results-store-card-inner {
  padding: 0.75rem;
}

.results-store-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

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

.results-store-name {
  font-weight: 700;
  font-size: 1rem;
}

.results-store-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.results-store-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

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

.results-store-worst,
.results-total-worst {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 0.35em;
}

.results-nav-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.results-nav-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.results-store-items-toggle {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.4rem 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
}

.results-store-items-toggle:hover {
  color: var(--primary);
}

.results-store-items {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  overflow: visible;
}

.results-store-items.hidden {
  display: none;
}

.breakdown-worst-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.breakdown-worst-switch {
  appearance: none;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--border);
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

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

.breakdown-worst-switch:checked {
  background: var(--primary);
}

.breakdown-worst-switch:checked::before {
  transform: translateX(18px);
}

.results-store-items .breakdown-items {
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.results-store-items .cart-product {
  padding: 0.3rem 0;
}

.cart-product-prices {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-product-worst {
  display: none;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
  position: relative;
  cursor: help;
}

.cart-product-worst:focus {
  outline: none;
}

.worst-case-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 0.35rem 0.6rem;
  background: var(--text);
  color: white;
  font-size: 0.75rem;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 1000;
}

@media (max-width: 480px) {
  .worst-case-tooltip {
    white-space: normal;
    max-width: 160px;
  }
}

.worst-case-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border: 4px solid transparent;
  border-top-color: var(--text);
}

.cart-product-worst:hover .worst-case-tooltip,
.cart-product-worst.tooltip-visible .worst-case-tooltip,
.breakdown-worst:hover .worst-case-tooltip,
.breakdown-worst.tooltip-visible .worst-case-tooltip {
  opacity: 1;
}

.breakdown-worst {
  position: relative;
  cursor: help;
}

.breakdown-items.show-worst .cart-product-worst {
  display: inline;
}

.breakdown-item .breakdown-prices {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.breakdown-worst {
  display: none;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.breakdown-items.show-worst .breakdown-worst {
  display: inline;
}

.results-store-items .cart-product.missing {
  color: #b71c1c;
  font-style: italic;
}

.results-store-items .cart-product.missing .cart-product-price {
  color: #b71c1c;
  font-weight: 600;
}

.results-route-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--border);
  font-size: 1rem;
}

.results-route-total strong {
  font-size: 1.25rem;
  color: var(--primary);
}

/* Missing products */
.results-missing-wrap {
  padding: 1rem;
  background: #fef5f5;
  border-radius: var(--radius-sm);
  border: 1px solid #f5d5d5;
}

/* 1-store alternative (when best route is 2 stores) */
.results-one-store-alt {
  padding: 1rem;
  background: var(--surface-alt);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  overflow: visible;
}

.results-one-store-alt.hidden {
  display: none;
}

.results-one-store-alt-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.results-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

.btn-results-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-results-share {
  background: var(--primary);
  color: white;
}

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

.btn-results-save {
  background: var(--surface-alt);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-results-save:hover {
  background: var(--border);
  border-color: var(--text-muted);
}

.btn-results-save.btn-results-cta {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-results-save.btn-results-cta:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.results-missing-wrap.hidden {
  display: none;
}

.results-missing-title {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

/* Other single-store options */
.results-other-options {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
}

.results-other-options.hidden {
  display: none;
}

.results-other-options summary {
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--primary);
  padding: 0.5rem 0;
  list-style: none;
  transition: color 0.15s;
}

.results-other-options summary::-webkit-details-marker {
  display: none;
}

.results-other-options summary::marker {
  display: none;
}

.results-other-options summary::before {
  content: "▾ ";
  font-size: 1.7em;
  opacity: 0.7;
}

.results-other-options[open] summary::before {
  content: "▴ ";
}

.results-other-options summary:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.results-other-options[open] summary {
  margin-bottom: 1rem;
}

.results-other-options #single-stores {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.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;
  color: var(--text-muted);
}

.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;
}

.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);
  overflow: visible;
}

.breakdown-item.missing {
  color: #b71c1c;
  font-style: italic;
}

.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;
}

.shops-unavailable-notice {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #fef3c7;
  color: #92400e;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.shops-unavailable-notice .shops-unavailable-list {
  margin: 0.5rem 0 0 1rem;
  padding-left: 0.5rem;
}

.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: 90vh;
  height: auto;
  overflow: hidden;
  margin: auto;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  transition: height 0.25s ease-out;
}

.location-modal.location-modal-expanded {
  height: 80vh;
}

.addresses-modal {
  width: 460px;
  max-width: 95vw;
  max-height: 80vh;
  overflow-y: auto;
  margin: auto;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

.location-modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  padding: 1.5rem;
}

.close-panel {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.close-panel:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: var(--surface-alt);
}

.location-modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 1rem;
}

.location-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

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

.addresses-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.addresses-modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 1rem;
}

.addresses-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: capitalize;
  margin: 0;
}

.addresses-modal-header .close-panel {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.addresses-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

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

.address-item-row:last-of-type {
  border-bottom: none;
}

.address-item-row.address-item-active {
  background: var(--primary-light);
}

.address-item-text {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.address-item-edit,
.address-item-choose {
  flex-shrink: 0;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.address-item-edit {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
}

.address-item-edit:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.address-item-choose {
  border: none;
  background: var(--primary);
  color: white;
}

.address-item-choose:hover {
  background: var(--primary-hover);
}

.current-location-section {
  margin-bottom: 0.75rem;
}
.addresses-section-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.5rem 0 0.25rem;
}
.current-location-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.current-location-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}
.current-location-text {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.add-new-address-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  color: var(--primary);
  transition: border-color 0.2s, background 0.2s;
}

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

.location-modal-body {
  padding-top: 0.25rem;
}

.location-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: capitalize;
  margin: 0;
}

.location-modal-header .close-panel {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.location-done-bar {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background: white;
  padding: 0.75rem 0 0.25rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}
.location-done-bar .btn-primary {
  flex: 1;
}
.location-done-bar .btn-primary:only-child {
  width: 100%;
}
.location-done-bar .btn-secondary {
  flex: 1;
}

.location-done-bar .location-delete-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.location-done-bar .location-delete-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: #fce4e4;
}

.remove-unavailable-desc {
  margin-bottom: 0.75rem;
  color: var(--text);
}

.remove-unavailable-list {
  margin: 0 0 1rem 1rem;
  padding-left: 0.5rem;
}

.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;
}

.lang-link {
  margin-bottom: 0.5rem;
}

.lang-link a {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.lang-link a:hover {
  text-decoration: underline;
}

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

.legal-page p,
.legal-page li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}
.legal-page ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.legal-table th,
.legal-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}
.legal-table th {
  background: var(--surface-alt);
  font-weight: 600;
}

/* Footer - min-height reserves space to reduce CLS when web font loads */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  min-height: 10rem;
  max-width: 100%;
  box-sizing: border-box;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

footer a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

footer a:hover {
  color: var(--primary-hover);
}

.footer-legal {
  margin-top: 1rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.footer-made {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Cookie consent */
.cookie-consent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9999;
}

.cookie-consent-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem var(--content-pad);
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.cookie-consent-bar .cookie-consent-text {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

.cookie-consent-bar .cookie-consent-text a {
  color: var(--primary);
  text-decoration: underline;
}

.cookie-consent-bar .cookie-consent-text a:hover {
  text-decoration: none;
}

.cookie-consent-bar .cookie-consent-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.cookie-consent-bar .cookie-consent-minimal {
  padding: 0;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-muted);
}

.cookie-consent-bar .cookie-consent-minimal:hover {
  color: var(--text);
}

.cookie-consent-bar .cookie-consent-allow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--primary);
  color: white;
  cursor: pointer;
}

.cookie-consent-bar .cookie-consent-allow:hover {
  background: var(--primary-hover);
}

@media (max-width: 700px) {
  .cookie-consent-bar {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    flex-direction: column;
    align-items: stretch;
    max-width: calc(100% - 2rem);
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    gap: 1.25rem;
  }
  .cookie-consent-bar .cookie-consent-text {
    flex: none;
    text-align: left;
  }
  .cookie-consent-bar .cookie-consent-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
    align-items: stretch;
  }
  .cookie-consent-bar .cookie-consent-minimal {
    text-align: center;
    padding: 0.5rem;
  }
  .cookie-consent-bar .cookie-consent-allow {
    width: 100%;
    padding: 1rem;
  }
}

/* Responsive */
@media (max-width: 768px) {
  header {
    position: sticky;
  }
  .header-inner {
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
  }
  .header-left {
    display: contents;
  }
  .header-actions {
    min-width: 0;
  }
  .header-left .logo {
    order: 1;
  }
  .header-actions {
    order: 2;
    margin-left: auto;
  }
  .btn-location-header {
    order: 4;
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-start;
    margin-top: 0.25rem;
  }
  .btn-header-text {
    display: none;
  }
  .btn-location-header .btn-header-text {
    display: inline;
  }
  .btn-header {
    padding: 0.5rem 0.75rem;
  }
  .results-route-title {
    font-size: 1.2rem;
    font-weight: 800;
  }
  .step-content-layout {
    flex-direction: column;
  }
  .browse-layout {
    flex-direction: column;
    gap: 0.75rem;
  }
  .champions-view {
    flex-direction: column;
  }
  .champions-view .category-sidebar {
    display: none;
  }
  .search-sticky-wrap {
    top: 6.5rem;
    padding-top: 0.5rem;
  }
  .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;
    top: auto;
    bottom: 4rem;
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: 70%;
    border-radius: var(--radius) var(--radius) 0 0;
    margin: 0;
    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; }

  /* Results page – best route on mobile */
  #results-container {
    gap: 1.25rem;
  }
  .results-hero {
    padding: 1.25rem 1rem;
  }
  .results-savings {
    font-size: clamp(2rem, 10vw, 3rem);
  }
  .results-origin-chip {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  .results-origin-text {
    word-break: break-word;
  }
  .results-route-title {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.35;
    word-break: break-word;
  }
  .results-store-card-inner {
    padding: 0.625rem;
  }
  .results-store-card-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .results-store-card-header .results-store-info {
    flex: 1 1 60%;
    min-width: 0;
  }
  .results-store-card-header .results-store-right {
    flex: 1 1 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border);
  }
  .results-store-logo {
    width: 40px;
    height: 40px;
  }
  .results-store-name {
    font-size: 0.95rem;
    word-break: break-word;
  }
  .results-store-meta {
    font-size: 0.75rem;
  }
  .results-store-items-toggle {
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.8rem;
    min-height: 44px;
  }
  .results-route-total {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    font-size: 0.95rem;
  }
  .results-route-total strong {
    font-size: 1.1rem;
  }
  .results-action-buttons {
    gap: 0.5rem;
  }
  .btn-results-action {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  .product-card .product-img { height: 80px; }
  .skeleton-img { height: 80px; }
  .step-actions { flex-direction: column; }
  .summary { grid-template-columns: 1fr 1fr; }

  .location-modal {
    width: 100% !important;
    max-width: 100% !important;
    height: 60vh !important;
    height: 60svh !important;
    max-height: 85svh !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    border: none !important;
    overscroll-behavior: none !important;
    animation: location-sheet-up 0.3s ease-out;
    transition: height 0.25s ease-out;
  }

  .location-modal.location-modal-expanded {
    height: 85vh !important;
    height: 85svh !important;
  }

  .location-modal::backdrop {
    animation: location-backdrop-in 0.3s ease-out;
  }

  @keyframes location-sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  @keyframes location-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .location-modal-content {
    padding: 0.5rem 1rem 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    padding-top: max(0.5rem, env(safe-area-inset-top));
    position: relative;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  .location-modal-content::before {
    content: "";
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    pointer-events: none;
  }

  .location-modal-header {
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0;
  }

  .location-modal-header .close-panel {
    display: none;
  }

  .location-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 0.25rem;
    padding-bottom: 1rem;
  }

  .location-options {
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .location-options .btn-geo,
  .btn-saved-addresses {
    min-height: 48px;
    height: auto;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }

  .address-input-inner,
  .address-input input {
    min-height: 48px;
    height: 48px;
  }

  .address-input input {
    padding: 0 2.75rem 0 1rem;
    font-size: 16px;
  }

  .address-locate-btn {
    width: 44px;
    height: 44px;
  }

  .radius-options {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  .radius-btn {
    flex: 1 1 0;
    min-height: 40px;
    min-width: 0;
    padding: 0.4rem 0.25rem;
    font-size: 0.82rem;
  }

  #radius-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
  }

  #radius-section {
    margin-top: 1rem;
  }

  .shops-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .shops-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
  }

  .shops-header .btn-link {
    flex-shrink: 0;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .shops-grid {
    gap: 0.75rem;
    padding-bottom: 1rem;
  }

  .shop-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-height: auto;
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
  }

  .shop-card.excluded {
    opacity: 0.5;
  }

  .shop-card-toggle {
    flex-shrink: 0;
    padding-top: 2px;
  }

  .shop-card .toggle-switch {
    width: 48px;
    height: 28px;
    border-radius: 14px;
  }

  .shop-card .toggle-switch::after {
    width: 22px;
    height: 22px;
    top: 3px;
    left: 3px;
  }

  .shop-card .toggle-switch.on::after {
    transform: translateX(20px);
  }

  .shop-card .shop-logo {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
  }

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

  .shop-card .shop-name {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }

  .shop-card .shop-address {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }

  .shop-card .shop-meta {
    margin-top: 0.5rem;
    padding-top: 0.35rem;
    gap: 1rem;
  }

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

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

  .mini-map {
    height: 200px;
    border-radius: var(--radius-sm);
  }

  .location-done-bar {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 1rem;
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--surface);
  }

  .location-done-bar .btn-primary,
  .location-done-bar .btn-secondary {
    min-height: 48px;
  }

  .location-done-bar .location-delete-btn {
    min-width: 48px;
    min-height: 48px;
  }

  .addresses-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 85vh !important;
    max-height: 85svh !important;
    height: auto !important;
    min-height: 40vh;
    min-height: 40svh;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    border: none !important;
    overscroll-behavior: none !important;
    animation: location-sheet-up 0.3s ease-out;
    animation: location-sheet-up 0.3s ease-out;
  }

  .addresses-modal::backdrop {
    animation: location-backdrop-in 0.3s ease-out;
  }

  .addresses-modal-content {
    padding: 0.5rem 1rem 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    padding-top: max(0.5rem, env(safe-area-inset-top));
    position: relative;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  .addresses-modal-content::before {
    content: "";
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    pointer-events: none;
  }

  .addresses-modal-header {
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0;
  }

  .addresses-modal-header .close-panel {
    display: none;
  }
}

.page-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.page-loading-overlay.hidden {
  display: none;
}
.page-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
