/* ============================================
   Ali Find Me - Main Stylesheet v2.0
   ============================================ */

:root {
  --primary: #6C5CE7;
  --primary-dark: #5A4BD1;
  --primary-light: #A29BFE;
  --accent: #FD79A8;
  --accent-dark: #E84393;
  --success: #00B894;
  --warning: #FDCB6E;
  --danger: #D63031;
  --bg: #F8F9FD;
  --card-bg: #FFFFFF;
  --text: #2D3436;
  --text-light: #636E72;
  --text-muted: #B2BEC3;
  --border: #E8ECF1;
  --shadow: 0 2px 20px rgba(108, 92, 231, 0.08);
  --shadow-hover: 0 8px 30px rgba(108, 92, 231, 0.15);
  --gradient: linear-gradient(135deg, #6C5CE7 0%, #A29BFE 50%, #FD79A8 100%);
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --font-heading: 'Heebo', sans-serif;
  --font-body: 'Assistant', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ---- Navbar ---- */
.navbar {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 20px;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

[dir="rtl"] .nav-container {
  flex-direction: row-reverse;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--primary);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.4rem;
}

.logo-icon { font-size: 1.6rem; }
.logo-img { height: 48px; width: auto; object-fit: contain; }
.logo-text { display: none; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-icon-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s;
}

.nav-icon-btn:hover { background: var(--bg); }

.fav-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--accent-dark);
  color: #fff;
  font-size: 0.65rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

[dir="rtl"] .fav-badge { right: auto; left: -2px; }

/* Language Dropdown */
.lang-dropdown-wrap {
  position: relative;
}

.lang-flag-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lang-flag-btn:hover {
  border-color: var(--primary);
  transform: scale(1.1);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: 42px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 200;
  min-width: 160px;
  padding: 6px 0;
  animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.lang-dropdown.open { display: block; }

.lang-option {
  display: block;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: right;
  white-space: nowrap;
  transition: background 0.15s;
}

[dir="ltr"] .lang-option { text-align: left; }

.lang-option:hover {
  background: var(--primary-light);
  color: #fff;
}

.admin-link {
  text-decoration: none;
  font-size: 1.2rem;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.admin-link:hover { opacity: 1; }

/* ---- Hero ---- */
.hero {
  background: var(--gradient-hero);
  padding: 48px 20px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: shimmer 15s infinite linear;
}

@keyframes shimmer {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.3;
}

.hero-icon { font-size: 2rem; vertical-align: middle; }

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.9);
  font-weight: 300;
}

/* ---- Chat Section ---- */
.chat-section {
  max-width: 800px;
  margin: -30px auto 0;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

.chat-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
  border: 1px solid var(--border);
}

.chat-messages {
  padding: 24px;
  max-height: 200px;
  overflow-y: auto;
}

.message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.bot-message { flex-direction: row-reverse; }
[dir="ltr"] .bot-message { flex-direction: row; }

.user-message { flex-direction: row; }
[dir="ltr"] .user-message { flex-direction: row-reverse; }

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  background: var(--bg);
}

.message-bubble {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  line-height: 1.6;
}

.bot-message .message-bubble {
  background: var(--bg);
  color: var(--text);
}

[dir="ltr"] .bot-message .message-bubble { border-top-left-radius: 4px; }
[dir="rtl"] .bot-message .message-bubble { border-top-right-radius: 4px; }

.user-message .message-bubble {
  background: var(--gradient);
  color: #fff;
}

[dir="ltr"] .user-message .message-bubble { border-top-right-radius: 4px; }
[dir="rtl"] .user-message .message-bubble { border-top-left-radius: 4px; }

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 18px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--primary-light);
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
}

/* ---- Search History ---- */
.history-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  background: rgba(108, 92, 231, 0.03);
}

.history-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.history-chip {
  padding: 4px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 0.78rem;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.history-chip:hover {
  background: var(--primary-light);
  color: #fff;
  border-color: var(--primary-light);
}

.history-clear-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
  transition: all 0.2s;
}

.history-clear-btn:hover { color: var(--danger); background: rgba(214, 48, 49, 0.1); }

/* Chips */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 16px;
  justify-content: center;
}

