:root {
  --bg-color: #f8f9fa;
  --text-color: #1a1e21;
  --card-bg: white;
  --header-bg: white;
  --footer-bg: #2c3e50;
  --footer-text: #ecf0f1;
  --border-color: #ddd;
  --btn-bg: #ff9900;
  --btn-hover: #e67e22;
  --hero-bg: linear-gradient(110deg, #eef2f5, #e2e9ef);
  --coming-soon-bg: #ecf0f1;
  --shadow: 0 4px 12px rgba(0,0,0,0.05);
}

body.dark {
  --bg-color: #1e1e2a;
  --text-color: #f0f0f0;
  --card-bg: #2d2d3a;
  --header-bg: #2c2c3a;
  --footer-bg: #1a1a24;
  --footer-text: #ccc;
  --border-color: #444;
  --btn-bg: #e67e22;
  --btn-hover: #ff9900;
  --hero-bg: linear-gradient(110deg, #2c3e50, #1e2f3a);
  --coming-soon-bg: #2c2c3a;
  --shadow: 0 4px 12px rgba(0,0,0,0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', 'Poppins', system-ui, -apple-system, sans-serif;
  transition: background-color 0.3s ease, color 0.2s ease;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

header {
  background: var(--header-bg);
  padding: 1rem 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1e2a3a, #2c3e50);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.dark .logo h1 {
  background: linear-gradient(135deg, #ff9900, #e67e22);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo span {
  font-size: 0.8rem;
  color: #7f8c8d;
  display: block;
}

.header-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-wrapper {
  display: flex;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 48px;
  padding: 4px 12px;
  align-items: center;
}

.search-wrapper input {
  border: none;
  background: transparent;
  padding: 8px;
  width: 200px;
  outline: none;
  color: var(--text-color);
}

.search-wrapper button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-color);
}

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--btn-hover);
}

.cart-icon {
  position: relative;
  font-size: 1.6rem;
  display: inline-block;
}

.cart-icon span {
  position: absolute;
  top: -8px;
  right: -12px;
  background: var(--btn-bg);
  color: white;
  border-radius: 50%;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: bold;
}

.hero {
  background: var(--hero-bg);
  border-radius: 32px;
  margin: 2rem auto;
  max-width: 1280px;
  padding: 3rem 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text-color);
}

.hero p {
  font-size: 1.1rem;
  margin: 1rem 0;
  color: var(--text-color);
}

.btn, .hero .btn {
  background: var(--btn-bg);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 40px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}

.btn:hover, .hero .btn:hover {
  background: var(--btn-hover);
}

.category-section {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.category-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 2rem 0 1.5rem;
  border-left: 5px solid var(--btn-bg);
  padding-left: 1rem;
  color: var(--text-color);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.product-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.product-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #f0f2f5;
}

.product-info {
  padding: 1.2rem;
}

.product-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.price {
  margin: 0.5rem 0;
}

.original-price {
  text-decoration: line-through;
  color: #95a5a6;
  font-size: 0.9rem;
  margin-right: 0.5rem;
}

.discount-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--btn-bg);
}

.description {
  font-size: 0.85rem;
  color: #7f8c8d;
  margin: 0.5rem 0;
}

.add-to-cart {
  background: var(--btn-bg);
  color: white;
  border: none;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.8rem;
}

.add-to-cart:hover {
  background: var(--btn-hover);
}

.coming-soon {
  text-align: center;
  background: var(--coming-soon-bg);
  padding: 3rem;
  border-radius: 16px;
  color: var(--text-color);
  margin-bottom: 2rem;
}

.coming-soon i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
}

.about-page, .contact-page, .auth-page, .cart-page {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.about-page {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}

.about-content {
  flex: 1;
}

.about-content h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.about-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.about-page img {
  flex: 1;
  max-width: 100%;
  border-radius: 16px;
}

.contact-page {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.contact-info, .contact-form {
  flex: 1;
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.contact-info h2, .contact-form h2 {
  margin-bottom: 1rem;
  color: var(--text-color);
}

.contact-info p {
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 1rem;
}

.contact-form button {
  background: var(--btn-bg);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.contact-form button:hover {
  background: var(--btn-hover);
}

.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.auth-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.auth-card input {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 1rem;
}

.auth-card button {
  background: var(--btn-bg);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 0.5rem;
}

.auth-card button:hover {
  background: var(--btn-hover);
}

.auth-card p {
  text-align: center;
  margin-top: 1rem;
}

.auth-card a {
  color: var(--btn-bg);
  text-decoration: none;
}

.cart-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.cart-item {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.cart-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.cart-item-info {
  padding: 1rem;
}

.cart-item-info h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.cart-item-info p {
  font-weight: bold;
  color: var(--btn-bg);
}

.remove-item {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 0.5rem;
  width: 100%;
}

.remove-item:hover {
  background: #c0392b;
}

.cart-summary {
  text-align: right;
  font-size: 1.2rem;
  margin: 1rem 0;
  padding: 1rem;
  border-top: 1px solid var(--border-color);
}

#checkoutBtn {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 1rem auto;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--btn-bg);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    text-align: center;
  }
  .header-controls {
    order: 2;
  }
  nav {
    order: 3;
  }
  .category-title {
    font-size: 1.5rem;
  }
  .products-grid {
    gap: 1.2rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .about-page {
    flex-direction: column;
  }
  .contact-page {
    flex-direction: column;
  }
}