/* Modern UI Styles */
:root {
  /* Theme Colors - Will be overridden by dynamic values */
  --primary-color: #4CAF50;
  --secondary-color: #2196F3;
  --accent-color: #FFC107;
  --text-color: #333333;
  --light-bg: #f8f9fa;
  --card-bg: #ffffff;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

/* Base Styles */
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-color);
  background-color: var(--light-bg);
  padding-bottom: 60px; /* For bottom nav */
}

/* Top Navigation */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 12px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.search-bar {
  flex: 1;
  margin: 0 16px;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 10px 15px 10px 40px;
  border: 1px solid #e0e0e0;
  border-radius: 25px;
  font-size: 14px;
  background-color: #f5f5f5;
  outline: none;
  transition: var(--transition);
}

.search-bar input:focus {
  background-color: white;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #757575;
}

.notification-icon {
  position: relative;
  padding: 8px;
  color: #333;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: #ff3b30;
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero Slider */
.hero-slider {
  margin-top: 60px; /* Height of top nav */
  border-radius: 0 0 20px 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hero-slide {
  position: relative;
  height: 200px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hero-content {
  max-width: 70%;
}

.hero-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 12px;
}

.hero-btn {
  background: white;
  color: var(--primary-color);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.hero-btn:active {
  transform: translateY(1px);
}

/* Categories */
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 16px 16px;
  color: var(--text-color);
}

.categories-container {
  display: flex;
  gap: 12px;
  padding: 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scrollbar-width: none; /* Firefox */
}

.categories-container::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome, Safari and Opera */
}

.category-card {
  min-width: 100px;
  text-align: center;
  background: white;
  border-radius: 12px;
  padding: 12px 8px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid #f0f0f0;
}

.category-card:active {
  transform: scale(0.98);
}

.category-icon {
  width: 50px;
  height: 50px;
  background: var(--light-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  color: var(--primary-color);
  font-size: 24px;
}

.category-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-color);
  white-space: nowrap;
}

/* Products */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px;
  margin-top: 8px;
}

.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  border: 1px solid #f0f0f0;
}

.product-card:active {
  transform: translateY(2px);
}

.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent-color);
  color: #000;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  z-index: 1;
}

.wishlist-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff3b30;
  border: none;
  z-index: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

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

.product-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.product-info {
  padding: 10px;
}

.product-name {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 36px;
  line-height: 1.2;
}

.product-price {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 14px;
  margin-top: 4px;
}

.original-price {
  text-decoration: line-through;
  color: #999;
  font-size: 12px;
  margin-left: 4px;
  font-weight: normal;
}

.add-to-cart {
  width: 100%;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  margin-top: 8px;
  transition: var(--transition);
}

.add-to-cart:active {
  background: #3d8b40;
  transform: translateY(1px);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #757575;
  text-decoration: none;
  font-size: 10px;
  transition: var(--transition);
}

.nav-item.active {
  color: var(--primary-color);
}

.nav-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

/* Responsive Adjustments */
@media (min-width: 576px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .hero-slide {
    height: 280px;
  }
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .hero-slide {
    height: 350px;
  }
  
  .hero-title {
    font-size: 28px;
  }
  
  .hero-subtitle {
    font-size: 16px;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Utility Classes */
.text-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
