/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #333;
  background: #f5f5f5;
  line-height: 1.6;
}

a { color: #2a7ae2; text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* === Header === */
.site-header { background: #1a1a2e; color: #fff; }

.header-top { padding: 12px 0; border-bottom: 1px solid #16213e; }
.header-top .container { display: flex; justify-content: space-between; align-items: center; }
.header-top-right { display: flex; align-items: center; gap: 24px; }

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}
.logo:hover { text-decoration: none; color: #e94560; }

.customer-menu { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.customer-menu a { color: #ccc; }
.customer-menu a:hover { color: #fff; }
.welcome-msg { color: #e94560; font-weight: 500; }

.cart-summary { font-size: 0.9rem; }
.cart-link { color: #ccc; }
.cart-link:hover { color: #fff; }

/* === Nav === */
.main-nav { background: #16213e; padding: 0; }
.nav-list { display: flex; list-style: none; gap: 0; }
.nav-list li a {
  display: block;
  padding: 10px 16px;
  color: #ccc;
  font-size: 0.85rem;
  transition: background 0.2s;
}
.nav-list li a:hover { background: #0f3460; color: #fff; text-decoration: none; }

/* === Main Content === */
.main-content { padding: 30px 20px; min-height: 60vh; }

.page-title {
  font-size: 1.6rem;
  margin-bottom: 24px;
  color: #1a1a2e;
}

/* === Product Grid === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}

.product-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }

.product-link { color: inherit; display: flex; flex-direction: column; flex: 1; }
.product-link:hover { text-decoration: none; }

.product-image {
  background: #f0f0f5;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}
.product-image img { max-width: 100%; max-height: 160px; object-fit: contain; }

.product-info { padding: 16px; flex: 1; }
.product-name { font-size: 0.95rem; margin-bottom: 6px; color: #1a1a2e; }
.product-category { display: inline-block; font-size: 0.75rem; color: #888; background: #f0f0f5; padding: 2px 8px; border-radius: 10px; margin-bottom: 8px; }
.product-price { display: block; font-size: 1.1rem; font-weight: 700; color: #e94560; }

.product-card .add-to-cart-btn { margin-top: auto; }

.add-to-cart-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: #e94560;
  color: #fff;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.add-to-cart-btn:hover { background: #c73e54; }
.add-to-cart-btn:disabled { background: #ccc; cursor: not-allowed; }

/* === Cart Page === */
.cart-page { max-width: 800px; }
.cart-empty { text-align: center; padding: 40px 20px; background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.cart-empty p { margin: 12px 0 24px; color: #666; }
.cart-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.cart-table th { background: #1a1a2e; color: #fff; padding: 12px 16px; text-align: left; font-size: 0.85rem; text-transform: uppercase; }
.cart-table td { padding: 16px; border-bottom: 1px solid #eee; vertical-align: middle; }
.cart-table tr:last-child td { border-bottom: none; }
.cart-item-name { font-weight: 600; color: #1a1a2e; }
.cart-item-price { color: #e94560; font-weight: 600; }
.cart-remove-btn { background: none; border: 1px solid #e94560; color: #e94560; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; transition: all 0.2s; }
.cart-remove-btn:hover { background: #e94560; color: #fff; }
.cart-total { display: flex; justify-content: flex-end; margin-top: 20px; }
.cart-total-box { background: #fff; padding: 20px 30px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); text-align: right; }
.cart-total-box .total-label { font-size: 1rem; color: #666; }
.cart-total-box .total-price { font-size: 1.5rem; font-weight: 700; color: #e94560; margin-left: 16px; }
.cart-actions { display: flex; justify-content: space-between; margin-top: 20px; }

/* === Alert === */
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; font-size: 0.9rem; }

/* === Login Page === */
.login-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.login-section {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.login-section h2 { margin-bottom: 16px; color: #1a1a2e; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.9rem; color: #555; }
.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: #2a7ae2; box-shadow: 0 0 0 3px rgba(42,122,226,0.1); }

.form-actions { margin-top: 20px; }
.form-links { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.form-links a { font-size: 0.85rem; }

.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: #fdeaea; color: #c0392b; border: 1px solid #f5c6cb; }

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: #e94560; color: #fff; }
.btn-primary:hover { background: #c73e54; }
.btn-secondary { background: #16213e; color: #fff; }
.btn-secondary:hover { background: #0f3460; }

/* === Account Page === */
.account-welcome { background: #e8f5e9; padding: 16px 20px; border-radius: 4px; margin-bottom: 24px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.account-card {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.account-card h3 { margin-bottom: 12px; color: #1a1a2e; }

/* === Product Detail === */
.back-link { display: inline-block; margin-bottom: 20px; font-size: 0.9rem; }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.product-detail-image { background: #f0f0f5; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 40px; min-height: 300px; }
.product-detail-image img { max-width: 100%; max-height: 280px; object-fit: contain; }
.product-detail-name { font-size: 1.5rem; margin-bottom: 8px; }
.product-category-badge { display: inline-block; background: #f0f0f5; padding: 4px 12px; border-radius: 12px; font-size: 0.8rem; color: #888; margin-bottom: 16px; }
.product-detail-price { font-size: 1.6rem; font-weight: 700; color: #e94560; margin-bottom: 16px; }
.product-detail-description { color: #666; margin-bottom: 24px; line-height: 1.7; }
.product-actions { display: flex; align-items: center; gap: 16px; }
.quantity-selector { display: flex; align-items: center; gap: 8px; }
.quantity-selector input { width: 60px; padding: 8px; border: 1px solid #ddd; border-radius: 4px; text-align: center; }

/* === Error Page === */
.error-page { text-align: center; padding: 60px 20px; }
.error-page h1 { margin-bottom: 16px; }
.error-page p { margin-bottom: 24px; color: #666; }

/* === Footer === */
.site-footer { background: #1a1a2e; color: #ccc; padding: 40px 0 20px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-bottom: 30px; }
.footer-col h4 { color: #fff; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul a { color: #ccc; font-size: 0.9rem; }
.footer-col ul a:hover { color: #e94560; }
.footer-bottom { border-top: 1px solid #16213e; padding-top: 16px; text-align: center; font-size: 0.85rem; }

/* === Responsive === */
@media (max-width: 768px) {
  .login-grid, .product-detail { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-list { flex-wrap: wrap; }
  .header-top .container { flex-direction: column; gap: 12px; }
}
