/* global reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial;
}

body {
  background: #0d0d0f;
  color: #fff;
}

/* header*/
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 50px;
  background: rgba(20, 20, 24, 0.7);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 1000;
}

/* logo */
.logo {
  color: #ff2e63;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* nav links */
nav {
  display: flex;
  align-items: center;
}

nav a {
  color: #bbb;
  text-decoration: none;
  margin: 0 12px;
  font-weight: 500;
  transition: 0.3s;
  position: relative;
}

/* hover */
nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: #ff2e63;
  transition: 0.3s;
}

nav a:hover {
  color: #ff2e63;
}

nav a:hover::after {
  width: 100%;
}

/* hamburger (hidden on desktop) */
.menu-toggle {
  display: none;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
}

.container {
  display: flex;
  gap: 20px;
  padding: 30px;
  flex-wrap: wrap;
}

/* sidebar */
.sidebar {
  flex: 1;
  min-width: 220px;
  background: #1c1c1f;
  padding: 20px;
  border-radius: 15px;
  height: fit-content;
}
.category {
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 10px;
}
.category.active,
.category:hover {
  background: #ff2e63;
}

/* top bar */
.topbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
}

.search {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: none;
}

/* products */
.products {
  flex: 3;
}

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

.card {
  background: #1c1c1f;
  padding: 15px;
  border-radius: 15px;
  text-align: center;
}

.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
}

.price {
  color: #aaa;
  margin-bottom: 8px;
}

.btn {
  background: #ff2e63;
  padding: 10px 20px;
  border: none;
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
}

/* cart */
.cart {
  flex: 1;
  min-width: 260px;
  background: #1c1c1f;
  padding: 20px;
  border-radius: 15px;
  /* top: 0; */
}

.cart ul {
  list-style: none;
}

.cart li {
  margin: 8px 0;
}

.total {
  margin-top: 10px;
  font-weight: bold;
  color: #fff;
}

.action-btn {
  margin-top: 10px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.clear {
  background: #444;
  color: #fff;
}
.pay {
  background: #ff2e63;
  color: #fff;
}

/* footer */
footer {
  text-align: center;
  padding: 20px;
  background: #111;
  margin-top: 40px;
}

@media (max-width: 1024px) {
  header {
    padding: 15px 20px;
  }

  .menu-toggle {
    display: block;
  }

  nav {
    position: absolute;
    top: 70px;
    right: 20px;
    background: rgba(20, 20, 24, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    width: 200px;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: none;
  }

  nav a {
    margin: 10px 0;
  }

  nav.active {
    display: flex;
  }

  /* layout change */
  .container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "sidebar"
      "products"
      "cart";
    gap: 15px;
    padding: 15px;
  }

  .products {
    grid-area: products;
  }

  .sidebar {
    grid-area: sidebar;
    width: 100%;
  }

  .cart {
    grid-area: cart;
    width: 100%;
  }
}
