:root {
  --header-height: 90px;
}

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

/* =========================
   BODY
========================= */
body {
  font-family: system-ui, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  padding-top: var(--header-height);
  overflow-x: hidden;
  min-height: 100vh;
}

/* =========================
   HEADER
========================= */
#header {
  position: fixed;
  top: 0;
  left: 0;

  width: 100%;
  height: var(--header-height);

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 0 22px;

  background: white;
  border-bottom: 1px solid #e5e7eb;

  z-index: 9999;
}

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

#HIcon {
  width: 48px;
}

#HH1 {
  font-size: 1.5rem;
  white-space: nowrap;
}

#hamburger {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f1f5f9;
  cursor: pointer;
}

/* =========================
   NAV (IMPROVED UI)
========================= */
#nav {
  position: fixed;
  top: 0;
  right: -340px;

  width: 340px;
  height: 100vh;

  background: white;
  padding: 90px 25px;

  transition: right .3s ease;
  z-index: 10000;

  box-shadow: -25px 0 50px rgba(0,0,0,.25);
}

#nav.active {
  right: 0;
}

#navClose {
  position: absolute;
  top: 18px;
  right: 18px;

  font-size: 1.4rem;
  border: none;
  background: #f1f5f9;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
}

#nav ul {
  list-style: none;
}

#nav li {
  margin-bottom: 14px;
}

#nav a {
  text-decoration: none;
  font-size: 1.05rem;
  color: #0f172a;
  font-weight: 600;
  display: block;
  padding: 10px;
  border-radius: 10px;
}

#nav a:hover {
  background: #f1f5f9;
}

/* =========================
   STORE SECTION
========================= */
.store-section {
  width: 100%;
  max-width: 1300px;
  margin: 60px auto;
  padding: 30px;

  background: #dbe8f5;
  border-radius: 20px;
}

/* =========================
   FILTERS
========================= */
.category-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.category-filter select,
.category-filter input {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

/* =========================
   GRID (FIXED + LARGE SCREEN SUPPORT)
========================= */
#shopgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;

  width: 100%;
  min-height: 200px;
  align-items: stretch;
}

/* =========================
   PRODUCT BOX
========================= */
.productbox {
  background: white;
  border-radius: 16px;
  padding: 16px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  min-height: 340px;

  box-shadow: 0 6px 20px rgba(0,0,0,.08);
}

.productbox img {
  width: 100%;
  height: 180px;
  object-fit: contain;

  background: #f8fafc;
  border-radius: 10px;

  margin-bottom: 12px;
}

.productbox h3 {
  font-size: 1rem;
  margin: 8px 0 4px;
}

.productbox p {
  font-size: 0.9rem;
  color: #475569;
  flex-grow: 1;
  margin-bottom: 10px;
}

.productbox .stock {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 10px;
}

/* buttons */
.productbox > div:last-child {
  display: flex;
  gap: 8px;
}

.productbox .btn {
  flex: 1;
  padding: 10px;
  border-radius: 999px;

  font-weight: 700;
  border: none;
  cursor: pointer;
}

.productbox .btn.view {
  background: #2563eb;
  color: white;
}

.productbox .btn.add {
  background: #16a34a;
  color: white;
}

/* =========================
   CART ICON
========================= */
#cart-icon {
  position: fixed;
  right: 20px;
  bottom: 20px;

  background: #c9d2d4;
  color: black;

  padding: 12px 16px;
  border-radius: 999px;

  cursor: pointer;
  z-index: 2000;
}

/* =========================
   BASKET PANEL (FIXED RESPONSIVE)
========================= */
#basket-panel {
  position: fixed;
  top: var(--header-height);
  right: -100%;

  width: 420px;
  max-width: 100%;
  height: calc(100vh - var(--header-height));

  background: white;
  z-index: 3000;

  display: flex;
  flex-direction: column;

  transition: right .3s ease;
  overflow: hidden;
}

#basket-panel.open {
  right: 0;
}

/* mobile fix */
@media (max-width: 600px) {
  #basket-panel {
    width: 100%;
    right: -100%;
  }

  #basket-panel.open {
    right: 0;
  }
}

/* =========================
   BASKET HEADER (FIXED UI)
========================= */
#basket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 14px;
  border-bottom: 1px solid #e5e7eb;
}

#close-basket {
  border: none;
  background: #f1f5f9;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
}

/* =========================
   BASKET ITEMS
========================= */
#basket-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.basket-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 12px;

  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
  align-items: center;
}

.basket-item img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 8px;
}

/* =========================
   BASKET FOOTER
========================= */
#basket-footer {
  padding: 14px;
  border-top: 1px solid #e5e7eb;

  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* buttons */
#clear-cart-btn,
#buy-all-btn,
#my-orders-btn {
  border: none;
  padding: 10px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

#clear-cart-btn {
  background: #e5e7eb;
}

#buy-all-btn {
  background: #16a34a;
  color: white;
}

#my-orders-btn {
  background: #2563eb;
  color: white;
}

/* =========================
   FOOTER
========================= */
#footer {
  text-align: center;
  padding: 40px 20px;
  margin-top: 60px;
}

/* =========================
   ANIMATION
========================= */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: .6s ease;
}

.reveal.active {
  opacity: 1;
  transform: none;
}
.icon {
  width: 22px;
  height: 22px;
}
