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

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #64748b;
  --success: #22c55e;
  --danger: #ef4444;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Navigation */
nav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--primary);
}

.cart-icon {
  position: relative;
}

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

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

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: white;
  padding: 80px 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: 30px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  text-decoration: none;
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
  text-decoration: none;
}

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

.btn-success:hover {
  background: #16a34a;
}

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

.btn-lg {
  padding: 16px 32px;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

/* Section */
.section {
  padding: 60px 0;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 40px;
  text-align: center;
}

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

.product-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.product-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.product-info {
  padding: 20px;
}

.product-title {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 15px;
}

.product-rating {
  color: #fbbf24;
  margin-bottom: 15px;
}

/* Product Detail */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding: 40px 0;
}

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

.product-gallery {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-radius: 12px;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8rem;
}

.product-detail-info h1 {
  font-size: 2rem;
  margin-bottom: 15px;
}

.product-detail-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
}

.product-description {
  color: var(--text-muted);
  margin-bottom: 30px;
}

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

.quantity-selector button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 8px;
  font-size: 1.25rem;
  cursor: pointer;
}

.quantity-selector input {
  width: 60px;
  height: 40px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.action-buttons {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

/* Cart */
.cart-table {
  width: 100%;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.cart-table th,
.cart-table td {
  padding: 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cart-table th {
  background: var(--bg);
  font-weight: 600;
}

.cart-table tr:last-child td {
  border-bottom: none;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.cart-item-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.cart-summary {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  border: 1px solid var(--border);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.cart-summary-row:last-of-type {
  border-bottom: none;
  font-weight: 700;
  font-size: 1.25rem;
}

/* Checkout */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 40px;
}

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

.checkout-form {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  border: 1px solid var(--border);
}

.form-section {
  margin-bottom: 30px;
}

.form-section h3 {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.order-summary {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  border: 1px solid var(--border);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.order-summary h3 {
  margin-bottom: 20px;
}

.order-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

/* About */
.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-content h2 {
  margin-top: 40px;
  margin-bottom: 20px;
}

.about-content p {
  margin-bottom: 15px;
  color: var(--text-muted);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 40px;
}

.team-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  border: 1px solid var(--border);
}

.team-avatar {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

/* Footer */
footer {
  background: var(--text);
  color: white;
  padding: 40px 0;
  margin-top: 60px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 30px;
}

.footer-links a {
  color: #94a3b8;
}

.footer-links a:hover {
  color: white;
}

/* Notifications */
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--success);
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateX(150%);
  transition: transform 0.3s;
  z-index: 1000;
}

.notification.show {
  transform: translateX(0);
}

/* Debug Panel */
.debug-panel {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 15px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 12px;
  max-width: 350px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}

.debug-panel h4 {
  margin-bottom: 10px;
  color: #22c55e;
}

.debug-entry {
  padding: 3px 0;
  border-bottom: 1px solid #333;
}

/* Discount Section */
.discount-section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px 30px;
  border: 1px solid var(--border);
  margin-top: 30px;
}

.discount-section h4 {
  margin-bottom: 14px;
  font-size: 1rem;
  font-weight: 600;
}

.discount-input-row {
  display: flex;
  gap: 12px;
}

.discount-code-input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.discount-code-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.discount-applied-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
}

.discount-tag {
  color: #166534;
  font-size: 1rem;
  font-weight: 500;
}

.discount-remove {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0 6px;
}

.discount-remove:hover {
  color: var(--danger);
}

.discount-row {
  background: #f0fdf4;
  margin: 0 -30px;
  padding: 10px 30px !important;
}

/* Cart bottom layout — discount + summary side by side */
.cart-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 30px;
  align-items: start;
}

@media (max-width: 768px) {
  .cart-bottom {
    grid-template-columns: 1fr;
  }
}

/* Success Page */
.success-page {
  text-align: center;
  padding: 80px 20px;
}

.success-icon {
  width: 100px;
  height: 100px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 30px;
  font-size: 3rem;
}

.success-page h1 {
  margin-bottom: 15px;
}

.success-page p {
  color: var(--text-muted);
  margin-bottom: 30px;
}
