:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #111827;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #f5f7fb;
  --surface: #ffffff;
}

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

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.container {
  width: min(92%, 1200px);
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.search {
  flex: 1;
}

.search input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
}

.search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary-dark);
  font-size: 0.9rem;
}

.cart-toggle,
.checkout-btn,
.btn {
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-toggle:hover,
.checkout-btn:hover,
.btn:hover {
  transform: translateY(-1px);
}

.cart-toggle {
  padding: 10px 14px;
  background: var(--primary);
  color: white;
  border-radius: 999px;
}

.cart-toggle span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.8rem;
}

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 0 16px;
}

.category-btn {
  border: 1px solid var(--border);
  background: white;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

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

.hero {
  background: linear-gradient(120deg, var(--primary-dark), #3b82f6);
  color: white;
  padding: 72px 0;
}

.hero-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.1;
  max-width: 600px;
  margin-bottom: 12px;
}

.hero p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.92);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.btn {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.16);
  color: white;
}

.hero-card {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 20px;
  border-radius: 18px;
  min-width: min(100%, 280px);
}

.hero-card ul {
  list-style: none;
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.catalog {
  padding: 64px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: 1.7rem;
}

.muted {
  color: var(--muted);
  max-width: 420px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.product-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 10px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card .detail-trigger {
  cursor: pointer;
}

.product-card img.detail-trigger:hover,
.product-card h3.detail-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.15);
}

.product-card h3 {
  font-size: 1rem;
  margin-bottom: 4px;
  transition: color 0.25s ease;
}

.product-card h3.detail-trigger:hover {
  color: var(--primary-dark);
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.product-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.price {
  font-weight: 700;
  color: var(--primary-dark);
}

.add-btn,
.detail-add-btn,
.back-btn {
  padding: 8px 12px;
  background: var(--primary);
  color: white;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

.detail-add-btn {
  margin-top: 18px;
}

.back-btn {
  background: rgb(255, 196, 0);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  grid-column: 1 / -1;
  justify-self: start;
}

.product-detail {
  padding: 64px 0;
  background: rgba(37, 99, 235, 0.04);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 32px;
  align-items: start;
}

.detail-image img {
  width: 100%;
  border-radius: 20px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-info h2 {
  font-size: 2rem;
}

.detail-specs {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}

.detail-specs h4 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.detail-specs ul {
  list-style: disc;
  margin-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.detail-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.hidden {
  display: none !important;
}

.features {
  padding: 0 0 64px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.feature-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.feature-card h3 {
  margin-bottom: 8px;
}

.footer {
  text-align: center;
  padding: 24px 0 40px;
  color: var(--muted);
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(92%, 360px);
  height: 100vh;
  background: white;
  box-shadow: -8px 0 30px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 40;
  display: flex;
  flex-direction: column;
}

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

.cart-header,
.cart-footer {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-footer {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  flex-direction: column;
  gap: 12px;
}

.icon-btn {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: flex;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--primary);
  cursor: pointer;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.checkout-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  padding: 11px 14px;
  border-radius: 999px;
}

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 24px 0;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .actions {
    justify-content: space-between;
  }

  .section-head {
    flex-direction: column;
    align-items: start;
  }
}
