/* ==========================================================================
   BRING! SHOLI - COMPONENTS CSS
   Cards, Store Tabs, Frequency Chips, Search Bar, Modals & Controls
   ========================================================================== */

/* Top Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow);
}
.brand-logo svg {
  width: 24px;
  height: 24px;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f8fafc 30%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="light"] .brand-title {
  background: linear-gradient(135deg, #0f172a 30%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-primary);
  border-radius: var(--radius-full);
  margin-left: 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.icon-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}
.icon-btn.active {
  background: var(--accent-primary);
  color: #0f172a;
  border-color: var(--accent-primary);
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.25));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s ease;
}
.mode-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.4));
  transform: translateY(-1px);
}
.mode-btn svg {
  width: 16px;
  height: 16px;
}

/* Search and Quick Add Bar */
.search-container {
  position: relative;
  margin-bottom: 20px;
  width: 100%;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 4px 8px 4px 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}
.search-input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  margin-right: 8px;
  flex-shrink: 0;
}
.search-icon svg {
  width: 100%;
  height: 100%;
}

.search-input {
  flex: 1;
  min-width: 0; /* Crucial: allows flex input to shrink on mobile without overflowing screen */
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  outline: none;
  padding: 8px 4px;
}
.search-input::placeholder {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.search-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mic-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.mic-btn:hover {
  background: var(--accent-primary);
  color: #0f172a;
}
.mic-btn.listening {
  background: var(--accent-danger);
  color: white;
  animation: pulse-red 1.2s infinite;
}
.mic-btn svg {
  width: 18px;
  height: 18px;
}

.quick-add-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: #0f172a;
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.quick-add-btn:hover {
  background: var(--accent-primary-hover);
  color: white;
  transform: translateY(-1px);
}
.quick-add-btn svg {
  width: 16px;
  height: 16px;
}

/* Responsive Mobile Layout for Search Bar (Prevent screen overflow) */
@media (max-width: 540px) {
  .search-input-wrapper {
    padding: 4px 6px 4px 10px;
  }
  .search-icon {
    margin-right: 6px;
    width: 18px;
    height: 18px;
  }
  .search-actions {
    gap: 4px;
  }
  .quick-add-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-full);
  }
  .quick-add-btn .quick-add-text {
    display: none;
  }
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  display: none;
}
.autocomplete-dropdown.show {
  display: block;
  animation: slide-down 0.15s ease-out;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s ease;
}
.autocomplete-item:last-child {
  border-bottom: none;
}
.autocomplete-item:hover {
  background: var(--bg-tertiary);
}

.auto-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auto-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auto-item-icon svg {
  width: 18px;
  height: 18px;
}

.auto-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.auto-item-store {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  margin-left: 8px;
  font-weight: 700;
}

/* Store Navigation Tabs */
.store-tabs-wrapper {
  margin-bottom: 20px;
  position: relative;
}

.store-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.store-tabs::-webkit-scrollbar {
  display: none;
}

.store-tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
  user-select: none;
}
.store-tab:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.store-tab.active {
  background: var(--accent-primary);
  color: #0f172a;
  border-color: var(--accent-primary);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}

.store-tab-badge {
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}
.store-tab.active .store-tab-badge {
  background: #0f172a;
  color: white;
}

.add-store-tab {
  border-style: dashed;
}

/* Smart Frequency Suggestions Bar */
.suggestions-section {
  margin-bottom: 24px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
[data-theme="light"] .suggestions-section {
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  border-color: rgba(2, 132, 199, 0.2);
}

.suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.suggestions-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-primary);
}
.suggestions-title svg {
  width: 18px;
  height: 18px;
}

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

.suggestions-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.suggestion-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}
.suggestion-chip:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.suggestion-icon {
  width: 22px;
  height: 22px;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.suggestion-icon svg {
  width: 100%;
  height: 100%;
}

.suggestion-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.suggestion-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-primary);
  font-weight: 700;
}

.suggestion-add-icon {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  margin-left: 4px;
}

/* Store Group Section (When viewing 'All') */
.store-group-container {
  margin-bottom: 28px;
}

.store-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 6px 4px;
}

.store-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
}

.store-badge-pill {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.store-group-actions {
  display: flex;
  gap: 6px;
}

.store-action-btn {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}
.store-action-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Bring!-Style Card Grid */
.items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 480px) {
  .items-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}

@media (min-width: 768px) {
  .items-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .items-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
  }
}

