/*
 * Phone and tablet menu (inc/mobile-menu.php, js/mobile-menu.js): a white drawer from the left,
 * where the burger is. The header's language: Neue Haas Unica, ink and gold, hairlines, 1.5px line
 * icons, porcelain tiles. The catalogue groups open one level deeper, sliding in from the right;
 * the root slides a little to the left behind them.
 */

.ags-nav {
  --ink: #201600;
  --text: #565049;
  --muted: #6F6A63;
  --pale: #A8A196;
  --gold: #C49564;
  --gold-dark: #A97B4B;
  --line: #E3DED6;
  --tile: #F4F6F5;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: 24px;
  position: fixed;
  inset: 0;
  z-index: 100000;
  color: var(--ink);
  font-family: "Neue Haas Unica", sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.ags-nav[hidden] {
  display: none;
}

/* Scroll lock; the scrollbar's width stays as padding so the page does not shift. */
body.ags-nav-open {
  overflow: hidden;
  padding-right: var(--ags-scrollbar, 0px);
}

.ags-nav a {
  color: inherit;
  text-decoration: none;
}

/* Buttons start bare; the rules that style one are written ".ags-nav .x" to outweigh this. */
.ags-nav button {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-transform: none;
  cursor: pointer;
}

.ags-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ags-nav li {
  margin: 0;
  padding: 0;
}

.ags-nav h2,
.ags-nav p {
  margin: 0;
  padding: 0;
}

.ags-nav :focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.ags-nav__svg {
  display: block;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
}

.ags-nav__overlay {
  position: absolute;
  inset: 0;
  background: rgba(32, 22, 0, 0.4);
  opacity: 0;
  transition: opacity var(--ags-close, 0.3s) var(--ags-ease-close, ease);
}

.ags-nav__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  background: #fff;
  box-shadow: 12px 0 40px rgba(32, 22, 0, 0.08);
  outline: 0;
  transform: translateX(-100%);
  transition: transform var(--ags-close, 0.3s) var(--ags-ease-close, ease);
}

/* Motion tokens in css/pages.css: the backdrop and the panel move together, both ways. */
.ags-nav.is-open .ags-nav__overlay {
  opacity: 1;
  transition: opacity var(--ags-open, 0.45s) var(--ags-ease, ease-out);
}

.ags-nav.is-open .ags-nav__panel {
  transform: none;
  transition: transform var(--ags-open, 0.45s) var(--ags-ease, ease-out);
}

/* Top bar: the header's 64px row, with the cross where the burger was. */

.ags-nav__top {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: 64px;
  padding: 0 12px 0 2px;
  border-bottom: 1px solid var(--line);
}

.ags-nav .ags-nav__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink);
}

.ags-nav__logo {
  justify-self: center;
  width: 124px;
}

.ags-nav__logo img {
  display: block;
  width: 100%;
  height: auto;
}

/* The two views share the space under the top bar. */

.ags-nav__views {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
}

.ags-nav__view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 20px var(--pad) calc(var(--pad) + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transition: transform var(--ags-open, 0.45s) var(--ags-ease, ease-out), opacity var(--ags-open, 0.45s) var(--ags-ease, ease-out), visibility 0s;
}

.ags-nav__view--sub {
  padding-top: 0;
  transform: translateX(100%);
  visibility: hidden;
  transition-delay: 0s, 0s, var(--ags-open, 0.45s);
}

.ags-nav.is-deep .ags-nav__view--root {
  opacity: 0;
  transform: translateX(-24%);
  visibility: hidden;
  transition-delay: 0s, 0s, var(--ags-open, 0.45s);
}

.ags-nav.is-deep .ags-nav__view--sub {
  transform: none;
  visibility: visible;
  transition-delay: 0s;
}

/*
 * Root: search. A copy of the search dialog's field (css/search.css): the same height, hairline,
 * corners, lens and placeholder, so that a tap turns one into the other (js/search.js).
 * The stand-in input under it only holds the keyboard on iOS while that happens.
 */

.ags-nav__search-wrap {
  position: relative;
  flex: 0 0 auto;
  --field: 52px;
}

.ags-nav .ags-nav__search {
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--field);
  padding: 0 8px 0 6px;
  border: 1px solid rgba(144, 150, 154, 0.4);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s;
}

.ags-nav__search-lens {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--ink);
}

.ags-nav__search-lens .ags-search-icon {
  display: block;
  width: 22px;
  height: 22px;
}

.ags-nav__search-text {
  padding: 0 10px 0 6px;
  overflow: hidden;
  color: rgba(144, 150, 154, 0.8);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.ags-nav .ags-nav__stand-in {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
  pointer-events: none;
}

@media (min-width: 768px) {
  .ags-nav__search-wrap {
    --field: 60px;
  }

  .ags-nav .ags-nav__search {
    padding-left: 10px;
  }

  .ags-nav__search-text {
    font-size: 22px;
  }
}

/* Handing over to the search dialog: the drawer's content clears under it, the field is already its. */
.ags-nav.is-leaving .ags-nav__top,
.ags-nav.is-leaving .ags-nav__views {
  opacity: 0;
  transition: opacity var(--ags-pop-close, 0.2s) var(--ags-ease-close, ease);
}

.ags-nav.is-leaving .ags-nav__search {
  visibility: hidden;
}

/* Section titles */

.ags-nav .ags-nav__eyebrow {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ags-nav__section {
  margin-top: 30px;
}

/* Picture tiles */

.ags-nav__tile {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--tile);
}

.ags-nav__tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
}

.ags-nav__tile img.is-photo {
  object-fit: cover;
}

.ags-nav__tile img.is-product {
  object-fit: contain;
  mix-blend-mode: multiply;
  transform: scale(1.12);
}

