*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  color: #1a1a1a;
  background: #f8f9fc;
  line-height: 1.6;
}

/* ── Header ──────────────────────────────────────────────────────────────────── */

header {
  background: #0d1b2a;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.tagline {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Hero ────────────────────────────────────────────────────────────────────── */

.hero {
  background: linear-gradient(160deg, #0d1b2a 0%, #1a3a5c 100%);
  color: #fff;
  text-align: center;
  padding: 5rem 1.5rem 4rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  max-width: 700px;
  margin-inline: auto;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.75;
  max-width: 560px;
  margin-inline: auto;
}

/* ── Main layout ─────────────────────────────────────────────────────────────── */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.category {
  margin-bottom: 4rem;
}

.category h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
  margin: 0 0 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #e0e1dd;
}

/* ── Product grid ────────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.product {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease;
}

.product:hover { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); }

/* Placeholder images — distinct colours per product type */
.product-img {
  height: 180px;
  background: #e8edf3;
}
.product-img.safety  { background: linear-gradient(135deg, #1a3a5c 0%, #2e6da4 100%); }
.product-img.probe   { background: linear-gradient(135deg, #1e4d2b 0%, #2d7a45 100%); }
.product-img.airbag  { background: linear-gradient(135deg, #3d1a1a 0%, #a03030 100%); }
.product-img.hoodie  { background: linear-gradient(135deg, #0d1b2a 0%, #415a77 100%); }
.product-img.cap     { background: linear-gradient(135deg, #1a1a2e 0%, #4a4a80 100%); }
.product-img.gloves  { background: linear-gradient(135deg, #2a1a0a 0%, #7a4a20 100%); }
.product-img.stickers{ background: linear-gradient(135deg, #0d2a2a 0%, #1a6b6b 100%); }
.product-img.notebook{ background: linear-gradient(135deg, #1a2a0d 0%, #4a7a1a 100%); }
.product-img.card    { background: linear-gradient(135deg, #0d1b2a 0%, #778da9 100%); }

.product-info {
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-info h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
}

.product-info p {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
  flex: 1;
}

.product-info a { color: #1a3a5c; }

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
}

.price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0d1b2a;
}

.btn-add {
  background: #0d1b2a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-add:hover { background: #1a3a5c; }

/* ── Cart button in header ───────────────────────────────────────────────────── */

.cart-btn {
  position: relative;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
}

.cart-btn:hover { opacity: 0.8; }

#cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ── Cart overlay + drawer ───────────────────────────────────────────────────── */

#cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
}

#cart-overlay.open { display: block; }

#cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100dvh;
  background: #fff;
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

#cart-drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.1rem;
  border: none;
  padding: 0;
  color: #0d1b2a;
  text-transform: none;
  letter-spacing: 0;
}

.drawer-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #6b7280;
  padding: 0.25rem;
  line-height: 1;
}

.drawer-close:hover { color: #1a1a1a; }

.cart-empty {
  padding: 2rem 1.5rem;
  color: #9ca3af;
  font-size: 0.925rem;
}

#cart-items {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.cart-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.ci-name {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.ci-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ci-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f3f4f6;
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
}

.ci-qty span {
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 1.25rem;
  text-align: center;
}

.qty-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #374151;
  padding: 0 0.1rem;
  line-height: 1;
}

.qty-btn:hover { color: #0d1b2a; }

.ci-price {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0d1b2a;
  margin-left: auto;
}

.ci-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 0.75rem;
  padding: 0.2rem;
  line-height: 1;
}

.ci-remove:hover { color: #e74c3c; }

#cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #0d1b2a;
}

.btn-checkout {
  width: 100%;
  background: #0d1b2a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-checkout:hover { background: #1a3a5c; }

/* ── "Added ✓" button state ──────────────────────────────────────────────────── */

.btn-add.added {
  background: #2d7a45;
  pointer-events: none;
}

/* ── Footer ──────────────────────────────────────────────────────────────────── */

footer {
  text-align: center;
  padding: 1.5rem;
  background: #0d1b2a;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
}

footer a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}

footer a:hover { color: #fff; }