/* Individual Bring! Item Tile */
.bring-card {
  position: relative;
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px 12px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-sm);
  min-height: 130px;
  justify-content: space-between;
}

.bring-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-md);
}

.bring-card:active {
  transform: scale(0.97);
}

/* Store color accent top bar */
.card-store-stripe {
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  height: 3px;
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
}

.card-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  transition: transform 0.2s ease;
}
.bring-card:hover .card-icon-wrapper {
  transform: scale(1.1);
}
.card-icon-wrapper svg {
  width: 28px;
  height: 28px;
}

.card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 6px;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.card-quantity-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Interactive Card Stepper */
.card-stepper {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-full);
  padding: 3px 5px;
  margin: 4px 0 6px 0;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
  z-index: 3;
}

.card-stepper:hover {
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.card-step-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  line-height: 1;
  padding: 0;
  user-select: none;
}

.card-step-btn:hover {
  background: var(--accent-primary);
  color: #0f172a;
  border-color: var(--accent-primary);
  transform: scale(1.2);
}

.card-step-btn:active {
  transform: scale(0.9);
}

.card-step-val {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-primary);
  padding: 2px 7px;
  min-width: 28px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}
.card-step-val:hover {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-primary);
}

/* Quick Quantity Modal Styles */
.quick-qty-stepper-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.quick-qty-stepper-btn:hover {
  background: var(--accent-primary);
  color: #0f172a;
  transform: scale(1.1);
}
.quick-qty-stepper-btn:active {
  transform: scale(0.95);
}

.quick-qty-big-input {
  width: 100px;
  height: 52px;
  font-size: 1.75rem;
  font-weight: 900;
  text-align: center;
  background: var(--bg-primary);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
}
.quick-qty-big-input:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
}

.quick-num-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.quick-num-chip {
  padding: 12px 6px;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.quick-num-chip:hover, .quick-num-chip.active {
  background: var(--accent-primary);
  color: #0f172a;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.quick-unit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quick-unit-chip {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: var(--bg-primary);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.quick-unit-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
}
.quick-unit-chip.active {
  background: var(--accent-primary);
  color: #0f172a;
  border-color: var(--accent-primary);
  font-weight: 800;
}

.card-note-badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-warning);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-store-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
}

.card-edit-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s ease;
}
.bring-card:hover .card-edit-btn {
  opacity: 1;
}
.card-edit-btn:hover {
  background: var(--accent-primary);
  color: #0f172a;
}
.card-edit-btn svg {
  width: 14px;
  height: 14px;
}

/* Completed Items Section ("Bereits im Einkaufswagen") */
.completed-section {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-card);
}

.completed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  cursor: pointer;
  user-select: none;
}

.completed-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.completed-title svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}
.completed-header.collapsed .completed-title svg {
  transform: rotate(-90deg);
}

.completed-clear-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-danger);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}
.completed-clear-btn:hover {
  background: var(--accent-danger);
  color: white;
}
.completed-clear-btn svg {
  width: 14px;
  height: 14px;
}

.completed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 480px) {
  .completed-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}
@media (min-width: 768px) {
  .completed-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}
@media (min-width: 1024px) {
  .completed-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
  }
}

.completed-card {
  background: var(--bg-card-done);
  border: 1px solid var(--border-subtle);
  opacity: 0.65;
  filter: grayscale(0.4);
}
.completed-card:hover {
  opacity: 0.95;
  filter: grayscale(0);
}
.completed-card .card-title {
  text-decoration: line-through;
  color: var(--text-muted);
}
.completed-check-icon {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--accent-success);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.completed-check-icon svg {
  width: 14px;
  height: 14px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--border-card);
  margin: 20px 0;
}
.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px auto;
  color: var(--text-muted);
}
.empty-icon svg {
  width: 100%;
  height: 100%;
}
.empty-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.empty-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 360px;
  margin: 0 auto 16px auto;
}

/* Floating Bottom Navigation / Action Bar */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  max-width: var(--max-width);
  margin: 0 auto;
}

.bottom-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.bottom-btn:hover, .bottom-btn.active {
  color: var(--accent-primary);
}
.bottom-btn svg {
  width: 22px;
  height: 22px;
}

.fab-add-btn {
  position: relative;
  top: -14px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.45);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fab-add-btn:hover {
  transform: scale(1.1);
}
.fab-add-btn svg {
  width: 28px;
  height: 28px;
}

/* User Auth Header Button */
.user-auth-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s ease;
  cursor: pointer;
}
.user-auth-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}
.user-auth-btn.logged-in {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--accent-primary);
}
.user-avatar-icon {
  font-size: 1rem;
}