.chip {
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Input area */
.input-area {
  padding: 20px 24px;
  border-top: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 0 0 var(--radius) var(--radius);
}

.input-area-top {
  border-radius: var(--radius) var(--radius) 0 0;
}

.input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

#chatInput {
  flex: 1;
  padding: 18px 24px;
  border: 3px solid rgba(255,255,255,0.4);
  border-radius: 30px;
  font-size: 1.15rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

#chatInput::placeholder {
  color: #999;
  font-weight: 400;
}

#chatInput:focus {
  border-color: #fff;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
  transform: scale(1.01);
}

.send-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

/* ---- Image Search Button ---- */
.image-search-wrap { position: relative; flex-shrink: 0; }
.image-search-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.9);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.image-search-btn:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}
.image-options-dropdown {
  position: absolute;
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 50;
  min-width: 120px;
}
.image-options-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  color: var(--text);
  transition: background 0.15s;
}
.image-options-dropdown button:hover {
  background: rgba(108, 92, 231, 0.1);
}

/* ---- Filters Bar ---- */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
}

.filter-group select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  font-family: var(--font-body);
  background: var(--bg);
  cursor: pointer;
  outline: none;
}

.price-input {
  width: 70px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  font-family: var(--font-body);
  outline: none;
  text-align: center;
}

.price-input:focus { border-color: var(--primary); }

.filter-apply-btn {
  padding: 6px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.2s;
}

.filter-apply-btn:hover { background: var(--primary-dark); }

/* ---- Related Searches ---- */
.related-searches {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0;
  margin-bottom: 16px;
}

.related-label {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 600;
  white-space: nowrap;
}

.related-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.related-chip {
  padding: 6px 14px;
  background: rgba(108, 92, 231, 0.08);
  border: 1px solid var(--primary-light);
  border-radius: 16px;
  font-size: 0.82rem;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.related-chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---- Results ---- */
.results-section {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 20px;
}

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

.results-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.share-search-btn {
  padding: 4px 12px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: var(--font-body);
}

.share-search-btn:hover { background: #1DA851; }

.clear-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-light);
  transition: all 0.2s;
  font-family: var(--font-body);
}

.clear-btn:hover { border-color: var(--danger); color: var(--danger); }

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.product-img-wrap {
  position: relative;
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg);
  display: block;
}

/* Favorite button on product card */
.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.9);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 2;
}

[dir="rtl"] .fav-btn { right: auto; left: 10px; }

.fav-btn:hover { background: #fff; transform: scale(1.1); }
.fav-btn.active { background: #ffe0e9; }

/* Share button on product card */
.share-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255,255,255,0.9);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 2;
  opacity: 0;
}

[dir="rtl"] .share-btn { left: auto; right: 10px; }
[dir="rtl"] .fav-btn { left: 10px; right: auto; }

.product-card:hover .share-btn { opacity: 1; }
.share-btn:hover { background: #25D366; color: #fff; transform: scale(1.1); }

.product-info { padding: 14px; }

.product-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
  line-height: 1.4;
  min-height: 2.5em;
}

.product-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.product-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.product-original-price {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-discount {
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.product-rating { color: #F39C12; }

.product-cta {
  display: block;
  text-align: center;
  padding: 10px;
  background: var(--gradient);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.product-cta:hover { opacity: 0.9; }

/* Skeleton loading */
.skeleton-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200%;
  animation: skeleton-shine 1.5s infinite;
}

.skeleton-text {
  height: 14px;
  margin: 12px 14px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200%;
  animation: skeleton-shine 1.5s infinite;
  border-radius: 4px;
}

.skeleton-text:last-child { width: 60%; }

@keyframes skeleton-shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Load more */
.load-more {
  text-align: center;
  padding: 24px;
}

.load-more-btn {
  padding: 12px 36px;
  border: 2px solid var(--primary);
  border-radius: 25px;
  background: none;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.load-more-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* ---- Trending Section ---- */
.trending-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.trending-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
}

/* ---- Daily Deals ---- */
.daily-deals-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.deals-countdown {
  text-align: center;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1rem;
  color: var(--text-light);
}

.countdown-timer {
  background: linear-gradient(135deg, #6C5CE7 0%, #FD79A8 100%);
  color: #fff;
  padding: 8px 22px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 2px;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.deals-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
}

/* ---- Categories ---- */
.categories-section {
  max-width: 1200px;
  margin: 48px auto;
  padding: 0 20px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 28px;
  color: var(--text);
}

.section-title span { font-size: 1.4rem; }

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.category-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 20px 12px;
  text-align: center;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}

.category-icon { font-size: 2rem; margin-bottom: 8px; }

.category-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* ---- How it works ---- */
.how-it-works {
  max-width: 900px;
  margin: 48px auto;
  padding: 0 20px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step {
  text-align: center;
  padding: 24px 16px;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.step h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--text);
}

.step p {
  font-size: 0.88rem;
  color: var(--text-light);
}

/* ---- Favorites Modal ---- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 1;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: all 0.2s;
}

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

.modal-body {
  padding: 20px 24px;
}

.empty-fav {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 1rem;
}

.fav-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fav-item {
  display: flex;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: box-shadow 0.2s;
}

.fav-item:hover { box-shadow: var(--shadow); }

.fav-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}

.fav-info { flex: 1; display: flex; flex-direction: column; gap: 6px; }

.fav-title {
  font-size: 0.85rem;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fav-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-dark);
}

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

.fav-buy-btn {
  padding: 4px 12px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-xs);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.2s;
}

.fav-buy-btn:hover { background: var(--primary-dark); }

.fav-remove-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  transition: background 0.2s;
}

.fav-remove-btn:hover { background: rgba(214, 48, 49, 0.1); }

/* ---- Share Modal ---- */
.share-modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  position: relative;
  text-align: center;
}

.share-modal-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text);
}

