:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #f59e0b;
  --dark: #0f172a;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #1e293b;
  --white: #ffffff;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --red: #ef4444;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

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

.save-highlight { color: #16a34a; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.6;
}

/* Header */
header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 5px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

header .logo { margin-left: 80px; margin-right: auto; }

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 20px;
  font-weight: 800;
  color: var(--dark);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.logo span { color: var(--primary); }

/* Hero */
.hero {
  text-align: center;
  padding: 50px 20px 10px;
  max-width: 820px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 10px;
}

.drop-zone {
  margin-top: 12px;
  padding: 20px;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  text-align: center;
  color: var(--gray-400);
  font-size: 14px;
  transition: all 0.2s;
  background: var(--gray-50);
}

.drop-zone:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.drop-zone span {
  font-size: 28px;
  display: block;
  margin-bottom: 4px;
}

.hero p {
  font-size: 19px;
  color: var(--gray-500);
}

/* Search Section */
.main-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Search Bar */
.search-box {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s;
  box-shadow: var(--shadow);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.1);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 16px;
  font-size: 16px;
  background: transparent;
  color: var(--gray-900);
}

.search-box input::placeholder { color: var(--gray-400); }

.search-actions {
  display: flex;
  gap: 6px;
  padding-right: 4px;
}

.btn-camera, .btn-search {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.btn-camera {
  background: var(--gray-100);
  color: var(--gray-700);
}
.btn-camera:hover { background: var(--gray-200); }

.btn-voice {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--gray-100);
  color: var(--gray-700);
  display: flex;
  align-items: center;
  line-height: 1;
}
.btn-voice:hover { background: var(--gray-200); }
.btn-voice.recording {
  background: #ef4444;
  color: white;
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

.btn-search {
  background: var(--primary);
  color: white;
  font-weight: 600;
}
.btn-search:hover { background: var(--primary-dark); }

/* Photo Options Popup */
.photo-options {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  overflow: hidden;
  min-width: 180px;
}

.search-box { position: relative; }
.photo-options.active { display: block; }

.photo-option-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  font-size: 14px;
}
.photo-option-btn:hover { background: var(--gray-50); }
.photo-option-btn + .photo-option-btn { border-top: 1px solid var(--gray-100); }
.photo-option-btn strong { display: block; font-size: 13px; color: var(--gray-900); }
.photo-option-btn p { font-size: 11px; color: var(--gray-500); margin: 0; }
.photo-option-icon { font-size: 18px; flex-shrink: 0; }

/* Photo Bar */
.photo-bar {
  display: none;
  margin-top: 12px;
  padding: 8px 10px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.photo-bar.active { display: flex; }

.photo-bar-item {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid var(--gray-200);
  flex-shrink: 0;
}
.photo-bar-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-bar-item .remove-btn {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 18px;
  height: 18px;
  background: rgba(0,0,0,0.55);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.photo-bar-item .remove-btn:hover { background: rgba(0,0,0,0.8); }
.photo-bar-count {
  font-size: 12px;
  color: var(--gray-400);
  margin-left: auto;
  white-space: nowrap;
}

/* Loading */
.loading {
  display: none;
  text-align: center;
  padding: 40px;
}
.loading.active { display: block; }

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 10px;
}

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

/* Results Section */
.results-section {
  display: none;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}
.results-section.active { display: block; }

/* Product Header */
.product-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  background: var(--white);
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.product-thumbs {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.product-thumbs img {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--gray-200);
}

.product-meta h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.product-meta p {
  font-size: 14px;
  color: var(--gray-500);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  background: var(--white);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

.filter-bar label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.filter-bar select {
  padding: 6px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
}

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

/* Price Cards - Card Grid */
.price-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.price-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
  position: relative;
}

.price-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.price-card.best-deal {
  border-color: var(--secondary);
  background: #fffbeb;
}

/* Card top row: store + actions */
.price-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.store-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.store-logo {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
  color: white;
  flex-shrink: 0;
}

.store-name {
  font-weight: 600;
  font-size: 11px;
}

/* Card product image */
.price-card-img {
  width: 100%;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  background: var(--gray-50);
  border-radius: 5px;
  overflow: hidden;
}
.price-card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 6px;
}

/* Card product name */
.card-product-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-700);
  text-align: center;
  line-height: 1.3;
  margin-bottom: 4px;
  padding: 0 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Card price area */
.price-card-middle {
  text-align: center;
  padding: 2px 0 6px;
}

.price-amount {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}

.price-amount.best-price { color: var(--green); }

.badge-best {
  display: inline-block;
  background: #16a34a;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  margin-bottom: 6px;
}

