:root {
  --cb-brown: #5C3A1E;
  --cb-dark: #1A1A1A;
  --cb-white: #FFFFFF;
  --cb-beige: #F5F0EB;
  --cb-beige-dark: #EDE5DB;
  --cb-gray: #777;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* ===== TOPBAR ===== */
.cb-topbar {
  background: var(--cb-beige-dark);
  padding: 7px 16px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--cb-brown);
  letter-spacing: 0.3px;
}

.cb-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cb-topbar__inner svg {
  stroke: var(--cb-brown);
  flex-shrink: 0;
}

/* ===== HEADER ===== */
.cb-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--cb-white);
  border-bottom: 1px solid #f0ebe5;
}

.cb-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 12px 24px;
  gap: 32px;
}

/* ===== BURGER ===== */
.cb-header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 28px;
  z-index: 1001;
}

.cb-header__burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--cb-dark);
  border-radius: 2px;
  transition: transform 300ms var(--ease-out), opacity 200ms ease;
}




/* ===== LOGO ===== */
.cb-header__logo {
  text-decoration: none;
  flex-shrink: 0;
}

.cb-logo-img {
  height: 48px;
  width: auto;
}

.cb-logo-text {
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-align: center;
  color: var(--cb-dark);
  line-height: 1.1;
  display: block;
}

.cb-logo-text strong {
  font-size: 1.5rem;
  display: block;
  letter-spacing: 4px;
}

/* ===== NAV DESKTOP ===== */
.cb-header__nav--desktop {
  flex: 1;
  display: flex;
  justify-content: center;
}

.cb-nav {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cb-nav > li {
  position: relative;
}

.cb-nav > li > a {
  display: block;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cb-dark);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 200ms ease;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .cb-nav > li > a:hover {
    color: var(--cb-brown);
  }
}

.cb-nav > li > .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--cb-white);
  border: 1px solid #f0ebe5;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  list-style: none;
  margin: 0;
  padding: 8px 0;
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms var(--ease-out);
}

.cb-nav > li:hover > .sub-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.cb-nav .sub-menu li a {
  display: block;
  padding: 8px 20px;
  font-size: 0.85rem;
  color: var(--cb-dark);
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

.cb-nav .sub-menu li a:hover {
  background: var(--cb-beige);
  color: var(--cb-brown);
}

/* ===== ACTIONS ===== */
.cb-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.cb-header__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cb-dark);
  padding: 6px;
  border-radius: 50%;
  transition: transform 160ms var(--ease-out), color 200ms ease;
  text-decoration: none;
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  .cb-header__icon:hover {
    color: var(--cb-brown);
  }
}

.cb-header__icon:active {
  transform: scale(0.92);
}

.cb-cart-count {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--cb-brown);
  color: var(--cb-white);
  font-size: 0.6rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ===== SEARCH BAR ===== */
.cb-search-bar {
  position: relative;
  z-index: 998;
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms var(--ease-out);
  background: var(--cb-white);
  border-bottom: 1px solid transparent;
}

.cb-search-bar.is-open {
  max-height: 80px;
  border-bottom-color: #f0ebe5;
}

.cb-search-bar form {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
}

.cb-search-bar__wrap {
  position: relative;
  display: flex;
  gap: 8px;
}

.cb-search-bar input[type="search"] {
  flex: 1;
  border: 1px solid #e5e0db;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 200ms ease;
  -webkit-appearance: none;
}

.cb-search-bar input[type="search"]:focus {
  border-color: var(--cb-brown);
}

.cb-search-bar button[type="submit"] {
  background: var(--cb-dark);
  color: var(--cb-white);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 200ms ease, transform 160ms var(--ease-out);
}

.cb-search-bar button[type="submit"]:hover {
  background: var(--cb-brown);
}

.cb-search-bar button[type="submit"]:active {
  transform: scale(0.95);
}

/* ===== AJAX SEARCH RESULTS ===== */
.cb-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 60px;
  background: var(--cb-white);
  border: 1px solid #e5e0db;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  display: none;
  z-index: 100;
  max-height: 360px;
  overflow-y: auto;
}

.cb-sr-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--cb-dark);
  transition: background 150ms ease;
}

.cb-sr-item:hover {
  background: var(--cb-beige);
}

.cb-sr-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--cb-beige);
  flex-shrink: 0;
}

.cb-sr-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.cb-sr-price {
  display: block;
  font-size: 0.85rem;
  color: var(--cb-brown);
  font-weight: 700;
  margin-top: 2px;
}

.cb-sr-empty {
  padding: 16px;
  text-align: center;
  color: var(--cb-gray);
  font-size: 0.9rem;
}

/* ===== MOBILE NAV ===== */
.cb-mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100vh;
  background: var(--cb-white);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 300ms var(--ease-out);
  padding: 72px 0 24px;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.1);
}

.cb-mobile-nav.is-open {
  transform: translateX(0);
}

.cb-mobile-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cb-mobile-menu li a {
  display: block;
  padding: 14px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cb-dark);
  text-decoration: none;
  border-bottom: 1px solid #f5f0eb;
  transition: background 150ms ease, color 150ms ease;
}

.cb-mobile-menu li a:hover {
  background: var(--cb-beige);
  color: var(--cb-brown);
}

.cb-mobile-menu .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cb-mobile-menu .sub-menu li a {
  padding-left: 40px;
  font-weight: 400;
  font-size: 0.9rem;
}

/* ===== OVERLAY ===== */
.cb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.cb-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .cb-header__nav--desktop {
    display: none;
  }

  .cb-header__burger {
    display: flex;
  }

  .cb-header__inner {
    padding: 12px 16px;
    justify-content: space-between;
  }

  .cb-header__inner {
    position: relative;
  }

  .cb-header__logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (min-width: 961px) {
  .cb-mobile-nav,
  .cb-overlay {
    display: none !important;
  }
}

/* ===== OVERRIDE THEME DEFAULTS ===== */
.cb-header__icon:focus,
.cb-header__icon:active {
  background: transparent;
  outline: none;
  box-shadow: none;
}

.cb-header__burger:focus,
.cb-header__burger:active {
  background: transparent;
  outline: none;
  box-shadow: none;
}

/* ===== MOBILE NAV CLOSE BUTTON ===== */
.cb-mobile-nav__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cb-dark);
  padding: 8px;
  transition: transform 160ms var(--ease-out);
}

.cb-mobile-nav__close:active {
  transform: scale(0.9);
}

/* ===== RESET THEME BUTTON DEFAULTS ===== */
.cb-header button,
.cb-header button:hover,
.cb-header button:focus,
.cb-header button:active,
.cb-header a,
.cb-header a:hover,
.cb-header a:focus,
.cb-header a:active {
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}
