/* ==========================================================================
   NM DESSERTS — HEADER & MENU
   Breakpoint: 980px (pod = mobil/tablet, nad = desktop)
   ========================================================================== */

:root {
  --nm-header-h: 90px;
  --nm-header-h-mob: 72px;
  --nm-bg: #000;
  --nm-line: rgba(255, 255, 255, 0.2);
}


/* ==========================================================================
   1. HLAVIČKA
   ========================================================================== */

.nm-header {
  position: sticky;
  top: 0;
  z-index: 1000000;
  width: 100%;
  background: var(--nm-bg);
  color: #fff;
  border-bottom: 1px solid var(--nm-line);
  overflow: visible;
  transition:
    background 0.3s ease,
    backdrop-filter 0.3s ease;
}

.nm-header-inner {
  position: relative;
  z-index: 1000001;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  width: 100%;
  height: var(--nm-header-h);
  padding: 0 60px;
  box-sizing: border-box;

  overflow: visible;
}

/* Sticky stav */
header.is-sticky {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000000;

  width: 100%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header.is-sticky .nm-header {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Zruší mezeru, kterou nad sekci přidává Divi */
.et_pb_section:has(.nm-header) {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Celý Divi wrapper headeru musí být nad obsahem */
.et_pb_section:has(.nm-header),
.et_pb_row:has(.nm-header),
.et_pb_column:has(.nm-header),
.et_pb_code:has(.nm-header) {
  position: relative;
  z-index: 1000000 !important;
}

/* Kotvy nesmí skončit pod hlavičkou */
html {
  scroll-padding-top: calc(var(--nm-header-h) + 10px);
}


/* ==========================================================================
   2. LOGO
   ========================================================================== */

.nm-logo {
  position: relative;
  z-index: 1000002;

  flex: 0 0 auto;
  text-align: center;
}

.nm-logo img {
  display: block;
  height: 42px;
  width: auto;
  transition: height 0.3s ease;
}

header.is-sticky .nm-logo img {
  height: 32px;
}


/* ==========================================================================
   3. MENU BLOKY
   ========================================================================== */

.nm-menu {
  flex: 1;
  display: flex;
}

.nm-menu-left {
  justify-content: flex-start;
}

.nm-menu-right {
  justify-content: flex-end;
}

.nm-nav {
  display: flex;
  align-items: center;
  gap: 48px;

  list-style: none;
  margin: 0;
  padding: 0 !important;
}

.nm-nav li {
  position: relative;
  list-style: none;
}

.nm-nav a {
  color: #fff;

  font-family: "Polymath Display", sans-serif;
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.02em;

  text-decoration: none;
  white-space: nowrap;

  transition: opacity 0.2s ease;
}

.nm-nav a:hover {
  opacity: 0.7;
}

/* Zvýrazněná položka "Rezervovat stůl" */
.nm-nav .nm-reservation a {
  font-family: "Mokoko", sans-serif;
  font-weight: 700;
  text-decoration: underline;
}

.nm-nav .nm-reservation a:hover {
  text-decoration: none;
  opacity: 1;
}


/* ==========================================================================
   4. DROPDOWN — desktop
   ========================================================================== */

.nm-nav .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000003;

  display: block;

  min-width: 200px;
  margin: 0;
  padding: 10px 0 !important;

  list-style: none;

  background: var(--nm-bg);
  border-top: 1px solid var(--nm-line);

  opacity: 0;
  visibility: hidden;

  transform: translateY(10px);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease;
}

.nm-nav li:hover > .sub-menu,
.nm-nav li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Neviditelný můstek */
.nm-nav > li.menu-item-has-children::after {
  content: "";

  position: absolute;
  top: 100%;
  left: 0;
  right: 0;

  height: 14px;
}

.nm-nav .sub-menu li {
  width: 100%;
  text-align: left;
}

.nm-nav .sub-menu a {
  display: block;

  padding: 8px 20px;

  font-family: "Polymath Display", sans-serif;
  font-size: 15px;
  font-weight: 400;

  white-space: normal;

  transition: background 0.2s ease;
}

.nm-nav .sub-menu a:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

/* Šipka */
.nm-nav li.menu-item-has-children > a::after {
  content: "▾";

  display: inline-block;
  margin-left: 6px;

  font-size: 10px;
  opacity: 0.8;

  transform: translateY(-1px);

  transition: transform 0.25s ease;
}

.nm-nav > li.menu-item-has-children > a[href="#"] {
  cursor: default;
}


/* ==========================================================================
   5. HAMBURGER
   ========================================================================== */

.nm-burger {
  display: none;

  position: relative;
  z-index: 1000003;

  width: 44px;
  height: 44px;
  padding: 0;

  background: transparent;
  border: 0;

  cursor: pointer;
}

.nm-burger span {
  position: absolute;
  left: 9px;

  display: block;

  width: 26px;
  height: 2px;

  background: #fff;

  transform-origin: center;

  transition:
    top 0.25s ease,
    transform 0.25s ease,
    opacity 0.25s ease;
}

.nm-burger span:first-child {
  top: 17px;
}

.nm-burger span:last-child {
  top: 25px;
}

/* Otevřeno = křížek */
.nm-burger.open span:first-child {
  top: 21px;
  transform: rotate(45deg);
}

.nm-burger.open span:last-child {
  top: 21px;
  transform: rotate(-45deg);
}


/* ==========================================================================
   6. DESKTOP
   ========================================================================== */

@media (min-width: 981px) {

  .nm-nav-panel {
    display: contents;
  }

  .nm-menu-left {
    order: 1;
  }

  .nm-logo {
    order: 2;
  }

  .nm-menu-right {
    order: 3;
  }

  .nm-burger {
    order: 4;
  }
}


/* ==========================================================================
   7. MOBIL — fullscreen menu
   ========================================================================== */

@media (max-width: 980px) {

  html {
    scroll-padding-top: calc(var(--nm-header-h-mob) + 10px);
  }

  .nm-header {
    position: sticky;
    top: 0;
    z-index: 1000000 !important;
  }

  .nm-header-inner {
    position: relative;
    z-index: 1000001;

    height: var(--nm-header-h-mob);

    padding: 0 20px;

    justify-content: space-between;
  }

  .nm-logo {
    order: 1;
    z-index: 1000003;
  }

  .nm-logo img {
    height: 34px;
  }

  header.is-sticky .nm-logo img {
    height: 30px;
  }

  .nm-burger {
    display: block;

    order: 2;

    z-index: 1000004;
  }


  /* ------------------------------------------------------------------------
     Fullscreen panel
     ------------------------------------------------------------------------ */

  .nm-nav-panel {
    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 100dvh;

    z-index: 1000002;

    display: flex;
    flex-direction: column;
    align-items: stretch;

    box-sizing: border-box;

    padding:
      calc(var(--nm-header-h-mob) + 54px)
      20px
      40px;

    background: var(--nm-bg);

    overflow-y: auto;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
      opacity 0.25s ease,
      visibility 0.25s ease;
  }

  .nm-header.nm-open .nm-nav-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }


  /* ------------------------------------------------------------------------
     Menu bloky
     ------------------------------------------------------------------------ */

  .nm-menu,
  .nm-menu-left,
  .nm-menu-right {
    flex: 0 0 auto;

    display: block;

    width: 100%;

    text-align: left;
  }

  .nm-menu-right {
    margin-top: 16px;
    padding-top: 16px;

    border-top: 1px solid var(--nm-line);
  }

  .nm-nav {
    flex-direction: column;
    align-items: stretch;

    gap: 0;

    width: 100%;
  }

  .nm-nav > li {
    width: 100%;

    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .nm-nav a {
    display: block;

    width: 100%;

    box-sizing: border-box;

    padding: 14px 0;

    font-size: 18px;

    white-space: normal;
  }


  /* ------------------------------------------------------------------------
     Mobilní submenu
     ------------------------------------------------------------------------ */

  .nm-nav .sub-menu {
    position: static;

    display: none;

    min-width: 0;

    margin: 0;

    padding: 0 0 8px 20px !important;

    background: none;
    border: 0;

    opacity: 1;
    visibility: visible;

    transform: none;

    transition: none;
  }

  /* Na dotyku hover nechceme */
  .nm-nav li:hover > .sub-menu,
  .nm-nav li:focus-within > .sub-menu {
    display: none;
  }

  .nm-nav li.nm-sub-open > .sub-menu {
    display: block;
  }

  .nm-nav .sub-menu li {
    border: 0;
  }

  .nm-nav .sub-menu a {
    padding: 11px 0;

    font-size: 16px;
  }

  .nm-nav > li.menu-item-has-children::after {
    content: none;
  }

  .nm-nav li.nm-sub-open > a::after {
    transform: translateY(-1px) rotate(180deg);
  }


  /* ------------------------------------------------------------------------
     Zamknutí stránky při otevřeném menu
     ------------------------------------------------------------------------ */

  body.nm-menu-lock {
    overflow: hidden;
  }
}


/* ==========================================================================
   8. MALÉ TELEFONY
   ========================================================================== */

@media (max-width: 400px) {

  .nm-header-inner {
    padding: 0 16px;
  }

  .nm-logo img {
    height: 30px;
  }

  .nm-nav a {
    font-size: 17px;
  }
}