@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap");

:root {
  --bg: #f6f1eb;
  --surface: #fffdfb;
  --text: #2a1f18;
  --muted: #7a695b;
  --line: #eadfce;
  --brand: #b05024;
  --brand-strong: #833a17;
  --accent: #bf2f42;
  --beige: #f5e8dd;
  --honey: #f2d9b8;
  --gold: #d6b07a;
  --gold-r: rgba(214, 176, 122, 0.9);
  --active-green: #9fcc84;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 253, 250, 0.95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  grid-auto-rows: auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.menu-toggle {
  border: 1px solid #dbcdbf;
  background: #fff;
  color: #584739;
  border-radius: 12px;
  width: 42px;
  height: 42px;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
}

.brand {
  text-decoration: none;
  color: var(--brand-strong);
  font-weight: 800;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.brand-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.search-form {
  width: 100%;
  max-width: 420px;
  display: flex;
  gap: 8px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-form input {
  min-width: 0;
  flex: 1;
  border: 1px solid #dbcdbf;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.search-form button {
  border: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
}

.cart-link {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  background: #fff;
}

.user-badge {
  text-decoration: none;
  color: var(--brand-strong);
  border: 1px solid #e5d8ca;
  background: #fff;
  border-radius: 12px;
  padding: 9px 12px;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 18px;
  padding: 0 0 10px;
}

.nav-links a {
  color: #5f5148;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--brand-strong);
}

.side-menu {
  position: fixed;
  inset: 0;
  background: rgba(20, 13, 8, 0.4);
  z-index: 999;
  display: flex;
  justify-content: flex-start;
  /* Right side in RTL */
  align-items: flex-start;
  /* Top */
  padding: 15px;
  /* Space from edges */
  backdrop-filter: blur(4px);
}

.side-menu[hidden] {
  display: none;
}

.side-menu-panel {
  position: relative;
  width: min(360px, 92vw);
  height: auto;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #f7e8d7 0%, #efd6bf 48%, #e8c9ad 100%);
  border: 4px solid #b98a67;
  border-radius: 24px;
  box-shadow: 0 24px 48px rgba(25, 15, 10, 0.4);
  padding: 30px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: sideMenuSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.side-menu-panel a {
  text-decoration: none;
  color: #4a2b18;
  border: 1px solid #cfa98a;
  border-radius: 12px;
  padding: 12px 13px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff8f0, #f6e4d0);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.side-menu-panel a:hover {
  transform: translateX(-2px);
  border-color: #b98a67;
  box-shadow: 0 10px 16px rgba(70, 39, 20, 0.14);
}

.side-menu-panel a.active {
  background: linear-gradient(135deg, var(--beige), var(--active-green));
  border-color: var(--gold);
  color: var(--text);
  box-shadow: 0 10px 20px rgba(77, 46, 24, 0.08);
  transform: none;
}

.side-menu-panel>a:first-of-type {
  margin-top: 14px;
}

.menu-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 1px solid #bb8e6f;
  background: linear-gradient(135deg, #b05024, #833a17);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  font-size: 24px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

@keyframes sideMenuSlideIn {
  from {
    transform: translateX(50px) scale(0.98);
    opacity: 0;
  }

  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    position: relative;
  }

  .menu-toggle {
    grid-column: 1;
  }

  .brand {
    grid-column: 2;
    justify-self: center;
    margin-left: 0;
  }

  .topbar-actions {
    grid-column: 3;
    justify-self: end;
  }

  .topbar-actions .cart-link,
  .topbar-actions .user-badge {
    width: auto;
  }

  .topbar .search-form {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100vw;
    margin: 10px 0 0;
  }

  .search-form input {
    min-width: 0;
    flex: 1;
  }

  .nav-links {
    display: none;
  }

  .side-menu-panel {
    width: min(320px, 90vw);
  }
}