/* Reset and base styles */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f9f9f9;
  color: #333;
}

/* Header styles */
.main-header {
  background-color: #ffffff;
  color: #333;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.header-inner-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  position: relative; /* Essential for menu positioning */
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #333;
  font-weight: 700;
  font-size: 1.4rem;
  user-select: none;
}
.site-logo img {
  display: block;
  max-height: 60px;
  width: auto;
}

/* Hamburger button */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  user-select: none;
  transition: transform 0.3s ease;
}
.nav-toggle:focus {
  outline: 2px solid #333;
  outline-offset: 2px;
}
.nav-toggle .hamburger {
  display: block;
  height: 3px;
  background-color: #333;
  border-radius: 2px;
  transition: all 0.3s ease;
  width: 100%;
}
.nav-toggle.active .hamburger:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active .hamburger:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active .hamburger:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Navigation */
.main-navigation {
  position: absolute;
  top: 100%; /* Position below header */
  right: 0;
  background-color: #ffffff;
  width: 250px;
  border: 1px solid #ddd;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.15);
  display: none; /* Hidden by default */
  flex-direction: column;
  padding: 10px 0;
  z-index: 1001;
}
.main-navigation.active {
  display: flex !important; /* Show when active */
}

/* Menu items */
.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.main-navigation ul li a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333;
  text-decoration: none;
  padding: 12px 20px;
  font-weight: 600;
  transition: background-color 0.25s ease;
  border-radius: 4px;
  user-select: none;
}
.main-navigation ul li a:hover,
.main-navigation ul li a:focus {
  background-color: #f0f0f0;
  outline: none;
}

/* Cart icon */
.cart-icon-link {
  position: relative;
  color: #333;
  font-size: 1.6rem;
  text-decoration: none;
  user-select: none;
  display: flex;
  align-items: center;
}
.cart-count {
  position: absolute;
  top: -6px;
  right: -10px;
  background-color: #dc3545;
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  padding: 3px 7px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* Desktop Navigation */
@media (min-width: 700px) {
  .nav-toggle {
    display: none;
  }

  .main-navigation {
    position: static;
    background: transparent;
    box-shadow: none;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    padding: 0;
    width: auto;
  }

  .main-navigation ul {
    flex-direction: row;
    gap: 20px;
  }

  .main-navigation ul li a {
    padding: 8px 14px;
    background: transparent;
  }

  .main-navigation ul li a:hover,
  .main-navigation ul li a:focus {
    background-color: #f0f0f0;
  }

  .header-inner-wrapper {
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* Small screen adjustments */
@media (max-width: 380px) {
  .main-navigation {
    width: 100%;
    right: 0;
    left: 0;
  }
  
  .site-logo span {
    display: none; /* Hide site name on very small screens */
  }
}

/* Admin Navigation Bar */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 20px;
  background-color: #2c3e50;
}
.admin-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #3399cc;
  color: white;
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: background-color 0.2s ease, transform 0.1s ease;
}
.admin-nav a:hover {
  background-color: #2a85b5;
  transform: translateY(-1px);
}