* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1a56db;
  --primary-dark: #1e40af;
  --secondary: #f97316;
  --dark: #1f2937;
  --gray: #6b7280;
  --light: #f3f4f6;
  --white: #ffffff;
  --success: #16a34a;
  --danger: #dc2626;
  --border: #e5e7eb;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  color: var(--dark);
  background: var(--white);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--dark);
  text-decoration: none;
}

.logo span {
  color: var(--primary);
}

.header-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.header-nav a {
  color: var(--gray);
  font-weight: 500;
  font-size: 14px;
}

.header-nav a:hover {
  color: var(--primary);
  text-decoration: none;
}

.btn-seller {
  background: var(--primary);
  color: var(--white) !important;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
}

.btn-seller:hover {
  background: var(--primary-dark);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1a56db 100%);
  color: var(--white);
  padding: 60px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 36px;
  margin-bottom: 12px;
}

.hero p {
  font-size: 18px;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 24px;
}

.search-box {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
}

.search-box input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  font-size: 15px;
  outline: none;
  color: var(--dark);
}

.search-box button {
  background: var(--secondary);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
}

.search-box button:hover {
  background: #ea580c;
}

/* Categories */
.categories {
  padding: 30px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.categories h2 {
  font-size: 22px;
  margin-bottom: 16px;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-pill {
  background: var(--light);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--dark);
  cursor: pointer;
  border: 1px solid var(--border);
}

.category-pill:hover,
.category-pill.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* Product Grid */
.products-section {
  padding: 20px 20px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.products-section h2 {
  font-size: 22px;
  margin-bottom: 20px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.product-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--light);
}

.product-card-body {
  padding: 14px;
}

.product-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--dark);
}

.product-card .category-tag {
  font-size: 12px;
  color: var(--primary);
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 8px;
}

.product-card .price {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
}

.product-card .supplier {
  font-size: 13px;
  color: var(--gray);
  margin-top: 4px;
}

.product-card .btn-enquiry {
  display: block;
  width: 100%;
  background: var(--secondary);
  color: var(--white);
  text-align: center;
  padding: 10px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  margin-top: 10px;
  border-radius: 6px;
}

.product-card .btn-enquiry:hover {
  background: #ea580c;
}

/* Product Detail Page */
.product-detail {
  padding: 30px 20px 60px;
  max-width: 1000px;
  margin: 0 auto;
}

.breadcrumb {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 20px;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.product-image {
  width: 100%;
  border-radius: 10px;
  background: var(--light);
  object-fit: cover;
  min-height: 300px;
}

.product-info h1 {
  font-size: 26px;
  margin-bottom: 10px;
}

.product-info .price {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 16px;
}

.product-info .description {
  color: var(--gray);
  margin-bottom: 20px;
  line-height: 1.7;
}

.supplier-card {
  background: var(--light);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.supplier-card h4 {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 6px;
}

.supplier-card .company {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
}

.supplier-card .location {
  font-size: 14px;
  color: var(--gray);
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.specs-table th,
.specs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.specs-table th {
  background: var(--light);
  font-weight: 600;
  width: 40%;
}

.btn-quote {
  background: var(--secondary);
  color: var(--white);
  border: none;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
}

.btn-quote:hover {
  background: #ea580c;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 12px;
  padding: 30px;
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.modal .modal-subtitle {
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 20px;
}

.modal-close {
  float: right;
  cursor: pointer;
  font-size: 24px;
  color: var(--gray);
  border: none;
  background: none;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.btn-submit {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
}

.btn-submit:hover {
  background: var(--primary-dark);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
}

/* Footer */
.footer {
  background: var(--dark);
  color: var(--gray);
  padding: 30px 20px;
  text-align: center;
  font-size: 14px;
}

.footer a {
  color: var(--white);
}

/* Loading & Empty */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--gray);
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
}

.empty h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .product-detail-grid {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 26px;
  }
  .header-nav {
    gap: 12px;
  }
  .header-nav a:not(.btn-seller) {
    display: none;
  }
}