/* Reset & Fonts */
* {
  margin: 0; 
  padding: 0; 
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
  background: var(--bg);
  color: var(--text);
  transition: all 0.5s ease;
}

/* Themes */
:root {
  --bg: #111;
  --text: #fff;
  --card-bg: #1e1e1e;
  --header-bg: rgba(0, 0, 0, 0.8);
  --price-color: #ffcc00;
}
body.dark {
  --bg: linear-gradient(-45deg, #ff9a9e, #fad0c4, #fad390, #f6d365, #a1c4fd, #c2e9fb, #d4fc79, #96e6a1);
  --text: #222;
  --card-bg: #ffffffcc;
  --header-bg: rgba(255, 255, 255, 0.7);
  --price-color: #e63946;
  background-size: 400% 400%;
  animation: gradientBG 12s ease infinite;
}
body.light {
  --bg: linear-gradient(-45deg, #0f0f0f, #1a1a1a, #2b2b2b, #0f2027, #203a43, #2c5364);
  --text: #fff;
  --card-bg: #1e1e1ecc;
  --header-bg: rgba(20, 20, 20, 0.9);
  --price-color: #ffcc00;
  background-size: 400% 400%;
  animation: darkGradientBG 15s ease infinite;
}

/* Gradient animations */
@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes darkGradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Header */
header {
  background: var(--header-bg);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 2px solid rgba(255,255,255,0.1);
}

/* ShopEase Branding */
header h1 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(45deg, #ff8a00, #e52e71, #9b5de5, #00bbf9, #00f5d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 400% 400%;
  animation: gradientText 6s ease infinite;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.3s ease, text-shadow 0.3s ease;
}
header h1:hover {
  transform: scale(1.05);
  text-shadow: 0 0 20px rgba(255,255,255,0.6);
}
header h1::before {
  content: "🛍️";
  font-size: 1.8rem;
}
header h1::after {
  content: "✨";
  font-size: 1.6rem;
}
@keyframes gradientText {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Controls */
.controls {
  display: flex;
  gap: 0.5rem;
}
.controls input, .controls select {
  padding: 0.5rem;
  border: none;
  border-radius: 5px;
}
.controls button {
  border: none;
  background: #fff;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
}
.product-card {
  background: var(--card-bg);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}
.product-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.product-card .info {
  padding: 1rem;
}
.product-card h3 {
  margin-bottom: 0.5rem;
}
.product-card p.price {
  color: var(--price-color);
  font-weight: bold;
  margin-top: 0.5rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center; align-items: center;
}
.modal-content {
  background: var(--card-bg);
  color: var(--text);
  border-radius: 15px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
  animation: fadeIn 0.4s ease;
  position: relative;
}
.modal-content img {
  width: 100%; border-radius: 10px;
  margin-bottom: 1rem;
}
.modal-content .price {
  color: var(--price-color);
  font-size: 1.2rem;
  margin-top: 1rem;
}
.close {
  position: absolute; top: 10px; right: 20px;
  font-size: 2rem; cursor: pointer;
  color: white;
}
@keyframes fadeIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    gap: 0.5rem;
  }
}
