/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f4f5f7; color: #1a1a2e; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Variables ────────────────────────────────────────────── */
:root {
  --navy: #1a1a2e;
  --red:  #c0392b;
  --gold: #f39c12;
  --light: #f4f5f7;
  --white: #ffffff;
  --border: #dde1e7;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,.10);
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  color: var(--white);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.logo { font-size: 1.35rem; font-weight: 700; letter-spacing: .5px; }
.logo span { color: var(--gold); }
.nav-links { display: flex; gap: 1.5rem; font-size: .9rem; }
.nav-links a:hover { color: var(--gold); }
.cart-btn {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: .45rem 1rem;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.cart-btn:hover { background: #a93226; }

/* ── Hero banner ──────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 420px;
  background: linear-gradient(135deg, var(--navy) 0%, #16213e 100%);
  color: var(--white);
  overflow: hidden;
}
.hero-image {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 58%;
  height: 100%;
  object-fit: contain;
  object-position: center right;
  pointer-events: none;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(26,26,46,0.97) 0%, rgba(26,26,46,0.75) 45%, rgba(26,26,46,0.15) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
  padding: 3.5rem 1.5rem 3rem 2rem;
}
.hero-badge {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  padding: .45rem .9rem;
  border-radius: var(--radius);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 1rem;
}
.hero h1 { font-size: 2.4rem; margin-bottom: .75rem; line-height: 1.15; }
.hero h1 span { color: var(--gold); }
.hero p { font-size: 1.05rem; opacity: .9; margin-bottom: 1.4rem; max-width: 480px; }
.hero-search {
  display: flex;
  max-width: 480px;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.hero-search input {
  flex: 1;
  padding: .75rem 1.2rem;
  border: none;
  font-size: 1rem;
  outline: none;
  color: #222;
}
.hero-search button {
  background: var(--gold);
  border: none;
  padding: .75rem 1.4rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
}
@media (max-width: 768px) {
  .hero { min-height: 360px; text-align: center; }
  .hero-content { padding: 2.5rem 1rem 2rem; margin: 0 auto; }
  .hero-image { width: 100%; opacity: .35; object-fit: cover; }
  .hero-overlay { background: linear-gradient(180deg, rgba(26,26,46,0.92) 0%, rgba(26,26,46,0.75) 100%); }
  .hero h1 { font-size: 1.75rem; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-search { margin: 0 auto; }
}

/* ── Layout ───────────────────────────────────────────────── */
.page-wrap { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1rem; }
.two-col { display: flex; gap: 1.5rem; align-items: flex-start; }
.sidebar { width: 220px; flex-shrink: 0; }
.main-col { flex: 1; min-width: 0; }

/* ── Filters sidebar ──────────────────────────────────────── */
.filter-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.filter-box h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; color: #666; margin-bottom: .6rem; }
.filter-box select, .filter-box input[type=range] { width: 100%; margin-top: .3rem; }
.filter-box select {
  padding: .4rem .6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .9rem;
}

/* ── Toolbar ──────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.result-count { font-size: .9rem; color: #555; }
.sort-select {
  padding: .4rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
}

/* ── Product grid ─────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.1rem;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.13); }
.product-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fafafa;
  padding: .5rem;
}
.card-body { padding: .7rem; flex: 1; display: flex; flex-direction: column; }
.card-brand { font-size: .72rem; color: #888; text-transform: uppercase; letter-spacing: .4px; }
.card-name { font-size: .85rem; font-weight: 600; margin: .25rem 0 .5rem; line-height: 1.3; flex: 1; }
.card-price { font-size: 1.05rem; font-weight: 700; color: var(--red); }
.card-stock { font-size: .75rem; color: #27ae60; margin-top: .2rem; }
.card-stock.low { color: #e67e22; }
.btn-add {
  margin-top: .6rem;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 5px;
  padding: .45rem;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  width: 100%;
  transition: background .15s;
}
.btn-add:hover { background: var(--red); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: .4rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.pagination button {
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 5px;
  padding: .4rem .75rem;
  cursor: pointer;
  font-size: .9rem;
}
.pagination button.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.pagination button:hover:not(.active) { background: var(--light); }

/* ── Cart drawer ──────────────────────────────────────────── */
.cart-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
}
.cart-overlay.open { display: block; }
.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: var(--white);
  box-shadow: -4px 0 20px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
  z-index: 201;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.cart-overlay.open .cart-drawer { transform: translateX(0); }
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 1.05rem;
}
.cart-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; }
.cart-items { flex: 1; overflow-y: auto; padding: .8rem 1.2rem; }
.cart-item {
  display: flex;
  gap: .8rem;
  align-items: center;
  padding: .7rem 0;
  border-bottom: 1px solid var(--border);
}
.cart-item img { width: 60px; height: 60px; object-fit: contain; border-radius: 4px; background: #fafafa; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: .85rem; font-weight: 600; line-height: 1.3; }
.cart-item-price { font-size: .9rem; color: var(--red); margin-top: .2rem; }
.cart-item-remove { background: none; border: none; color: #aaa; cursor: pointer; font-size: 1.1rem; }
.cart-item-remove:hover { color: var(--red); }
.cart-footer { padding: 1rem 1.2rem; border-top: 1px solid var(--border); }
.cart-total { font-weight: 600; font-size: .95rem; margin-bottom: .8rem; line-height: 1.5; }
.cart-total strong { font-size: 1.05rem; }
.btn-checkout {
  width: 100%;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: .85rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-checkout:hover { background: #a93226; }
.cart-empty { text-align: center; color: #aaa; padding: 2rem; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: #aaa;
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: .85rem;
  margin-top: 3rem;
}
.site-footer a { color: #ccc; }
.site-footer a:hover { color: var(--gold); }

/* ── Utility ──────────────────────────────────────────────── */
.hidden { display: none !important; }
.loading { text-align: center; padding: 3rem; color: #888; }
.no-results { text-align: center; padding: 3rem; color: #888; }