/* Fullpage Auth Screen */
.auth-screen-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
}

.auth-screen-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, rgba(56, 189, 248, 0) 70%);
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
}

.auth-screen-topbar {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
}

.auth-hero-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(12px);
  animation: modal-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-hero-header {
  text-align: center;
  margin-bottom: 26px;
}

.auth-hero-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--accent-primary), #0284c7);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.35);
  color: #ffffff;
}
.auth-hero-logo svg {
  width: 36px;
  height: 36px;
}

.auth-hero-title {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
[data-theme="light"] .auth-hero-title {
  background: linear-gradient(135deg, #0f172a, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-hero-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.auth-features-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.auth-feature-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  padding: 6px 10px;
  border-radius: var(--radius-full);
}

/* Auth Modal Tabs */
.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-primary);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  border: 1px solid var(--border-subtle);
}
.auth-tab-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  background: transparent;
  border: none;
}
.auth-tab-btn:hover {
  color: var(--text-primary);
}
.auth-tab-btn.active {
  background: var(--bg-secondary);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.household-info-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px;
}

/* Modal Overlay & Card */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  transform: translateY(20px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-primary);
}

.stepper-row {
  display: flex;
  gap: 10px;
}

.stepper-control {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.stepper-btn {
  width: 40px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  font-size: 1.2rem;
  font-weight: 700;
  transition: background 0.15s ease;
}
.stepper-btn:hover {
  background: var(--accent-primary);
  color: #0f172a;
}
.stepper-input {
  width: 60px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  outline: none;
}

.store-radio-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.store-radio-pill {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1.5px solid var(--border-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.store-radio-pill:hover {
  border-color: var(--accent-primary);
}
.store-radio-pill.selected {
  background: var(--accent-primary);
  color: #0f172a;
  border-color: var(--accent-primary);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.btn-primary {
  flex: 1;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: #0f172a;
  font-weight: 800;
  font-size: 0.95rem;
  text-align: center;
  transition: all 0.2s ease;
}
.btn-primary:hover {
  background: var(--accent-primary-hover);
  color: white;
}

.btn-danger {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-danger);
  font-weight: 700;
  transition: all 0.2s ease;
}
.btn-danger:hover {
  background: var(--accent-danger);
  color: white;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast-undo-btn {
  color: var(--accent-primary);
  font-weight: 800;
  margin-left: 8px;
  cursor: pointer;
  pointer-events: auto;
  text-decoration: underline;
}

/* Shopping Focus Mode (Full Screen Shopping Experience) */
body.shopping-focus-active .app-header,
body.shopping-focus-active .search-container,
body.shopping-focus-active .suggestions-section,
body.shopping-focus-active .bottom-bar {
  display: none !important;
}

.shopping-focus-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--accent-primary);
  padding: 14px 16px;
  margin-bottom: 16px;
  justify-content: space-between;
  align-items: center;
}
body.shopping-focus-active .shopping-focus-bar {
  display: flex;
}

body.shopping-focus-active .bring-card {
  min-height: 150px;
  padding: 20px 14px;
}
body.shopping-focus-active .card-icon-wrapper {
  width: 58px;
  height: 58px;
}
body.shopping-focus-active .card-icon-wrapper svg {
  width: 36px;
  height: 36px;
}
body.shopping-focus-active .card-title {
  font-size: 1.05rem;
}

/* ==========================================================================
   SAVED LISTS & TEMPLATES
   ========================================================================== */
.save-current-list-card {
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 6px;
}

.saved-lists-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.saved-list-card {
  background: var(--bg-primary);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saved-list-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.saved-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.saved-list-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.saved-list-emoji {
  font-size: 1.4rem;
  line-height: 1;
}

.saved-list-name {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-primary);
}

.saved-list-count {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-primary);
  border-radius: var(--radius-full);
}

.saved-list-items-preview {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.saved-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.saved-list-btn {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.saved-list-btn-primary {
  background: var(--accent-primary);
  color: #0f172a;
}
.saved-list-btn-primary:hover {
  background: var(--accent-primary-hover);
  color: white;
  transform: translateY(-1px);
}

.saved-list-btn-secondary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
}
.saved-list-btn-secondary:hover {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.saved-list-btn-delete {
  margin-left: auto;
  color: var(--accent-danger);
  background: transparent;
  padding: 6px;
}
.saved-list-btn-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-xs);
}
