/* Kitmik Categories Menu — unified click-to-drill-down panel, identical mechanism on desktop and mobile. */

/* Small down-chevron on the "Categories" nav trigger itself, so it reads as a dropdown before it's ever clicked. Flips upright when the panel is open (via the .is-open class the JS toggles on the trigger <li>). */
.km-categories-trigger .wp-block-navigation-item__content::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.2s ease;
}
.km-categories-trigger.is-open .wp-block-navigation-item__content::after {
  transform: rotate(180deg);
}

.km-cat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 17, 8, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 999998;
}
.km-cat-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.km-cat-panel {
  position: fixed;
  background: var(--km-bg, #fdf8f4);
  border-top: 2px solid var(--km-accent, #c4956a);
  box-shadow: 0 8px 32px rgba(28, 17, 8, 0.10);
  border-radius: 0 0 10px 10px;
  width: 300px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 999999;
}
.km-cat-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.km-cat-panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid #ede5dc;
  position: sticky;
  top: 0;
  background: var(--km-bg, #fdf8f4);
}
.km-cat-back {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--km-dark, #1c1108);
  padding: 0;
  white-space: nowrap;
}
.km-cat-back[hidden] { display: none; }
.km-cat-title {
  flex: 1;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--km-dark, #1c1108);
}
.km-cat-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--km-dark, #1c1108);
  padding: 0 2px;
}

.km-cat-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}
.km-cat-item { margin: 0; }
.km-cat-item__link,
.km-cat-item__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--km-dark, #1c1108);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.km-cat-item__link:hover,
.km-cat-item__btn:hover {
  background: var(--km-light, #f0e8df);
  color: var(--km-accent, #c4956a);
}
.km-cat-chevron {
  opacity: 0.6;
  font-size: 1rem;
}
.km-cat-item--view-all .km-cat-item__link {
  font-style: italic;
  opacity: 0.85;
  border-bottom: 1px solid #ede5dc;
}

/* Mobile: full-screen panel, matches this site's existing mobile-nav-overlay pattern */
@media (max-width: 782px) {
  .km-cat-panel {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    transform: none !important;
    border-top: none !important;
  }
  html.km-cat-open {
    overflow: hidden;
  }
}
