:root {
  --primary: #32111ccf;
  --secondary: #6b3045ef;
  --accent: #d19c6b;
  --bg: #f7d1d1;
  --text: #222;
  --card: #f5f1f1;
  --shadow: rgba(0, 0, 0, 0.08);
  --border: #eee;
}

body.dark {
  --bg: #121212;
  --text: #f0f0f0;
  --card: #1e1e1e;
  --shadow: rgba(0, 0, 0, 0.4);
  --border: #333;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: all 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.header {
  position: sticky;
  top: 0;
  background: var(--card);
  box-shadow: 0 4px 20px var(--shadow);
  z-index: 1000;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 0;
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

nav a {
  margin: 0 1rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  position: relative;
  transition: color 0.3s;
}

nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -6px;
  left: 0;
  background: var(--primary);
  transition: width 0.3s;
}

nav a:hover::after { width: 100%; }

.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-input {
  padding: 0.7rem 1.2rem;
  border: 2px solid var(--border);
  border-radius: 30px;
  background: var(--card);
  color: var(--text);
  outline: none;
  width: 240px;
  transition: border 0.3s;
}

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

.icon-btn {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s;
}

.icon-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.cart-icon {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--accent);
  color: black;
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.hero {
  padding: 5rem 0;
  background: linear-gradient(135deg, var(--primary) 0%, #ff8a9f 100%);
  color: white;
  margin-bottom: 3rem;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-text h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero-text p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

.btn-primary {
  background: white;
  color: var(--primary);
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.hero-image img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}
.filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.filter-btn {
  background: var(--card);
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 0.7rem 1.5rem;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--primary);
  color: white;
}

.sort-container select {
  padding: 0.7rem 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--primary);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.product {
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 25px var(--shadow);
  transition: all 0.4s ease;
  opacity: 0;
  transform: translateY(30px);
}

.product.visible {
  opacity: 1;
  transform: translateY(0);
}

.product:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px var(--shadow);
}

.product img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.product h3 {
  padding: 1rem;
  font-size: 1.2rem;
  text-align: center;
}

.price {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary);
  padding: 0.5rem 0;
}

.product-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  flex-wrap: wrap;
}

.btn-buy, .btn-contact {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-buy {
  background: var(--primary);
  color: white;
}

.btn-contact {
  background: #666;
  color: white;
}

.btn-wishlist {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}

.btn-wishlist.active {
  background: var(--primary);
  color: white;
}

.pagination button {
  margin: 0.3rem;
  padding: 0.6rem 1rem;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  border-radius: 10px;
  cursor: pointer;
}

.pagination button.active {
  background: var(--primary);
  color: white;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active { display: flex; }

.modal-content {
  background: var(--card);
  padding: 2rem;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  position: relative;
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--primary);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  display: none;
  z-index: 1000;
}

.back-to-top.visible { display: block; }

footer {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--card);
  margin-top: 4rem;
  color: #888;
}

@media (max-width: 768px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; }
  .hero-text h1 { font-size: 2.8rem; }
  nav { position: fixed; top: 70px; left: 0; width: 100%; background: var(--card); flex-direction: column; padding: 2rem 0; display: none; }
  nav.active { display: flex; }
  .search-input { width: 200px; }
}