/* ==========================================================================
   Glavni meni – acquadiparma.com stil (talas, navigacija, mega paneli, mobilni meni)
   Markup: menu.php, header.php (.ab-wave) · JS: assets/js/academie.js ("Mega meni")
   Učitava se posle academie.css.
   ========================================================================== */

:root {
  --ab-mm-accent: #ffb500;   /* boja talasa i podvlake */
  --ab-mm-line: #e5e5e5;
}

/* ---------- Talas iznad header-a ---------- */
.ab-wave {
  position: relative;
  z-index: 2;
  height: 8px;
  margin-bottom: -2px; /* talas "leži" preko gornje ivice sledećeg reda */
  background: url("../../images/wave.svg") center top / 100% 100% no-repeat;
  pointer-events: none;
}

/* ---------- Navigacija (desktop) ---------- */
.ab-nav {
  position: static;
}

.ab-nav__list {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0 52px;
  margin: 0;
  padding: 0 var(--ab-gutter);
  list-style: none;
}

.ab-nav__item {
  position: relative;
  display: flex;
}

.ab-nav__item--mega {
  position: static;
}

.ab-theme .ab-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 54px;
  padding: 0 2px;
  color: #000 !important;
  font-family: var(--ab-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none !important;
  background: none;
}

.ab-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  height: 2px;
  background: var(--ab-mm-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s var(--ab-ease);
}

.ab-nav__link:hover::after,
.ab-nav__item.is-active > .ab-nav__link::after {
  transform: scaleX(1);
}

.ab-theme .ab-nav__item--highlight .ab-nav__link {
  color: var(--ab-highlight) !important;
}

/* ---------- Mega panel ---------- */
.ab-mm {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 999;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border-top: 1px solid var(--ab-mm-line);
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.06);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.ab-mm.is-open {
  opacity: 1;
  visibility: visible;
}

.ab-mm__close {
  position: absolute;
  top: 18px;
  right: 40px;
  z-index: 2;
}

.ab-mm__inner {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 64px;
  max-width: 1520px;
  min-height: 400px;
  margin: 0 auto;
  padding: 48px 64px 56px;
}

/* Leva kolona: kategorije (tabovi) ili brzi linkovi */
.ab-mm__primary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.ab-theme .ab-mm__primary a {
  position: relative;
  color: #000 !important;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none !important;
}

.ab-mm__primary a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--ab-mm-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s var(--ab-ease);
}

.ab-mm__primary a:hover::after,
.ab-mm__primary a.is-active::after {
  transform: scaleX(1);
}

.ab-theme .ab-mm__primary .ab-mm__all {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline !important;
  text-underline-offset: 4px;
}

.ab-mm__primary .ab-mm__all::after {
  display: none;
}

/* Desno: grupe podkategorija + istaknuti proizvodi */
.ab-mm__pane {
  display: none;
}

.ab-mm__pane.is-active {
  display: flex;
  gap: 56px;
  animation: ab-mm-fade 0.25s ease;
}

@keyframes ab-mm-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ab-mm__groups {
  flex: 1 1 auto;
  min-width: 0;
  column-count: var(--ab-mm-cols, 3);
  column-gap: 48px;
}

.ab-mm__group {
  break-inside: avoid;
  margin: 0 0 26px;
}

.ab-mm__group--flow {
  break-inside: auto;
}

.ab-mm__group-title {
  margin: 0 0 12px;
  color: #000;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.ab-mm__group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ab-mm__group li {
  break-inside: avoid;
}

.ab-theme .ab-mm__group a {
  display: inline-block;
  padding: 4px 0;
  color: #000 !important;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  text-decoration: none !important;
}

.ab-theme .ab-mm__group a:hover {
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

.ab-mm__featured {
  flex: 0 0 auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 230px;
  gap: 32px;
  align-self: flex-start;
}

.ab-theme .ab-mm__card {
  display: block;
  color: #000 !important;
  text-align: center;
  text-decoration: none !important;
}

.ab-mm__card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f6f4f1;
}

.ab-mm__card-media img {
  width: 100%;
  height: 100%;
  padding: 18px;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 0.5s var(--ab-ease);
}

.ab-mm__card:hover .ab-mm__card-media img {
  transform: scale(1.04);
}