/* Root: catalogue groups */

.ags-nav__groups li {
  border-bottom: 1px solid var(--line);
}

.ags-nav .ags-nav__group {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 12px 0;
}

.ags-nav__group-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ags-nav__group-name {
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.ags-nav__group-count {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.ags-nav__group .ags-nav__svg {
  width: 20px;
  height: 20px;
  color: var(--pale);
  transition: transform 0.3s var(--ease), color 0.3s;
}

.ags-nav__group:active .ags-nav__svg {
  color: var(--gold-dark);
  transform: translateX(3px);
}

/* "Всі продукти", "Дивитись усе": gold-dark tracked capitals with an arrow. */

.ags-nav .ags-nav__more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--gold-dark);
  font-size: 12px;
  line-height: 20px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ags-nav__more .ags-nav__svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s var(--ease);
}

.ags-nav__more:active .ags-nav__svg {
  transform: translateX(4px);
}

/* Root: main links */

.ags-nav .ags-nav__links {
  margin-top: 30px;
  border-top: 1px solid var(--line);
}

.ags-nav__links li {
  border-bottom: 1px solid var(--line);
}

.ags-nav .ags-nav__links a {
  display: block;
  padding: 17px 0;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ags-nav .ags-nav__links a[aria-current="page"],
.ags-nav .ags-nav__info a[aria-current="page"],
.ags-nav .ags-nav__index a[aria-current="page"] .ags-nav__item-name {
  color: var(--gold-dark);
}

/* Root: information, two columns of small links */

.ags-nav .ags-nav__info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 20px;
  margin-top: 6px;
}

.ags-nav .ags-nav__info a {
  display: block;
  padding: 7px 0;
  color: var(--text);
  font-size: 15px;
  line-height: 20px;
}

/* Root: help strip at the end, porcelain to the drawer's edges */

.ags-nav__foot {
  margin: auto calc(-1 * var(--pad)) calc(-1 * var(--pad) - env(safe-area-inset-bottom));
  padding: 24px var(--pad) calc(var(--pad) + env(safe-area-inset-bottom));
  background: var(--tile);
}

/* The strip sits at the bottom of a short menu and 36px under the last block of a long one. */
.ags-nav__view--root > :nth-last-child(2) {
  margin-bottom: 36px;
}

.ags-nav .ags-nav__phone {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 16px;
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.ags-nav__phone .ags-nav__svg {
  width: 22px;
  height: 22px;
  color: var(--gold-dark);
}

.ags-nav .ags-nav__callback {
  display: block;
  width: 100%;
  height: 52px;
  border-radius: 8px;
  background: var(--gold);
  color: #fff;
  font-size: 13px;
  line-height: 52px;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  transition: background-color 0.2s;
}

.ags-nav .ags-nav__callback:active {
  background: var(--gold-dark);
}

/* Deeper view: back, group tabs, the index */

.ags-nav .ags-nav__back {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  height: 52px;
  margin-left: -8px;
  padding-right: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ags-nav__back .ags-nav__svg {
  width: 20px;
  height: 20px;
}

.ags-nav__tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 24px;
  margin: 0 calc(-1 * var(--pad));
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
  scroll-padding: 0 var(--pad);
}

.ags-nav .ags-nav__tab {
  position: relative;
  flex: 0 0 auto;
  padding: 4px 0 14px;
  color: var(--pale);
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: color 0.3s;
}

.ags-nav__tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.ags-nav .ags-nav__tab[aria-selected="true"] {
  color: var(--ink);
}

.ags-nav__tab[aria-selected="true"]::after {
  transform: none;
}

.ags-nav__tab:focus-visible {
  outline-offset: -2px;
}

.ags-nav__index {
  padding-top: 8px;
}

.ags-nav__index li {
  border-bottom: 1px solid var(--line);
}

.ags-nav .ags-nav__index li a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}

.ags-nav__index .ags-nav__tile {
  width: 52px;
  height: 52px;
}

.ags-nav__item-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ags-nav__step {
  color: var(--gold-dark);
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ags-nav__item-name {
  font-size: 17px;
  line-height: 1.25;
  transition: color 0.2s;
}

.ags-nav__index a:active .ags-nav__item-name {
  color: var(--gold-dark);
}

.ags-nav__item-count {
  flex: 0 0 auto;
  color: var(--pale);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/*
 * Entrance: the rows rise a few pixels one after another when the drawer opens
 * and when a group is shown (js/mobile-menu.js sets --i and restarts .is-entering).
 */
.ags-nav.is-open .ags-nav__view--root > *,
.ags-nav__index.is-entering li,
.ags-nav__index.is-entering .ags-nav__more {
  animation: ags-nav-rise 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 35ms + 60ms);
}

@keyframes ags-nav-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (hover: hover) {
  .ags-nav__icon:hover {
    background: var(--tile);
  }

  .ags-nav .ags-nav__search:hover {
    border-color: var(--ink);
  }

  .ags-nav__group:hover .ags-nav__svg {
    color: var(--gold-dark);
    transform: translateX(3px);
  }

  .ags-nav .ags-nav__links a:hover,
  .ags-nav .ags-nav__info a:hover,
  .ags-nav__index a:hover .ags-nav__item-name,
  .ags-nav .ags-nav__back:hover {
    color: var(--gold-dark);
  }

  .ags-nav__more:hover .ags-nav__svg {
    transform: translateX(4px);
  }

  .ags-nav .ags-nav__tab:hover {
    color: var(--ink);
  }

  .ags-nav .ags-nav__callback:hover {
    background: var(--gold-dark);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ags-nav,
  .ags-nav * {
    transition: none !important;
    animation: none !important;
  }
}
