:root {
  --primary: #f1c40f;
  --bg-dark: #0d1117;
  --bg-light: #161b22;
  --text-light: #f8f8f8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
}

/* HEADER */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-light);
  padding: 0.8em 1em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

header h1 {
  color: var(--primary);
  font-size: 1.4em;
}

nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

nav a {
  color: var(--text-light);
  margin: 0 8px;
  text-decoration: none;
  font-size: 0.95em;
}

nav a:hover {
  color: var(--primary);
}

.user-greet {
  margin-right: 0.5em;
  color: var(--primary);
  font-weight: 600;
}

/* SEARCH */
.search-bar {
  text-align: center;
  margin: 1em 0;
}

.search-bar input {
  width: 90%;
  max-width: 500px;
  padding: 0.7em;
  border: none;
  border-radius: 5px;
  outline: none;
  font-size: 1em;
}

/* CATEGORIES */
.categories {
  text-align: center;
  margin-bottom: 1em;
  flex-wrap: wrap;
}

.categories button {
  background: var(--bg-light);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.5em 1em;
  margin: 0.3em;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.9em;
}

.categories .active, .categories button:hover {
  background: var(--primary);
  color: var(--bg-dark);
}

/* PRODUCT GRID */
.store {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1em;
  padding: 1em;
}

.product {
  background: var(--bg-light);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  padding-bottom: 1em;
  transition: 0.3s;
}

.product img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.product:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 15px var(--primary);
}

.product-content h3 {
  margin: 0.5em 0;
  font-size: 1em;
}

.product-content button {
  background: var(--primary);
  border: none;
  padding: 0.5em 1.2em;
  color: var(--bg-dark);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
}

.product-content button:hover {
  background: #ffda3a;
}

/* CART SIDEBAR */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 350px;
  height: 100%;
  background: var(--bg-light);
  box-shadow: -3px 0 8px rgba(0,0,0,0.5);
  transition: 0.3s;
  display: flex;
  flex-direction: column;
  z-index: 200;
}

.cart-sidebar.active {
  right: 0;
}

.cart-header {
  background: var(--primary);
  color: var(--bg-dark);
  padding: 1em;
  font-weight: 600;
  text-align: center;
}

.cart-items {
  flex: 1;
  padding: 1em;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #333;
  padding: 0.5em 0;
  font-size: 0.9em;
}

.cart-total {
  text-align: center;
  padding: 1em;
  font-weight: bold;
}

.cart-btn {
  background: var(--primary);
  border: none;
  padding: 1em;
  color: var(--bg-dark);
  font-weight: 600;
  cursor: pointer;
  font-size: 1em;
}

.cart-btn:hover {
  background: #ffdf4f;
}

.pagination {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #161b22; /* matches your dark theme */
  color: #f8f8f8;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.8rem;
  gap: 1rem;
  border-top: 1px solid #222;
  z-index: 99;
}

.pagination button {
  background-color: #f1c40f; /* primary color */
  color: #0d1117;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.pagination button:hover {
  background-color: #f5d547;
  transform: translateY(-2px);
}

.pagination span {
  font-size: 0.95rem;
  font-weight: 500;
}

/* ✅ Responsive adjustments */
@media (max-width: 600px) {
  .pagination {
    gap: 0.5rem;
    padding: 0.6rem;
  }

  .pagination button {
    width: 30%;
    font-size: 0.9rem;
  }

  .pagination span {
    font-size: 0.85rem;
  }
}



/* MODAL */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 300;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-light);
  padding: 1.5em;
  border-radius: 10px;
  width: 90%;
  max-width: 350px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0,0,0,0.6);
}

.modal h2 {
  margin-bottom: 1em;
  color: var(--primary);
}

.modal input {
  width: 90%;
  margin: 0.5em 0;
  padding: 0.6em;
  border: none;
  border-radius: 5px;
  font-size: 1em;
}

.modal button {
  background: var(--primary);
  border: none;
  padding: 0.7em 1.5em;
  color: var(--bg-dark);
  font-weight: bold;
  cursor: pointer;
  margin-top: 0.8em;
  border-radius: 6px;
}

.modal button:hover {
  background: #ffdf4f;
}

.blurred {
  filter: blur(6px);
}





/* RESPONSIVE */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    text-align: center;
  }

  nav a {
    display: inline-block;
    margin: 0.5em 0.5em;
  }

  .store {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.8em;
  }

  .product img {
    height: 140px;
  }

  .cart-sidebar {
    width: 100%;
    height: 70%;
    bottom: -100%;
    top: auto;
    right: 0;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
  }

  .cart-sidebar.active {
    bottom: 0;
  }

  .cart-header {
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
  }
}

@media (max-width: 480px) {
  .search-bar input {
    width: 95%;
  }

  .categories button {
    font-size: 0.8em;
    padding: 0.4em 0.8em;
  }

  .modal {
    padding: 1.2em;
  }

  .cart-item {
    font-size: 0.85em;
  }

  .product-content h3 {
    font-size: 0.9em;
  }
}