.ab-mm__card-label {
  display: block;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ab-mm__card-title {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Donja traka prednosti */
.ab-mm__benefits {
  border-top: 1px solid var(--ab-mm-line);
}

.ab-mm__benefits-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 32px;
  max-width: 1440px;
  min-height: 100px;
  margin: 0 auto;
  padding: 0 64px;
}

.ab-mm__benefit {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ab-mm__benefit svg {
  flex: 0 0 auto;
  color: var(--ab-mm-accent);
}

.ab-mm__benefit p {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.ab-mm__benefit span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 1399.98px) {
  .ab-nav__list {
    gap: 0 36px;
  }

  .ab-mm__inner {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 40px;
    padding: 40px 40px 48px;
  }

  .ab-mm__pane.is-active {
    gap: 40px;
  }

  .ab-mm__groups {
    column-gap: 32px;
  }

  .ab-mm__featured {
    grid-auto-columns: 190px;
    gap: 24px;
  }
}

@media (max-width: 1199.98px) {
  .ab-nav__list {
    gap: 0 26px;
  }

  .ab-mm__groups {
    column-count: min(var(--ab-mm-cols, 3), 3);
  }

  .ab-mm__featured--2 .ab-mm__card:nth-child(2) {
    display: none;
  }
}

/* ---------- Mobilni meni (preko celog ekrana) ---------- */
.ab-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #fff;
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 0.35s var(--ab-ease), visibility 0.35s;
  overflow: hidden;
}

.ab-drawer.is-open {
  transform: none;
  visibility: visible;
}

.ab-drawer__head {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: 64px;
  padding: 0 12px 0 20px;
  border-bottom: 1px solid #f0f0f0;
}

.ab-drawer__x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid #000;
  background: none;
  color: #000;
  cursor: pointer;
}

.ab-drawer__x svg {
  width: 18px;
  height: 18px;
}

.ab-drawer__logo {
  justify-self: center;
  line-height: 0;
}

.ab-drawer__logo img {
  width: auto;
  height: 36px;
}

.ab-drawer__head .ab-icon-btn {
  justify-self: end;
}

.ab-drawer__list {
  flex: 1 1 auto;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ab-theme .ab-drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 64px;
  padding: 0 28px;
  border: 0;
  border-bottom: 1px solid #f0f0f0;
  background: none;
  color: #000 !important;
  font-family: var(--ab-font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: left;
  text-transform: uppercase;
  text-decoration: none !important;
  cursor: pointer;
}

.ab-drawer__link svg {
  flex: 0 0 auto;
}

.ab-theme .ab-drawer__link--highlight {
  color: var(--ab-highlight) !important;
}

.ab-drawer__foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--ab-mm-line);
  font-size: 14px;
  font-weight: 600;
}

.ab-theme .ab-drawer__foot a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 12px;
  color: #000 !important;
  text-decoration: none !important;
}

.ab-drawer__foot a + a {
  border-left: 1px solid var(--ab-mm-line);
}

.ab-theme .ab-drawer__foot .ab-drawer__foot-wide {
  grid-column: 1 / -1;
  border-left: 0;
  border-top: 1px solid var(--ab-mm-line);
  background: #fff8e6;
}

/* Podmeni kategorije */
.ab-drawer__sub {
  position: absolute;
  inset: 64px 0 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  background: #fff;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s var(--ab-ease), visibility 0.3s;
}

.ab-drawer__sub.is-open {
  transform: none;
  visibility: visible;
}

.ab-drawer__back {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 0 28px;
  border: 0;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
  color: #000;
  font-family: var(--ab-font);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.ab-drawer__sub-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-bottom: 32px;
}

.ab-theme .ab-drawer__all {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 28px;
  border-bottom: 1px solid #f0f0f0;
  color: #000 !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none !important;
}

.ab-drawer__all svg {
  color: var(--ab-mm-accent);
}

.ab-drawer__acc {
  border-bottom: 1px solid #f0f0f0;
}

.ab-drawer__acc-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  background: none;
  color: #000;
  font-family: var(--ab-font);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.ab-drawer__acc-btn svg {
  transition: transform 0.25s;
}

.ab-drawer__acc.is-open .ab-drawer__acc-btn svg {
  transform: rotate(45deg);
}

.ab-drawer__links {
  margin: 0;
  padding: 4px 28px 18px;
  list-style: none;
}

.ab-drawer__sub-body > .ab-drawer__links {
  padding-top: 12px;
}

.ab-theme .ab-drawer__links a {
  display: block;
  padding: 9px 0;
  color: #000 !important;
  font-size: 15px;
  text-decoration: none !important;
}

@media (min-width: 992px) {
  .ab-drawer {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .ab-mm {
    display: none;
  }

  .ab-wave {
    height: 6px;
  }
}
