/* PC „Termékeink” mega menü */
:root {
  --mgm-navy: #0d2546;
  --mgm-text: #26313d;
  --mgm-muted: #59636e;
  --mgm-green: #17744a;
  --mgm-green-strong: #12603c;
  --mgm-green-soft: #e8f5ec;
  --mgm-border: #e1e5e8;
  --mgm-side-bg: #f5f6f7;
  --mgm-media-bg: #fff;
  --mgm-radius: 10px;
}

/* Nyitógomb */
#mega-menu .btn-mega:after { display: none; }
#mega-menu .btn-mega { flex: none; }
#mega-menu .btn-mega .logo { white-space: nowrap; }
.mgm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mgm-navy);
  cursor: pointer;
  white-space: nowrap;
}
.mgm-toggle-burger { width: 26px; height: auto; }
.mgm-toggle .mgm-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 14px;
  line-height: 1.6;
  color: var(--mgm-navy);
  transition: background-color .15s ease, color .15s ease;
}
.mgm-toggle-chevron {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}
.mgm-toggle:hover .mgm-toggle-label { background: var(--medium-green); }
.mgm-toggle[aria-expanded="true"] .mgm-toggle-label { background: var(--mgm-green); color: #fff; }
.mgm-toggle[aria-expanded="true"] .mgm-toggle-chevron { transform: rotate(180deg); }
.mgm-toggle:focus-visible { outline: none; }
.mgm-toggle:focus-visible .mgm-toggle-label { outline: 3px solid var(--mgm-navy); outline-offset: 2px; }

/* Háttér és panel */
.mgm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
}
.mgm-backdrop::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: var(--mgm-top, 0px);
  background: rgba(8, 22, 36, .45);
}
.mgm-panel {
  position: fixed;
  top: var(--mgm-top, 120px);
  left: 50%;
  z-index: 10001;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  width: min(1440px, calc(100vw - 2 * var(--mgm-gutter, 28px)));
  height: var(--mgm-height, calc(100vh - 140px));
  transform: translateX(-50%);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--mgm-border);
  border-radius: var(--mgm-radius);
  box-shadow: 0 18px 48px rgba(8, 22, 36, .18);
  color: var(--mgm-text);
  font-family: 'Jost', sans-serif;
  font-size: 16px;
  line-height: 1.35;
}
.mgm-panel[hidden], .mgm-backdrop[hidden] { display: none; }
.mgm-panel :focus-visible {
  outline: 3px solid var(--mgm-green);
  outline-offset: 2px;
}
.mgm-panel svg { flex: none; }
.mgm-panel ul { margin: 0; padding: 0; list-style: none; }
.mgm-panel section { margin: 0; padding: 0; }
.mgm-panel button { font-family: inherit; }

/* Bal oszlop */
.mgm-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 26px 12px 20px;
  background: var(--mgm-side-bg);
  border-right: 1px solid var(--mgm-border);
}
.mgm-side-title {
  margin: 0 0 14px 16px;
  color: var(--mgm-navy);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}
.mgm-groups li + li { border-top: 1px solid var(--mgm-border); }
.mgm-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 8px 12px 8px 16px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--mgm-navy);
  font-size: 18px;
  text-align: left;
  cursor: pointer;
}
.mgm-group:hover { background: rgba(23, 116, 74, .06); }
.mgm-group[aria-pressed="true"] {
  background: var(--mgm-green-soft);
  color: var(--mgm-green-strong);
  font-weight: 600;
}
.mgm-group[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 2px;
  background: var(--mgm-green);
}
.mgm-group-icon { display: inline-flex; width: 36px; height: 36px; }
.mgm-group-icon svg { width: 100%; height: 100%; }
.mgm-group-label { flex: 1; }
.mgm-chevron, .mgm-search-icon, .mgm-search-clear svg, .mgm-close svg, .mgm-help-phone svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mgm-chevron { width: 18px; height: 18px; }
.mgm-all-products {
  margin: auto 0 0;
  padding: 24px 16px 4px;
  border-top: 1px solid var(--mgm-border);
  color: var(--mgm-green);
  font-size: 18px;
  font-weight: 700;
}
.mgm-groups + .mgm-all-products { margin-top: 18px; }
.mgm-all-products:hover, .mgm-all-link:hover { color: var(--mgm-green-strong); text-decoration: underline; }
.mgm-error { margin: 8px 16px; color: #a32020; }

/* Jobb oldal */
.mgm-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.mgm-top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px 8px;
}
.mgm-search {
  position: relative;
  flex: 1;
  margin: 0;
}
.mgm-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  color: var(--mgm-navy);
  pointer-events: none;
}
.mgm-search input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 52px;
  border: 1px solid #cdd3d8;
  border-radius: 6px;
  background: #fff;
  color: var(--mgm-text);
  font-size: 17px;
}
.mgm-search input::placeholder { color: #6b7480; }
.mgm-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.mgm-search input:focus { outline: none; border-color: var(--mgm-green); box-shadow: 0 0 0 3px rgba(23, 116, 74, .2); }
.mgm-search-clear, .mgm-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--mgm-navy);
  cursor: pointer;
}
.mgm-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transform: translateY(-50%);
}
.mgm-search-clear[hidden] { display: none; }
.mgm-search-clear svg { width: 18px; height: 18px; }
.mgm-close { width: 44px; height: 44px; border-radius: 50%; }
.mgm-close svg { width: 26px; height: 26px; }
.mgm-search-clear:hover, .mgm-close:hover { background: var(--mgm-side-bg); }

