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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  line-height: 1.6;
}

/* Header Styles */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

header h1 {
  font-size: 24px;
  font-weight: 600;
}

nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 5px;
  transition: all 0.3s ease;
  font-weight: 500;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

nav a.active {
  background: rgba(255, 255, 255, 0.3);
}

.logout-btn {
  background: rgba(255, 77, 77, 0.8) !important;
}

.logout-btn:hover {
  background: rgba(255, 77, 77, 1) !important;
}

/* Main Container */
main {
  padding: 40px 20px;
}

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

.products-header {
  text-align: center;
  margin-bottom: 40px;
  color: white;
}

.products-header h2 {
  font-size: 36px;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.products-header p {
  font-size: 18px;
  opacity: 0.9;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.product-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.product-image {
  width: 100%;
  height: 250px;
  overflow: hidden;
  background: #f5f5f5;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.1);
}

.product-info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-size: 20px;
  color: #333;
  margin-bottom: 10px;
  font-weight: 600;
}

.product-price {
  font-size: 24px;
  color: #667eea;
  font-weight: bold;
  margin-bottom: 15px;
}

.product-actions {
  margin-top: auto;
}

.quantity-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.quantity-selector button {
  width: 35px;
  height: 35px;
  border: none;
  background: #667eea;
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.quantity-selector button:hover {
  background: #764ba2;
  transform: scale(1.1);
}

.qty-input {
  width: 60px;
  text-align: center;
  padding: 8px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
}

.add-to-cart-btn, .login-prompt-btn {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.add-to-cart-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.login-prompt-btn {
  background: #ff6b6b;
  color: white;
}

.login-prompt-btn:hover {
  background: #ff5252;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Loading and Error States */
.loading, .no-products, .error {
  text-align: center;
  padding: 40px;
  font-size: 18px;
  color: white;
  grid-column: 1 / -1;
}

.error {
  color: #ff6b6b;
  background: white;
  border-radius: 10px;
}

/* Footer */
footer {
  background: rgba(0, 0, 0, 0.2);
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 60px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
  }
  
  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }
  
  .products-header h2 {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}