/* components.css */
/* 🔷 Core UI Elements for GetUpDeals */

:root {
  --primary-color: #ff3d00;
  --accent-color: #ffd54f;
  --text-dark: #1f1f1f;
  --text-light: #ffffff;
  --bg-light: #f9f9f9;
  --bg-dark: #121212;
  --radius: 12px;
  --transition: 0.3s ease;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.button,
.btn {
  display: inline-block;
  padding: 0.6em 1.2em;
  border: none;
  border-radius: var(--radius);
  background: var(--primary-color);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.button:hover,
.btn:hover {
  background: #e53900;
}

.badge {
  display: inline-block;
  background-color: var(--accent-color);
  color: #000;
  padding: 0.3em 0.7em;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
}

.grid {
  display: grid;
  gap: 1rem;
}

.reward-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.reward-card {
  padding: 1rem;
  border: 2px solid #eee;
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  text-align: center;
  transition: var(--transition);
}

.reward-card.earned {
  border-color: #4caf50;
  background: #e8f5e9;
}

.reward-card.locked {
  opacity: 0.6;
}

.reward-card .points {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--primary-color);
  margin: 0.5em 0;
}

.claim-btn {
  padding: 0.5em 1em;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.claim-btn:hover {
  background: #d32f2f;
}

.text-center {
  text-align: center;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  z-index: 999;
}

.modal.hidden {
  display: none;
}

.modal .modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 90%;
  max-width: 500px;
}

/* Support dark mode toggle */
body.dark-mode .card,
body.dark-mode .reward-card,
body.dark-mode .modal .modal-content {
  background: var(--bg-dark);
  color: var(--text-light);
}

body.dark-mode .reward-card.earned {
  background: #2e7d32;
}
/* Container Reset */
#categoriesContainer,
#subcategoriesContainer,
#filteredProducts {
  width: 100%;
  margin-top: 1rem;
  padding: 0 1rem;
}

/* Horizontal scroll */
#categoriesContainer,
#subcategoriesContainer {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

/* Category & Subcategory Card */
.category-card,
.subcategory-card {
  flex: 0 0 auto;
  width: 90px;
  text-align: center;
  scroll-snap-align: start;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
  padding: 10px;
  transition: transform 0.2s ease;
}

.category-card:hover,
.subcategory-card:hover {
  transform: translateY(-3px);
}

.category-card img,
.subcategory-card img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 6px;
}

.category-card span,
.subcategory-card span {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

/* Filtered Products Grid */
#filteredProducts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 1rem;
}

/* Product Card Reuse */
.product-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
  padding: 12px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 12px;
}

.product-card h4 {
  font-size: 14px;
  margin: 8px 0 4px;
  font-weight: 600;
  color: #222;
}

.product-card .price {
  font-size: 13px;
  color: #e53935;
  font-weight: bold;
}

.product-card .original-price {
  font-size: 12px;
  color: #999;
  text-decoration: line-through;
  margin-left: 6px;
}

/* Homepage Section Wrapper */
.homepage-section {
  padding: 1rem 1rem 0;
}

/* Header Row: Title + View All */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #222;
}

.section-header .view-all {
  font-size: 13px;
  font-weight: 600;
  color: #007aff;
  text-decoration: none;
}

/* Horizontal Scroll Carousel */
.carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
}

.carousel::-webkit-scrollbar {
  display: none;
}

/* Product Cards Inside Carousel */
.carousel .product-card {
  flex: 0 0 auto;
  width: 160px;
  scroll-snap-align: start;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
  padding: 12px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}

.carousel .product-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 12px;
}

.carousel .product-card h4 {
  font-size: 14px;
  margin: 8px 0 4px;
  font-weight: 600;
  color: #222;
}

.carousel .product-card .price {
  font-size: 13px;
  color: #e53935;
  font-weight: bold;
}

.carousel .product-card .original-price {
  font-size: 12px;
  color: #999;
  text-decoration: line-through;
  margin-left: 6px;
}

/* Header button styling */
.header-theme-toggle {
  position: relative;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  margin-left: 10px; /* or adjust to fit near search bar */
}

/* Shared icon styles */
.header-theme-toggle .icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  font-size: 1.4rem;
  transition: opacity 0.4s ease, transform 0.5s ease;
  opacity: 0;
  pointer-events: none;
}

/* Light mode: show sun */
body:not(.dark-mode) .header-theme-toggle .sun {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(360deg);
}

/* Dark mode: show moon with rotation */
body.dark-mode .header-theme-toggle .moon {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(360deg);
}



.search-wrapper {
  position: relative;
  width: 100%;
}

#searchSuggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  z-index: 999;
  border: 1px solid #ccc;
  border-top: none;
  display: none; /* will be set to block when matches found */
  max-height: 250px;
  overflow-y: auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#searchSuggestions div {
  padding: 10px;
  cursor: pointer;
  font-size: 14px;
}

#searchSuggestions div:hover {
  background-color: #f2f2f2;
}