/* Card meta badges row */
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  margin-bottom: 6px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--gray-500);
  background: var(--gray-50);
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.meta-item .star { color: var(--secondary); }
.meta-item .ship { color: var(--primary); }
.meta-item .reputation { color: var(--green); }

/* Card bottom row: buttons */
.price-card-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.price-card-bottom .buy-btn {
  flex: 1;
  text-align: center;
  background: var(--primary);
  color: white;
  border: none;
  padding: 6px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.price-card-bottom .buy-btn:hover { background: var(--primary-dark); }

.price-card-bottom .icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--gray-200);
  border-radius: 5px;
  background: var(--white);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.price-card-bottom .icon-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.price-card-bottom .heart-btn.favorited { border-color: #f43f5e; background: #fff1f2; }

/* Coupon badge on card */
.card-coupon-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.card-coupon-badge:hover { background: #fde68a; }

/* No results */
.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-500);
}

.no-results h3 { font-size: 18px; margin-bottom: 8px; color: var(--gray-700); }

/* Footer */
footer {
  margin-top: 60px;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 24px 20px;
  text-align: center;
  color: var(--gray-500);
  font-size: 13px;
}

footer .disclosure {
  margin-top: 4px;
  font-size: 11px;
}

/* ======== Auth Modal ======== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--white);
  border-radius: 16px;
  padding: 36px 32px 28px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-close {
  position: absolute;
  top: 14px; right: 18px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-400);
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--gray-700); }

.modal h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.modal p.sub {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 22px;
  text-align: center;
}

.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 4px;
}
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); }

.auth-toggle {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--gray-500);
}
.auth-toggle a {
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}
.auth-toggle a:hover { text-decoration: underline; }

.auth-error {
  color: var(--red);
  font-size: 13px;
  text-align: center;
  margin-bottom: 12px;
  display: none;
}
.auth-error.show { display: block; }

.btn-google {
  width: 100%;
  padding: 10px;
  background: #fff;
  color: #333;
  border: 1.5px solid #dadce0;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s, box-shadow 0.2s;
  margin-bottom: 8px;
}
.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 14px 0;
  color: var(--gray-400);
  font-size: 13px;
  gap: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}
.auth-divider span {
  white-space: nowrap;
}

/* ======== User Menu ======== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.btn-ghost {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--primary); }

.btn-outline {
  background: none;
  border: 1.5px solid var(--gray-300);
  padding: 9px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.user-menu {
  position: relative;
}
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--gray-700);
}
.user-menu-trigger:hover { background: var(--gray-100); }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 200;
  overflow: hidden;
}
.user-dropdown.active { display: block; }
.user-dropdown a, .user-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--gray-50); color: var(--primary); }
.user-dropdown .divider {
  height: 1px;
  background: var(--gray-200);
  margin: 4px 0;
}
.user-dropdown .danger { color: var(--red); }
.user-dropdown .danger:hover { background: #fef2f2; color: var(--red); }

/* ======== Price History ======== */
.history-modal {
  max-width: 520px;
}
.history-chart-wrap {
  width: 100%;
  height: 240px;
  margin: 16px 0;
}
.history-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 12px;
}
.history-controls {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.history-controls button {
  padding: 4px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  background: var(--white);
  color: var(--gray-700);
  transition: all 0.2s;
}
.history-controls button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.history-controls button:hover:not(.active) { border-color: var(--primary); }

/* ======== Price Alert ======== */
.alert-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}
.alert-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.alert-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.alert-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  min-width: 0;
}
.alert-form input:focus { border-color: var(--primary); }
.alert-form button {
  padding: 8px 16px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.alert-form button:hover { background: #15803d; }

.alert-success {
  display: none;
  background: var(--green-light);
  border: 1px solid #bbf7d0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--green);
  margin-top: 8px;
}
.alert-success.show { display: block; }

/* ======== Coupon Badge ======== */
.coupon-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.coupon-badge:hover {
  background: #fde68a;
  transform: translateY(-1px);
}

.coupon-popup {
  display: none;
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 8px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  min-width: 220px;
  z-index: 50;
}
.coupon-popup.active { display: block; }
.coupon-popup h5 { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.coupon-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.coupon-item:last-child { border-bottom: none; }
.coupon-code {
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.coupon-code:hover { background: var(--gray-200); }
.coupon-arrow {
  font-size: 12px;
  color: var(--gray-400);
  margin-left: 6px;
}

/* ======== Heart / Favorites ======== */
.heart-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  transition: transform 0.2s;
  opacity: 0.5;
}
.heart-btn:hover { transform: scale(1.2); opacity: 1; }
.heart-btn.favorited { opacity: 1; }

.card-actions-top {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ======== Dashboard ======== */
.dashboard-section {
  display: none;
  max-width: 900px;
  margin: 24px auto;
  padding: 0 20px;
}
.dashboard-section.active { display: block; }

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.dashboard-header h2 { font-size: 24px; font-weight: 700; }
.dashboard-header p { font-size: 14px; color: var(--gray-500); }

.dashboard-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
}
.dashboard-tabs button {
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}
.dashboard-tabs button:hover { color: var(--gray-700); }
.dashboard-tabs button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.dashboard-content {
  min-height: 200px;
}

.dashboard-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}
.dashboard-empty span { font-size: 48px; display: block; margin-bottom: 12px; }
.dashboard-empty h3 { font-size: 18px; color: var(--gray-500); margin-bottom: 4px; }

.dashboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 8px;
  transition: all 0.2s;
}
.dashboard-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.dashboard-item-info h4 { font-size: 15px; font-weight: 600; }
.dashboard-item-info p { font-size: 13px; color: var(--gray-500); }
.dashboard-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn-sm {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-sm-outline {
  background: none;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
}
.btn-sm-outline:hover { border-color: var(--red); color: var(--red); }
.btn-sm-primary { background: var(--primary); color: white; }
.btn-sm-primary:hover { background: var(--primary-dark); }

/* ======== Coupons Page ======== */
.coupons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.coupon-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.2s;
}
.coupon-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.coupon-card .store-tag {
  display: inline-block;
  background: var(--gray-100);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}
.coupon-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.coupon-card p { font-size: 12px; color: var(--gray-500); margin-bottom: 10px; }
.coupon-card .coupon-large-code {
  background: var(--gray-100);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;
}
.coupon-card .coupon-large-code:hover { background: var(--gray-200); }

/* ======== Photo Bar Responsive ======== */
@media (max-width: 600px) {
  .photo-bar { padding: 6px 8px; gap: 6px; }
  .photo-bar-item { width: 44px; height: 44px; }
  .photo-bar-count { font-size: 11px; }
  .photo-options { min-width: 140px; }
  .photo-option-btn { padding: 6px 12px; }
  .photo-option-icon { font-size: 16px; }
}

/* Responsive additions */
@media (max-width: 1100px) {
  .price-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  .price-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 20px; }
  .price-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .price-card { padding: 10px; }
  .price-amount { font-size: 16px; }
  .price-card-img { height: 60px; }
}

