/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* General */
body {
  font-family: "Roboto", Arial, sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background: #f7f7f8;
}

h1, h2, h3, h4 {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  color: #4b0082; /* purple */
}

img { max-width: 100%; display: block; }
button, input, select { font: inherit; }

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

/* Header */
.site-header {
  background: linear-gradient(90deg, #6a0dad, #4b0082);
  color: #fff;
  padding: 1rem 0;
  text-align: center;
}
.site-header h1 {
  margin-bottom: 0.25rem;
  color: #ffd700; /* gold */
}
.site-header p {
  font-size: 0.9rem;
  color: #fff;
}

/* Controls */
.controls {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.controls input, .controls select {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}
.btn-toggle {
  width: 44px;
  height: 24px;
  background: #444;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
}
.btn-toggle .toggle-dot {
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.3s ease;
}
.btn-toggle[aria-pressed="true"] { background: #ffd700; }
.btn-toggle[aria-pressed="true"] .toggle-dot { transform: translateX(20px); }

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  justify-items: center;
}
.product-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  width: 320px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}
.product-card img {
  height: 200px;
  object-fit: cover;
  width: 100%;
}
.product-card h3 {
  font-size: 1.1rem;
  margin: 0.75rem;
  color: #4b0082;
}
.product-card p {
  font-size: 0.9rem;
  margin: 0 0.75rem 0.75rem;
  color: #333;
}
.card-footer {
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #eee;
}
.price {
  font-weight: bold;
  color: #ffd700; /* gold */
}
.product-card button {
  background: #4b0082;
  color: #fff;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
}
.product-card button:hover { background: #6a0dad; }

/* Cart */
.cart h2 { margin-top: 2rem; }
.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.cart-table th, .cart-table td {
  padding: 0.75rem;
  border: 1px solid #ddd;
  text-align: center;
}
.cart-table th {
  background: #4b0082;
  color: #fff;
}
.cart-table td input {
  width: 60px;
  text-align: center;
  padding: 0.3rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.grand-label {
  font-weight: bold;
  text-align: right;
}
#grand-total {
  font-weight: bold;
  color: #16a34a;
}
.btn-danger {
  margin-top: 1rem;
  background: #dc2626;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}
.btn-danger:hover { background: #b91c1c; }

/* Footer */
.site-footer {
  background: #4b0082;
  color: #fff;
  text-align: center;
  padding: 1rem 0;
  margin-top: 2rem;
}

/* Dark Mode */
body.dark {
  background: #111;
  color: #f3f4f6;
}
body.dark .product-card {
  background: #1f1f1f;
  color: #f3f4f6;
}
body.dark .product-card h3 { color: #ffd700; }
body.dark .product-card p { color: #ddd; }
body.dark .cart-table th { background: #ffd700; color: #111; }
body.dark .product-card button { background: #ffd700; color: #111; }
body.dark .product-card button:hover { background: #e6c200; }

/* Responsive */
@media (max-width: 900px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .products-grid { grid-template-columns: 1fr; }
}