.share-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-platform-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  color: #fff;
}

.share-platform-btn:hover { transform: scale(1.02); opacity: 0.9; }
.share-icon { font-size: 1.3rem; }

.whatsapp-btn { background: #25D366; }
.telegram-btn { background: #0088cc; }
.facebook-btn { background: #1877F2; }
.twitter-btn { background: #1DA1F2; }
.copy-btn { background: var(--text-light); }
.native-btn { background: var(--primary); }

/* ---- Newsletter Section ---- */
.newsletter-section {
  background: linear-gradient(135deg, var(--primary) 0%, #764ba2 50%, var(--accent) 100%);
  padding: 48px 20px;
  text-align: center;
  margin-top: 40px;
}

.newsletter-content {
  max-width: 560px;
  margin: 0 auto;
}

.newsletter-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  animation: nlBounce 2s ease-in-out infinite;
}

@keyframes nlBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.newsletter-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 8px;
}

.newsletter-desc {
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.newsletter-form { margin-bottom: 12px; }

.newsletter-input-wrap {
  display: flex;
  gap: 8px;
  max-width: 460px;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: 16px 20px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 30px;
  font-size: 1rem;
  font-family: var(--font-body);
  background: #fff;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.newsletter-input:focus {
  border-color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.newsletter-btn {
  padding: 16px 32px;
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.newsletter-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.newsletter-privacy {
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  margin-top: 8px;
}

.newsletter-success {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 16px 24px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.newsletter-success-icon { font-size: 1.5rem; }

/* ---- Newsletter Popup ---- */
.nl-popup-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s;
}

.nl-popup {
  background: #fff;
  border-radius: var(--radius);
  padding: 36px 28px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.nl-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

[dir="rtl"] .nl-popup-close { right: auto; left: 12px; }

.nl-popup-close:hover { background: var(--bg); }

.nl-popup-icon { font-size: 3rem; margin-bottom: 12px; }

.nl-popup-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.nl-popup-desc {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.nl-popup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.nl-popup-form .newsletter-input {
  border-color: var(--border);
}

.nl-popup-btn {
  background: var(--gradient);
  color: #fff;
  width: 100%;
}

.nl-popup-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
  font-family: var(--font-body);
}

.nl-popup-skip:hover { color: var(--text); }

/* ---- Footer ---- */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 28px 20px;
  margin-top: 48px;
}

.footer-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 8px;
}

.footer-disclaimer {
  font-size: 0.78rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .admin-link { display: none !important; }
  .hero-title { font-size: 1.6rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .trending-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .deals-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .daily-deals-section { margin: 20px auto; padding: 0 8px; }
  .countdown-timer { font-size: 1rem; padding: 6px 16px; }
  .steps-grid { grid-template-columns: 1fr; gap: 16px; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  .filters-bar { gap: 10px; flex-direction: column; align-items: stretch; }
  .filter-group { flex-wrap: wrap; justify-content: center; }
  .fav-item img { width: 60px; height: 60px; }
  .share-btn { opacity: 1; }
  .alert-btn-card { opacity: 1; }
  .results-header { flex-direction: column; gap: 10px; align-items: flex-start; }
  .modal-content { max-width: 95vw; max-height: 85vh; }
  .modal-header { padding: 16px 18px; }
  .modal-body { padding: 16px 18px; }
}

@media (max-width: 600px) {
  /* ---- Navbar: force single row, no overflow ---- */
  .navbar { padding: 0 8px; }
  .nav-container {
    height: 48px;
    overflow: visible;
    flex-wrap: nowrap;
  }
  .logo {
    font-size: 0.85rem;
    gap: 4px;
    flex-shrink: 1;
    min-width: 0;
    white-space: nowrap;
  }
  .logo-icon { font-size: 1rem; }
  .logo-img { height: 36px; max-width: 140px; }
  .nav-actions {
    gap: 2px;
    flex-shrink: 0;
    flex-wrap: nowrap;
  }
  .nav-icon-btn { font-size: 0.9rem; padding: 4px; }
  .theme-toggle-btn { font-size: 0.9rem; padding: 4px; }
  .lang-flag-btn { width: 28px; height: 28px; font-size: 1rem; }
  .lang-dropdown { min-width: 140px; }
  .lang-option { padding: 6px 12px; font-size: 0.82rem; }
  .admin-link { font-size: 0.85rem; display: none; }

  /* ---- Hero ---- */
  .hero { padding: 20px 12px 28px; }
  .hero-title { font-size: 1.2rem; }
  .hero-icon { font-size: 1.2rem; }
  .hero-subtitle { font-size: 0.8rem; }

  /* ---- Chat Section ---- */
  .chat-section { padding: 0 8px; margin-top: -20px; }
  .chat-messages { padding: 12px; }
  .message { gap: 8px; margin-bottom: 10px; }
  .message-bubble { max-width: 88%; padding: 8px 12px; font-size: 0.8rem; line-height: 1.5; }
  .message-avatar { width: 26px; height: 26px; font-size: 0.95rem; }
  .input-area { padding: 14px 12px; }
  .input-wrapper { gap: 6px; }
  #chatInput { padding: 14px 18px; font-size: 1rem; border-width: 3px; }
  .send-btn { width: 36px; height: 36px; }
  .send-btn svg { width: 16px; height: 16px; }

  /* ---- Chips ---- */
  .chips-container { padding: 0 10px 10px; gap: 5px; }
  .chip { padding: 5px 10px; font-size: 0.7rem; border-radius: 14px; }

  /* ---- History ---- */
  .history-container { padding: 5px 10px; gap: 5px; }
  .history-label { font-size: 0.68rem; }
  .history-chip { padding: 2px 8px; font-size: 0.65rem; }

  /* ---- Products ---- */
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .product-info { padding: 8px; }
  .product-title { font-size: 0.75rem; min-height: 2em; line-height: 1.3; }
  .product-price { font-size: 0.9rem; }
  .product-original-price { font-size: 0.68rem; }
  .product-discount { font-size: 0.6rem; padding: 1px 5px; }
  .product-meta { font-size: 0.65rem; }
  .product-cta { padding: 7px; font-size: 0.75rem; border-radius: 4px; }
  .fav-btn { width: 28px; height: 28px; font-size: 0.8rem; }
  .share-btn { width: 28px; height: 28px; font-size: 0.75rem; opacity: 1; }
  .alert-btn-card { width: 26px; height: 26px; font-size: 0.7rem; opacity: 1; }

  /* ---- Categories ---- */
  .categories-section { margin: 24px auto; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .category-card { padding: 12px 6px; border-radius: 8px; }
  .category-icon { font-size: 1.4rem; margin-bottom: 3px; }
  .category-name { font-size: 0.68rem; }
  .section-title { font-size: 1.05rem; margin-bottom: 14px; }
  .section-title span { font-size: 1rem; }

  /* ---- Filters ---- */
  .filters-bar { padding: 8px; gap: 6px; border-radius: 8px; }
  .price-input { width: 50px; padding: 4px 6px; font-size: 0.78rem; }
  .filter-group label { font-size: 0.75rem; }
  .filter-group select { font-size: 0.75rem; padding: 4px 8px; }
  .filter-apply-btn { font-size: 0.72rem; padding: 5px 10px; }

  /* ---- Results ---- */
  .results-section { margin: 16px auto; padding: 0 8px; }
  .results-title { font-size: 1rem; gap: 6px; }
  .clear-btn { padding: 5px 12px; font-size: 0.72rem; }
  .load-more-btn { padding: 8px 24px; font-size: 0.85rem; }
  .share-search-btn { font-size: 0.68rem; padding: 3px 8px; }

  /* ---- Related searches ---- */
  .related-searches { gap: 5px; padding: 6px 0; }
  .related-label { font-size: 0.72rem; }
  .related-chip { padding: 4px 8px; font-size: 0.68rem; border-radius: 12px; }

  /* ---- Recently Viewed ---- */
  .recently-viewed-section { margin: 20px auto 0; padding: 0 8px; }
  .rv-card { min-width: 110px; max-width: 110px; }
  .rv-card-info { padding: 6px 8px; }
  .rv-card-title { font-size: 0.68rem; }
  .rv-card-price { font-size: 0.78rem; }

  /* ---- Steps ---- */
  .how-it-works { margin: 24px auto; padding: 0 8px; }
  .step { padding: 12px 8px; }
  .step-number { width: 36px; height: 36px; font-size: 1rem; }
  .step h3 { font-size: 0.88rem; }
  .step p { font-size: 0.78rem; }

  /* ---- Modals ---- */
  .modal-overlay { padding: 8px; }
  .modal-content { max-height: 90vh; border-radius: 10px; }
  .modal-header { padding: 12px 14px; }
  .modal-header h2 { font-size: 1rem; }
  .modal-body { padding: 12px 14px; }
  .fav-item { padding: 8px; gap: 10px; }
  .fav-item img { width: 55px; height: 55px; }
  .fav-title { font-size: 0.78rem; }
  .fav-price { font-size: 0.88rem; }
  .fav-buy-btn { font-size: 0.7rem; padding: 3px 8px; }

  /* ---- Alert dialog ---- */
  .alert-dialog { min-width: auto; width: calc(100vw - 32px); max-width: 300px; padding: 16px; }
  .alert-dialog h3 { font-size: 0.95rem; }

  /* ---- Footer ---- */
  .footer { padding: 16px 10px; margin-top: 24px; }
  .footer-brand { font-size: 0.82rem; }
  .footer-disclaimer { font-size: 0.68rem; }

  /* ---- Trending ---- */
  .trending-section { margin: 20px auto; padding: 0 8px; }

  /* ---- Autocomplete ---- */
  .autocomplete-item { padding: 8px 12px; font-size: 0.8rem; }
  .autocomplete-item .ac-type { font-size: 0.6rem; padding: 1px 6px; }

  /* ---- Newsletter Mobile ---- */
  .newsletter-section { padding: 32px 16px; }
  .newsletter-title { font-size: 1.3rem; }
  .newsletter-desc { font-size: 0.9rem; }
  .newsletter-input-wrap { flex-direction: column; }
  .newsletter-btn { width: 100%; }
  .newsletter-input { padding: 14px 18px; }
  .nl-popup { padding: 28px 20px; }
  .nl-popup-title { font-size: 1.2rem; }
}

/* Extra small screens (iPhone SE, Galaxy S8, etc.) */
@media (max-width: 380px) {
  .logo-text { display: none; }
  .nav-actions { gap: 1px; }
  .nav-icon-btn { font-size: 0.85rem; padding: 3px; }
  .theme-toggle-btn { font-size: 0.85rem; padding: 3px; }
  .lang-flag-btn { width: 24px; height: 24px; font-size: 0.85rem; }
  .hero-title { font-size: 1.1rem; }
  .hero-subtitle { font-size: 0.75rem; }
  .chip { font-size: 0.65rem; padding: 4px 8px; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .category-icon { font-size: 1.2rem; }
  .category-name { font-size: 0.62rem; }
  .product-grid { gap: 6px; }
  .product-info { padding: 6px; }
  .product-title { font-size: 0.7rem; }
  .product-price { font-size: 0.85rem; }
  .product-cta { font-size: 0.7rem; padding: 6px; }
  .section-title { font-size: 0.95rem; }
  .message-bubble { font-size: 0.75rem; padding: 7px 10px; }
  #chatInput { font-size: 0.88rem; padding: 10px 14px; }
  .send-btn { width: 32px; height: 32px; }
}

/* ---- No results message ---- */
.no-results {
  text-align: center;
  padding: 32px;
  color: var(--text-light);
}

.no-results-icon { font-size: 3rem; margin-bottom: 12px; }
.no-results h3 { margin-bottom: 8px; color: var(--text); }

/* ============================================
   Dark Mode
   ============================================ */
[data-theme="dark"] {
  --bg: #1a1a2e;
  --card-bg: #16213e;
  --text: #e0e0e0;
  --text-light: #a0a0a0;
  --text-muted: #707070;
  --border: #2d3e52;
  --shadow: 0 2px 20px rgba(0,0,0,0.3);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.4);
}

[data-theme="dark"] .navbar {
  background: rgba(22, 33, 62, 0.95);
}

[data-theme="dark"] .skeleton-img,
[data-theme="dark"] .skeleton-text {
  background: linear-gradient(90deg, #1e2a45 25%, #253350 50%, #1e2a45 75%);
  background-size: 200%;
}

[data-theme="dark"] .fav-btn,
[data-theme="dark"] .share-btn {
  background: rgba(22, 33, 62, 0.9);
}

[data-theme="dark"] .footer {
  background: #0f0f23;
}

.theme-toggle-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s, transform 0.3s;
}

.theme-toggle-btn:hover {
  background: var(--bg);
  transform: rotate(30deg);
}

/* ============================================
   Autocomplete Dropdown
   ============================================ */
.input-wrapper {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 200;
  display: none;
  overflow: hidden;
  margin-top: -4px;
}

.autocomplete-dropdown.show { display: block; }

.autocomplete-item {
  padding: 10px 18px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

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

.autocomplete-item:hover,
.autocomplete-item.active {
  background: rgba(108, 92, 231, 0.08);
}

.autocomplete-item .ac-icon {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.autocomplete-item .ac-text {
  flex: 1;
}

.autocomplete-item .ac-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ============================================
   Recently Viewed Section
   ============================================ */
.recently-viewed-section {
  max-width: 1200px;
  margin: 40px auto 0;
  padding: 0 20px;
}

.recently-viewed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.rv-clear-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: all 0.2s;
  font-family: var(--font-body);
}

.rv-clear-btn:hover { border-color: var(--danger); color: var(--danger); }

.recently-viewed-grid {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.recently-viewed-grid::-webkit-scrollbar { height: 4px; }
.recently-viewed-grid::-webkit-scrollbar-track { background: var(--bg); border-radius: 2px; }
.recently-viewed-grid::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 2px; }

.rv-card {
  min-width: 160px;
  max-width: 160px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  scroll-snap-align: start;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.rv-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.rv-card a { text-decoration: none; color: inherit; }

.rv-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.rv-card-info {
  padding: 8px 10px;
}

.rv-card-title {
  font-size: 0.78rem;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
  line-height: 1.3;
}

.rv-card-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-dark);
}

/* ============================================
   Price Alerts
   ============================================ */
.alert-nav-btn {
  position: relative;
}

.alert-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--success);
  color: #fff;
  font-size: 0.65rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

[dir="rtl"] .alert-badge { right: auto; left: -2px; }

.alert-btn-card {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255,255,255,0.9);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}

[dir="rtl"] .alert-btn-card { right: auto; left: 10px; }

.product-card:hover .alert-btn-card { opacity: 1; }
.alert-btn-card:hover { transform: scale(1.15); }
.alert-btn-card.has-alert { opacity: 1; background: #e6fff5; }

[data-theme="dark"] .alert-btn-card {
  background: rgba(22, 33, 62, 0.9);
}

/* Alert dialog (small popup) */
.alert-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  z-index: 1100;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  min-width: 300px;
  text-align: center;
}

.alert-dialog h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--text);
}

.alert-dialog .alert-price-input {
  width: 120px;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 1rem;
  text-align: center;
  font-family: var(--font-body);
  outline: none;
  margin: 8px 0 16px;
}

.alert-dialog .alert-price-input:focus { border-color: var(--primary); }

.alert-dialog-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.alert-dialog-btns button {
  padding: 8px 20px;
  border-radius: var(--radius-xs);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  transition: background 0.2s;
}

.alert-save-btn { background: var(--success); color: #fff; }
.alert-save-btn:hover { background: #00a884; }
.alert-cancel-btn { background: var(--bg); color: var(--text-light); border: 1px solid var(--border) !important; }
.alert-cancel-btn:hover { background: var(--border); }

.alert-dialog-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1050;
}

/* Price drop highlight in alerts modal */
.price-dropped {
  background: rgba(0, 184, 148, 0.1);
  border-color: var(--success) !important;
}

.price-drop-label {
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 768px) {
  .rv-card { min-width: 140px; max-width: 140px; }
  .alert-dialog { min-width: 280px; padding: 20px; }
}

@media (max-width: 480px) {
  .rv-card { min-width: 120px; max-width: 120px; }
  .alert-btn-card { opacity: 1; }
}

/* ============================================
   PWA Install Banner
   ============================================ */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  padding: 12px 16px;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.install-banner-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-icon { font-size: 1.6rem; flex-shrink: 0; }

.install-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.install-text strong {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  color: var(--text);
}

.install-text span {
  font-size: 0.78rem;
  color: var(--text-light);
}

.install-btn {
  background: var(--gradient);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font-body);
  white-space: nowrap;
  transition: transform 0.2s;
}

.install-btn:hover { transform: scale(1.05); }

.install-dismiss {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.install-dismiss:hover { color: var(--text); }

@media (max-width: 600px) {
  .install-banner { padding: 10px 12px; }
  .install-icon { font-size: 1.3rem; }
  .install-text strong { font-size: 0.82rem; }
  .install-text span { font-size: 0.72rem; }
  .install-btn { padding: 6px 16px; font-size: 0.78rem; }
}

/* ============================================
   Quick Replies (Smart Chatbot)
   ============================================ */
.quick-replies {
  display: flex;
  gap: 8px;
  padding: 8px 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: wrap;
  justify-content: center;
}

.quick-reply-btn {
  padding: 6px 14px;
  border: 2px solid transparent;
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body);
  transition: all 0.2s;
  background-image: linear-gradient(var(--card-bg), var(--card-bg)), var(--gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.quick-reply-btn:hover {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  background-clip: border-box;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .quick-replies { padding: 6px 10px; gap: 6px; }
  .quick-reply-btn { font-size: 0.72rem; padding: 5px 10px; }
}

/* ============================================
   Spin & Win
   ============================================ */
.spin-float-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient);
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 90;
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-spin 2s ease-in-out infinite;
  transition: transform 0.2s;
}

[dir="rtl"] .spin-float-btn { left: auto; right: 24px; }

.spin-float-btn:hover { transform: scale(1.1); }

@keyframes pulse-spin {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4); }
  50% { transform: scale(1.08); box-shadow: 0 6px 28px rgba(108, 92, 231, 0.55); }
}

.spin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s;
}

.spin-modal {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 30px 24px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.spin-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  transition: color 0.2s;
}

[dir="rtl"] .spin-modal-close { right: auto; left: 16px; }

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

.spin-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: var(--text);
}

