/* ═══════════════════════════════════════════════════════════
   CSS — Product Categories Mega Menu — Фермерски магазин Дружба
   Постави в child theme style.css или го enqueue като отделен файл.
   ═══════════════════════════════════════════════════════════ */

.drj-catmenu {
  width: 100%;
}

.drj-catmenu__cols {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

/* ── Лява колона ── */
.drj-catmenu__parents {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 315px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-right: 1px solid var(--light-beige, #faf5ee);
  padding-right: 20px;
  flex-shrink: 0;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--light-beige, #faf5ee) transparent;
}

.drj-catmenu__parents::-webkit-scrollbar {
  width: 4px;
}

.drj-catmenu__parents::-webkit-scrollbar-track {
  background: transparent;
}

.drj-catmenu__parents::-webkit-scrollbar-thumb {
  background-color: #d6c9b8;
  border-radius: 4px;
}

li.drj-catmenu__parent,
li.drj-catmenu__child {
  margin: 0;
}

/* Parent link — базов стил */
a.drj-catmenu__parent-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--light-beige);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--secondary-font-family);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.4;
  color: var(--heading-color);
  text-decoration: none;
  text-transform: none;
  transition:
    background 180ms ease,
    color 180ms ease;
}

.drj-catmenu__parent-link:hover,
.drj-catmenu__parent-link:focus-visible {
  background: #f0e7da;
  color: var(--heading-color, #2b2b2b);
  outline: none;
}

.drj-catmenu__parent-link:focus-visible {
  outline: 2px solid var(--heading-color, #2b2b2b);
  outline-offset: 2px;
}

/* Active parent */
.drj-catmenu__parent.is-active .drj-catmenu__parent-link {
  background: #f0e7da;
  color: var(--heading-color, #2b2b2b);
}

/* Icon */
.drj-catmenu__parent-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: opacity 180ms ease;
}

.drj-catmenu__parent.is-active .drj-catmenu__parent-icon,
.drj-catmenu__parent-link:hover .drj-catmenu__parent-icon {
  opacity: 1;
}

.drj-catmenu__parent-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

/* Label */
.drj-catmenu__parent-label {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Arrow — var(--arrow-up-right) */
.drj-catmenu__parent-arrow {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  background-image: var(--arrow-up-right);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  opacity: 0;
  transform: translate(0, 0);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.drj-catmenu__parent.is-active .drj-catmenu__parent-arrow,
.drj-catmenu__parent-link:hover .drj-catmenu__parent-arrow {
  opacity: 0.6;
}

/* ── Дясна колона ── */
.drj-catmenu__children {
  flex: 1;
  min-width: 0;
}

.drj-catmenu__panel {
  display: none;
}

.drj-catmenu__panel.is-active {
  display: block;
}

/* Child list */
.drj-catmenu__children-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Auto 2-col ако 9+ деца */
.drj-catmenu__children-list:has(> .drj-catmenu__child:nth-child(9)) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
  row-gap: 0;
}

/* Child links */
.drj-catmenu__child-link,
.drj-catmenu__browse-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--secondary-font-family, sans-serif);
  font-weight: 400;
  font-size: 15px;
  padding: 10px 4px;
  line-height: 1.4;
  color: var(--heading-color, #2b2b2b);
  text-decoration: none;
  border-bottom: 1px solid var(--light-beige, #faf5ee);
  transition:
    color 180ms ease,
    padding-left 180ms ease;
}

.drj-catmenu__child:last-child .drj-catmenu__child-link {
  border-bottom: none;
}

.drj-catmenu__child-link::before,
.drj-catmenu__browse-link::before {
  content: '›';
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  opacity: 0.4;
  transform: translateY(-1px);
  transition: opacity 180ms ease;
}

.drj-catmenu__child-link:hover,
.drj-catmenu__child-link:focus-visible,
.drj-catmenu__browse-link:hover,
.drj-catmenu__browse-link:focus-visible {
  color: var(--heading-color, #2b2b2b);
  padding-left: 6px;
  outline: none;
}

.drj-catmenu__child-link:hover::before,
.drj-catmenu__child-link:focus-visible::before,
.drj-catmenu__browse-link:hover::before {
  opacity: 1;
}
