:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --accent: #0ea5a4;
  --muted: #6b7280;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(16, 24, 40, 0.08);
  --glass: rgba(255, 255, 255, 0.6);
  --maxw: 1100px;
}
* {
  box-sizing: border-box;
}
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial;
  margin: 0;
  background: linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
  color: #0f172a;
}
.container {
  max-width: var(--maxw);
  margin: 28px auto;
  padding: 20px;
}
header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #7dd3fc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
  box-shadow: var(--shadow);
}
h1 {
  margin: 0;
  font-size: 20px;
}
.searchbar {
  flex: 1;
  margin-left: 18px;
  display: flex;
  gap: 8px;
}
.searchbar input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e6eef5;
  background: white;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn {
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(14, 165, 164, 0.14);
}

/* layout */
main {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  margin-top: 22px;
}
/* product grid */
.products {
  background: transparent;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.card {
  background: var(--card);
  padding: 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.imgwrap {
  height: 150px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
}
.imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.title {
  font-weight: 600;
}
.price {
  font-weight: 700;
  color: var(--accent);
}
.muted {
  color: var(--muted);
  font-size: 13px;
}

/* cart */
aside.cart {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), var(--card));
  padding: 16px;
  border-radius: 12px;
  height: fit-content;
  position: sticky;
  top: 28px;
  box-shadow: var(--shadow);
}
.cart h3 {
  margin: 0 0 8px 0;
}
.cart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 360px;
  overflow: auto;
  padding-right: 6px;
}
.cart-item {
  display: flex;
  gap: 10px;
  align-items: center;
}
.cart-item img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
}
.qty {
  display: flex;
  gap: 8px;
  align-items: center;
}
.small {
  font-size: 13px;
}

.divider {
  height: 1px;
  background: #eef2f7;
  margin: 12px 0;
  border-radius: 4px;
}

/* product detail modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  width: 100%;
  max-width: 760px;
  background: var(--card);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 40px rgba(2, 6, 23, 0.28);
}
.modal .content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* responsiveness */
@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }
  aside.cart {
    position: relative;
    top: auto;
    margin-top: 12px;
  }
}

footer {
  margin-top: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* tiny helpers */
.pill {
  background: #eefdfa;
  padding: 6px 8px;
  border-radius: 999px;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
}
.iconbtn {
  background: transparent;
  border: 1px solid #eef2f7;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
}
a {
  text-decoration: none;
  color: inherit;
}
