:root {
  --headerbg: #E7C7A6;
  --text: #1b1b1b;
  --accent: #8b3e2f;
  --focus: #0044ff;
  --logo-height: 100px;   /* desktop logo height */
  --touch-min: 44px;
  --nav-gap: 0.75rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  line-height: 1.4;
}

.site-header,button{
font-size: 16px;
font-weight: bold;
color: rgba(0,0,0,.7);
}

.site-header ul{
list-style-type: none;
}


.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: #000;
  color: #fff;
  border-radius: 4px;
}

.site-header {
  background: var(--headerbg);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  width: 100vw;
}

.header-inner {
  display: flex;
  align-items: center;
  min-height: calc(var(--logo-height) + 20px);
  padding: 0 10px;
  position: relative;
  gap: 1rem;
  width: 100%;
}

/* Logo left */
.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  color: inherit;
  z-index: 10;
}

#site-logo {
  height: var(--logo-height);
  width: auto;
  display: block;
}

/* Nav menu center */
.primary-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-list {
  display: flex;
  gap: var(--nav-gap);
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
  line-height: 1.5;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  min-height: var(--touch-min);
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

.nav-link:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.nav-link:hover,
.nav-link:focus {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.has-submenu > .submenu-toggle > .caret {
  display: inline-block;
  margin-left: 0.35rem;
  /* correct for flex gap issue with caret */
  margin-left: 0;
  margin-right: -12px;
  border-top: 5px solid currentColor;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  width: 0;
  height: 0;
  transform-origin: center;
}

.nav-item[aria-expanded="true"] > .submenu-toggle > .caret {
  transform: rotate(180deg);
}

.submenu {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 12rem;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
  margin-top: 0.35rem;
  padding: 0.5rem 0;
  border-radius: 6px;
  z-index: 200;
}

.submenu[hidden] {
  display: none;
}

.submenu li a {
  display: block;
  padding: 0.5rem 1rem;
  white-space: nowrap;
}

.submenu a:focus {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

/* Utilities right */
.utilities {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.utility-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
}

.utility-link:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.cart-count {
  display: inline-block;
  min-width: 1.25rem;
  text-align: center;
  padding: 0.1rem 0.35rem;
  margin-left: 0.25rem;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Mobile toggle */
.mobile-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 6px;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-toggle:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Mobile close button hidden on desktop */
.mobile-close {
  display: none;
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
  display: none;
}

main {
  padding: 1.5rem;
  margin: 1rem auto;
  max-width: 1200px;
}

.demo-btn {
  padding: 0.5rem 0.75rem;
  margin-right: 0.5rem;
}

/* Mobile styles */
@media (max-width: 768px) {
  :root {
    --logo-height: 80px;   /* smaller logo on mobile */
  }

  .mobile-toggle {
    display: flex;
  }

  .logo-wrap {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .primary-nav {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 85%;
    max-width: 420px;
    background: var(--headerbg);
    transform: translateX(-110%);
    transition: transform 0.28s ease;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow-y: auto;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .primary-nav.open {
    transform: translateX(0);
  }

  .mobile-close {
    display: block;
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    z-index: 210;
  }

  .mobile-close svg {
    width: 24px;
    height: 24px;
  }

  .nav-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin: 50px 0 0 0; /* start below close button */
    gap: 0.25rem;
  }

  .nav-link {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
  }

  .submenu {
    position: static;
    box-shadow: none;
    border: 0;
    background: transparent;
    margin: 0;
    padding: 0 0.5rem;
  }

  .submenu li a {
    padding: 0.5rem 1.5rem;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    margin: 0.15rem 0;
  }

  .overlay.show {
    display: block;
  }
}