.mgm-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 24px 24px;
}
.mgm-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.mgm-title {
  margin: 0;
  color: var(--mgm-navy);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.15;
}
.mgm-all-link {
  color: var(--mgm-green);
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}
.mgm-help { margin: 4px 0 16px; color: var(--mgm-text); font-size: 17px; }

/* Kategóriacsempék */
.mgm-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.mgm-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--mgm-border);
  border-radius: 8px;
  background: #fff;
  color: var(--mgm-navy);
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mgm-tile:hover, .mgm-tile:focus-visible {
  border-color: var(--mgm-green);
  box-shadow: inset 0 0 0 1px var(--mgm-green);
  color: var(--mgm-navy);
}
.mgm-panel .mgm-tile:focus-visible { outline: 3px solid var(--mgm-green); outline-offset: 2px; }
.mgm-tile-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 7;
  background: var(--mgm-media-bg);
}
.mgm-tile-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 8px;
  object-fit: contain;
  background: var(--mgm-media-bg);
}
.mgm-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8e99a3;
}
.mgm-fallback svg { width: 56px; height: 56px; }
.mgm-tile-arrow {
  position: absolute;
  right: 12px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(8, 22, 36, .15);
  color: var(--mgm-green);
  font-weight: 700;
  opacity: 0;
  transition: opacity .15s ease;
}
.mgm-tile:hover .mgm-tile-arrow, .mgm-tile:focus-visible .mgm-tile-arrow { opacity: 1; }
.mgm-tile-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px 14px;
}
.mgm-tile-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}
.mgm-tile-sub { color: var(--mgm-muted); font-size: 15px; }

/* Találatok */
.mgm-count {
  margin-left: 6px;
  color: var(--mgm-muted);
  font-size: 22px;
  font-weight: 500;
}
.mgm-back {
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--mgm-green);
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.mgm-back:hover { color: var(--mgm-green-strong); text-decoration: underline; }
.mgm-result-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin-top: 16px !important;
}
.mgm-result {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--mgm-border);
  border-radius: 8px;
  color: var(--mgm-navy);
  text-decoration: none;
}
.mgm-result:hover, .mgm-result:focus-visible {
  border-color: var(--mgm-green);
  box-shadow: inset 0 0 0 1px var(--mgm-green);
  color: var(--mgm-navy);
}
.mgm-result-media {
  position: relative;
  width: 72px;
  height: 54px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--mgm-media-bg);
}
.mgm-result-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
  background: var(--mgm-media-bg);
}
.mgm-result-media .mgm-fallback svg { width: 32px; height: 32px; }
.mgm-result-name { display: block; font-size: 17px; font-weight: 700; }
.mgm-result-path { display: block; color: var(--mgm-muted); font-size: 14px; }
.mgm-empty { margin: 20px 0 0; font-size: 17px; }

/* Lábléc */
.mgm-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 14px 24px;
  border-top: 1px solid var(--mgm-border);
  font-size: 16px;
}
.mgm-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mgm-quick ul { display: flex; flex-wrap: wrap; gap: 10px; }
.mgm-chip {
  display: inline-block;
  padding: 6px 18px;
  border: 1px solid #c7ced4;
  border-radius: 999px;
  color: var(--mgm-navy);
}
.mgm-chip:hover { border-color: var(--mgm-green); color: var(--mgm-green-strong); }
.mgm-help-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding-left: 24px;
  border-left: 1px solid var(--mgm-border);
  color: var(--mgm-text);
}
.mgm-help-phone a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mgm-green);
  font-size: 18px;
  font-weight: 700;
}
.mgm-help-phone svg { width: 20px; height: 20px; }

/* Reszponzív PC */
@media (max-width: 1399.98px) {
  .mgm-panel { grid-template-columns: 272px minmax(0, 1fr); }
  .mgm-side { padding-left: 10px; padding-right: 10px; }
  .mgm-title { font-size: 32px; }
  .mgm-group { gap: 12px; font-size: 17px; min-height: 54px; padding-left: 14px; padding-right: 8px; }
  .mgm-group-icon { width: 30px; height: 30px; }
}
@media (max-width: 1299.98px) {
  .mgm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mgm-top { padding: 16px 20px 6px; }
  .mgm-scroll { padding: 6px 20px 20px; }
  .mgm-foot { padding: 12px 20px; }
}
@media (max-width: 1099.98px) {
  .mgm-panel { grid-template-columns: 252px minmax(0, 1fr); }
  .mgm-group { font-size: 16px; }
  .mgm-result-list { grid-template-columns: minmax(0, 1fr); }
  .mgm-help-phone { padding-left: 0; border-left: 0; }
}
@media (max-height: 820px) {
  .mgm-side { padding-top: 18px; }
  .mgm-side-title { font-size: 24px; margin-bottom: 8px; }
  .mgm-group { min-height: 46px; }
  .mgm-group-icon { width: 28px; height: 28px; }
  .mgm-all-products { padding-top: 16px; }
  .mgm-tile-media { aspect-ratio: 16 / 5.5; }
  .mgm-tile-body { padding: 10px 14px 12px; }
  .mgm-title { font-size: 30px; }
  .mgm-help { margin-bottom: 12px; }
}
@media (max-height: 720px) {
  .mgm-tile-media { aspect-ratio: 16 / 4.5; }
  .mgm-group { min-height: 44px; font-size: 16px; }
}
@media (max-width: 991.98px) {
  .mgm-panel, .mgm-backdrop { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .mgm-toggle-label, .mgm-toggle-chevron, .mgm-tile, .mgm-tile-arrow { transition: none; }
}
