:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #06b6d4;
  --dark: #0f172a;
  --light: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --radius: 10px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
  background-color: #f1f5f9;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Educational Warning Banner */
.vuln-banner {
  background: linear-gradient(90deg, #b91c1c, #dc2626);
  color: white;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.vuln-badge {
  background: rgba(255, 255, 255, 0.2);
  border: 1px dashed #fca5a5;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

/* Header & Navbar */
header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo span {
  color: #dc2626;
  font-size: 0.9rem;
  background: #fee2e2;
  padding: 2px 6px;
  border-radius: 4px;
}

.nav-search {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.nav-search input {
  width: 100%;
  padding: 10px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  outline: none;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.nav-search input:focus {
  border-color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

.cart-icon-btn {
  position: relative;
  background: #f1f5f9;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.2rem;
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: white;
  padding: 50px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.hero p {
  font-size: 1.1rem;
  color: #c7d2fe;
  max-width: 650px;
  margin: 0 auto 20px;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
  flex: 1;
  width: 100%;
}

/* Section Header */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title h2 {
  font-size: 1.6rem;
  color: var(--dark);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

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

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
}

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

.product-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--dark);
  text-decoration: none;
}

.product-title:hover {
  color: var(--primary);
}

.product-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex: 1;
  line-height: 1.4;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.2s, opacity 0.2s;
}

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

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

.btn-secondary {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #cbd5e1;
}

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

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* Form Styles */
.form-card {
  background: white;
  max-width: 450px;
  margin: 40px auto;
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.form-header {
  text-align: center;
  margin-bottom: 24px;
}

.form-header h2 {
  font-size: 1.7rem;
  color: var(--dark);
  margin-bottom: 6px;
}

.form-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-group input, 
.form-group select, 
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

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

.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

/* Alert boxes */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.alert-info {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #7dd3fc;
}

/* Vulnerability Hint Box (Educational) */
.vuln-hint-box {
  background: #fffbeb;
  border: 1px dashed #d97706;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.vuln-hint-box strong {
  color: #b45309;
  display: block;
  margin-bottom: 4px;
}

/* Cart Table */
.cart-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

.cart-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-muted);
}

.order-summary-card {
  background: white;
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  height: fit-content;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.summary-total {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  font-size: 1.2rem;
  font-weight: 700;
}

/* Product Detail Page */
.product-detail-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  background: white;
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.product-detail-img {
  width: 100%;
  height: 380px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.reviews-section {
  margin-top: 40px;
  background: white;
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.review-item {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

/* Profile / Orders */
.profile-card {
  background: white;
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

/* Footer */
footer {
  background: var(--dark);
  color: #94a3b8;
  padding: 30px 20px 20px;
  margin-top: auto;
  font-size: 0.9rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-nav a {
  color: #94a3b8;
  text-decoration: none;
  margin-left: 18px;
}

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

/* Responsive */
@media (max-width: 768px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }
  .product-detail-container {
    grid-template-columns: 1fr;
  }
  .navbar {
    flex-direction: column;
    align-items: stretch;
  }
}