.spin-wheel-wrap {
  position: relative;
  margin: 0 auto 20px;
  width: 300px;
  height: 300px;
}

#spinCanvas {
  border-radius: 50%;
  box-shadow: 0 0 0 6px var(--primary), 0 0 0 10px var(--primary-light), 0 8px 30px rgba(108,92,231,0.3);
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.spin-pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: var(--primary);
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.spin-btn {
  background: var(--gradient);
  color: #fff;
  border: none;
  padding: 12px 40px;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.spin-btn:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4); }
.spin-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.spin-result {
  margin-top: 20px;
  text-align: center;
}

.spin-result-icon { font-size: 2.5rem; margin-bottom: 8px; }

.spin-result-text {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.spin-result-sub {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 14px;
}

.spin-claim-btn {
  display: inline-block;
  background: var(--success);
  color: #fff;
  padding: 10px 28px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.2s;
}

.spin-claim-btn:hover { background: #00a884; transform: scale(1.05); }

/* Spin dark mode */
[data-theme="dark"] .spin-modal {
  background: var(--card-bg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

[data-theme="dark"] #spinCanvas {
  box-shadow: 0 0 0 6px var(--primary), 0 0 0 10px var(--primary-dark), 0 8px 30px rgba(0,0,0,0.4);
}

/* Spin responsive */
@media (max-width: 380px) {
  .spin-float-btn { width: 48px; height: 48px; font-size: 1.5rem; bottom: 16px; left: 16px; }
  [dir="rtl"] .spin-float-btn { left: auto; right: 16px; }
  .spin-wheel-wrap { width: 240px; height: 240px; }
  #spinCanvas { width: 240px !important; height: 240px !important; }
  .spin-modal { padding: 20px 16px; }
  .spin-title { font-size: 1.2rem; }
  .spin-btn { padding: 10px 30px; font-size: 1rem; }
}

@media (max-width: 600px) {
  .spin-wheel-wrap { width: 260px; height: 260px; }
  #spinCanvas { width: 260px !important; height: 260px !important; }
}

/* ============================================
   Safe area for notch devices (iPhone X+)
   ============================================ */
@supports (padding-top: env(safe-area-inset-top)) {
  .navbar { padding-top: env(safe-area-inset-top); }
  .footer { padding-bottom: env(safe-area-inset-bottom); }
  .input-area { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}

/* ==============================================
   Points Program
   ============================================ */
.points-nav-btn { position: relative; }
.points-badge {
  background: linear-gradient(135deg, #f0c27f, #fc5c7d);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Points Toast */
.points-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(135deg, #6C5CE7, #a363d9);
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
}
.points-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.points-toast-icon { margin-inline-end: 6px; }

/* Points Modal */
.points-modal { max-width: 420px; }

.points-balance-display {
  text-align: center;
  padding: 24px 0 16px;
}
.points-balance-num {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, #f0c27f, #fc5c7d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  line-height: 1;
}
.points-balance-label {
  font-size: 1.1rem;
  color: #888;
  margin-top: 4px;
  display: block;
}

.points-section-title {
  font-size: 0.95rem;
  color: #666;
  margin: 16px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
}
[data-theme="dark"] .points-section-title { color: #aaa; border-color: #444; }

/* Redeem Tiers Grid */
.points-tiers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.points-tier-card {
  background: #f8f9fd;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.points-tier-card:hover:not(.disabled) {
  border-color: #6C5CE7;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}
.points-tier-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
[data-theme="dark"] .points-tier-card { background: #2a2a3a; border-color: #444; }
[data-theme="dark"] .points-tier-card:hover:not(.disabled) { border-color: #a363d9; }

.tier-icon { font-size: 1.5rem; }
.tier-cost { font-size: 0.85rem; font-weight: 700; color: #6C5CE7; }
.tier-label { font-size: 0.8rem; color: #666; }
[data-theme="dark"] .tier-label { color: #aaa; }

/* Points History */
.points-history-list { max-height: 200px; overflow-y: auto; }
.points-history-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 8px;
}
[data-theme="dark"] .points-history-item { border-color: #333; }
.ph-pts {
  font-weight: 700;
  min-width: 40px;
  font-size: 0.9rem;
}
.ph-pts.positive { color: #00B894; }
.ph-pts.negative { color: #D63031; }
.ph-reason { flex: 1; font-size: 0.85rem; color: #555; }
[data-theme="dark"] .ph-reason { color: #bbb; }
.ph-date { font-size: 0.75rem; color: #999; }

@media (max-width: 380px) {
  .points-balance-num { font-size: 2.2rem; }
  .points-tiers-grid { gap: 8px; }
  .points-tier-card { padding: 10px 6px; }
}

/* ============================================
   FAQ Section
   ============================================ */
.faq-section {
  max-width: 800px;
  margin: 0 auto 30px;
  padding: 30px 20px;
}
.faq-title {
  text-align: center;
  font-family: 'Heebo', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  overflow: hidden;
  transition: box-shadow 0.3s;
}
.faq-item:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  transition: color 0.2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '▼';
  font-size: 0.7rem;
  color: var(--primary);
  transition: transform 0.3s;
}
.faq-item[open] summary::after {
  transform: rotate(180deg);
}
.faq-item[open] summary {
  color: var(--primary);
  border-bottom: 1px solid #f0ecff;
}
.faq-item p {
  padding: 16px 20px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #636e72;
}
@media (max-width: 480px) {
  .faq-section { padding: 20px 12px; }
  .faq-title { font-size: 1.3rem; }
  .faq-item summary { padding: 14px 16px; font-size: 0.95rem; }
  .faq-item p { padding: 14px 16px; font-size: 0.9rem; }
}