@media (max-width: 540px) {
  .price-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 18px; }
  .search-actions .btn-camera span { display: none; }
  .store-info { min-width: auto; }
  .price-grid { grid-template-columns: 1fr; }
}

/* ======== Mobile Responsive ======== */
@media (max-width: 768px) {
  .header-inner { padding: 0 16px; }
  header .logo { margin-left: 0; }
  .header-actions .btn-ghost,
  .header-actions .btn-outline { font-size: 12px; padding: 6px 10px; }
  .search-box { flex-wrap: wrap; }
  .search-box input { width: 100%; min-width: 0; }
  .search-actions { width: 100%; justify-content: flex-end; margin-top: 4px; }
  .filter-bar { flex-wrap: wrap; gap: 6px; padding: 8px 0; }
  .filter-bar label { font-size: 12px; }
  .filter-bar select { font-size: 12px; padding: 4px 6px; }
  .product-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .product-thumbs img { max-height: 80px; }
  .product-meta h2 { font-size: 16px; }
  .card-product-name { font-size: 10px; -webkit-line-clamp: 2; }
  .modal { margin: 10px; padding: 16px; }
  .history-modal { max-height: 90vh; overflow-y: auto; }
}

@media (max-width: 480px) {
  .header-inner { padding: 0 10px; }
  .search-actions { gap: 4px; }
  .search-actions .btn-camera,
  .search-actions .btn-voice { font-size: 16px; padding: 6px 8px; }
  .search-actions .btn-search { font-size: 12px; padding: 6px 12px; }
  .hero { padding: 30px 10px 10px; }
  .hero p { font-size: 13px; }
  .price-card { padding: 8px; }
  .price-card-img { height: 70px; }
  .price-amount { font-size: 16px; }
  .store-logo { width: 22px; height: 22px; font-size: 9px; }
  .store-name { font-size: 11px; }
  .card-product-name { font-size: 10px; }
  .meta-item { font-size: 10px; padding: 2px 5px; }
  .price-card-bottom .buy-btn { font-size: 11px; padding: 6px; }
  .price-card-bottom .icon-btn { width: 28px; height: 28px; font-size: 12px; }
  .filter-bar select { max-width: 100px; }
  .product-meta h2 { font-size: 15px; }
}

/* ======== Toast ======== */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.toast-msg.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
