/* ── Nystio Menu v3 — premium services dropdown ── */
:root {
  --ny-navy: #0b2c4a;
  --ny-ink: #0a0a0a;
  --ny-accent: #ff641e;
  --ny-muted: #637083;
  --ny-border: #e8e8e8;
  --ny-separator: #ececec;
  --ny-icon-bg: #f7f7f7;
  --ny-active-bg: #fff3ec;
  --ny-hover-bg: #fff8f4;
  --ny-radius: 14px;
  --ny-card-radius: 17px;
  --ny-font: Montserrat, Helvetica, Arial, Lucida, sans-serif;
  --ny-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ny-h: 44px;
}

/* Reset conteneur Divi */
.dvmm_mad_menu,
.dvmm_mad_menu .et_pb_module_inner,
.dvmm_mad_menu_0_tb_header,
.dvmm_mad_menu_0_tb_header .et_pb_module_inner {
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.et_pb_row_0_tb_header {
  display: flex !important;
  align-items: center !important;
  min-height: 72px;
  overflow: visible !important;
}

.et_pb_section_0_tb_header {
  overflow: visible !important;
  z-index: 1000;
}

.et_pb_column_1_tb_header {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  align-self: center !important;
}

.et_pb_image_0_tb_header {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  display: flex !important;
  align-items: center !important;
}

.et_pb_image_0_tb_header .et_pb_image_wrap {
  line-height: 0;
}

/* ── Nav shell ── */
.nystio-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  width: 100%;
  min-height: var(--ny-h);
  font-family: var(--ny-font);
  box-sizing: border-box;
}

.nystio-nav ul,
.nystio-nav li {
  list-style: none !important;
  margin: 0;
  padding: 0 !important;
}

@media (min-width: 981px) {
  .et-l--header .nystio-nav ul,
  .nystio-nav .nystio-nav__list,
  .nystio-nav .nystio-nav__sub,
  .nystio-nav .nystio-services-card {
    list-style: none !important;
    padding: 0 !important;
    line-height: 1 !important;
  }
}

.nystio-nav li::marker,
.nystio-nav li::before {
  content: none !important;
  display: none !important;
}

.nystio-nav__panel {
  flex: 0 1 auto;
}

.nystio-nav__list {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.nystio-nav__item {
  position: relative;
  margin: 0;
  flex-shrink: 0;
}

.nystio-nav__item--parent {
  display: flex;
  align-items: center;
  position: relative;
}

/* ── Liens principaux ── */
.nystio-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--ny-h);
  padding: 0 16px;
  color: var(--ny-ink) !important;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
  border-radius: 12px;
  transition: color 0.2s var(--ny-ease), background 0.2s var(--ny-ease);
}

.nystio-nav__link:hover {
  color: var(--ny-accent) !important;
  background: rgba(255, 100, 30, 0.06);
}

.nystio-nav__item.current-menu-item > .nystio-nav__link,
.nystio-nav__item.current-menu-parent > .nystio-nav__link,
.nystio-nav__item.current-menu-ancestor > .nystio-nav__link {
  color: var(--ny-accent) !important;
}

.nystio-nav__chevron {
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s var(--ny-ease);
}

.nystio-nav__item--services.is-services-open > .nystio-nav__link--services,
.nystio-nav__item--services.is-services-open > .nystio-nav__link--services:hover {
  background: var(--ny-active-bg) !important;
  color: var(--ny-accent) !important;
}

.nystio-nav__item--services.is-services-open > .nystio-nav__link--services .nystio-nav__chevron {
  transform: rotate(180deg);
}

.nystio-nav__sub-toggle {
  display: none;
}

/* ── Carte services premium (desktop) ── */
@media (min-width: 981px) {
  .nystio-services-card {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    z-index: 10050;
    width: 460px;
    max-width: min(460px, 92vw);
    margin: 0;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid var(--ny-border);
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-40%) translateY(6px);
    transition: opacity 0.22s var(--ny-ease), transform 0.22s var(--ny-ease), visibility 0.22s;
  }

  /* Pont invisible trigger → carte */
  .nystio-services-card::after {
    content: "";
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
  }

  /* Triangle pointeur */
  .nystio-services-card::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 42%;
    width: 14px;
    height: 14px;
    background: #fff;
    border-top: 1px solid var(--ny-border);
    border-left: 1px solid var(--ny-border);
    transform: rotate(45deg);
  }

  .nystio-nav__item--services.is-services-open > .nystio-services-card {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-40%) translateY(0);
  }

  .nystio-service {
    margin: 0;
  }

  .nystio-service + .nystio-service .nystio-service__item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 52px;
    right: 6px;
    height: 1px;
    background: var(--ny-separator);
  }

  .nystio-service + .nystio-service .nystio-service__item {
    border-top: 0;
  }

  .nystio-service__link {
    display: block;
    height: auto !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    white-space: normal !important;
  }

  .nystio-service__link:hover {
    background: transparent !important;
  }

  .nystio-service__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 8px;
    margin: 0 2px;
    border-radius: 10px;
    transition: background 0.2s ease, transform 0.2s ease;
  }

  .nystio-service__link:hover .nystio-service__item {
    background: var(--ny-hover-bg);
    transform: translateX(2px);
  }

  .nystio-service__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ny-icon-bg);
    transition: transform 0.2s ease;
  }

  .nystio-service__icon img,
  .nystio-service__img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
  }

  .nystio-service__link:hover .nystio-service__icon {
    transform: scale(1.04);
  }

  .nystio-service__content {
    flex: 1;
    min-width: 0;
    padding: 1px 0;
  }

  .nystio-service__title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--ny-navy);
    line-height: 1.3;
    transition: color 0.2s ease;
  }

  .nystio-service__link:hover .nystio-service__title {
    color: var(--ny-accent);
  }

  .nystio-service__desc {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    font-weight: 400;
    color: var(--ny-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .nystio-service.current-menu-item .nystio-service__title {
    color: var(--ny-accent);
  }
}

/* ── Bouton Contact ── */
.nystio-nav__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  height: var(--ny-h);
  padding: 0 20px;
  border-radius: var(--ny-radius);
  background: var(--ny-accent);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: 0 2px 14px rgba(255, 100, 30, 0.32);
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.nystio-nav__cta:hover {
  color: #fff !important;
  filter: brightness(1.05);
  box-shadow: 0 4px 18px rgba(255, 100, 30, 0.38);
}

.nystio-nav__cta-icon {
  display: flex;
  flex-shrink: 0;
  opacity: 0.95;
}

.nystio-nav__cta-icon svg {
  display: block;
}

/* ── Hamburger ── */
.nystio-nav__toggle {
  display: none;
  align-items: center;
  gap: 8px;
  height: var(--ny-h);
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ny-ink);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.nystio-nav__toggle:hover {
  background: rgba(10, 10, 10, 0.05);
}

.nystio-nav__toggle-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 20px;
  height: 16px;
}

.nystio-nav__toggle-icon span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ny-ink);
  border-radius: 2px;
  transition: transform 0.25s var(--ny-ease), opacity 0.2s;
}

.nystio-nav.is-open .nystio-nav__toggle-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nystio-nav.is-open .nystio-nav__toggle-icon span:nth-child(2) {
  opacity: 0;
}

.nystio-nav.is-open .nystio-nav__toggle-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile / tablette ── */
@media (max-width: 980px) {
  .nystio-nav {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "toggle cta"
      "panel panel";
    align-items: center;
    gap: 0;
    min-height: auto;
  }

  .nystio-nav__toggle {
    display: inline-flex;
    grid-area: toggle;
    justify-self: start;
  }

  .nystio-nav__cta {
    grid-area: cta;
    justify-self: end;
    height: var(--ny-h);
    padding: 0 14px;
    font-size: 13px;
  }

  .nystio-nav__panel {
    grid-area: panel;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s var(--ny-ease), opacity 0.25s ease, margin 0.25s ease;
  }

  .nystio-nav.is-open .nystio-nav__panel {
    opacity: 1;
    margin-top: 8px;
    overflow: visible;
  }

  .nystio-nav__list {
    flex-direction: column;
    align-items: stretch;
    border-top: 1px solid var(--ny-border);
  }

  .nystio-nav__item {
    border-bottom: 1px solid var(--ny-border);
  }

  .nystio-nav__link {
    height: auto;
    padding: 15px 4px;
    white-space: normal;
    font-size: 15px;
    border-radius: 0;
  }

  .nystio-nav__link:hover {
    background: transparent;
  }

  .nystio-nav__chevron {
    display: none;
  }

  .nystio-nav__item--parent {
    display: grid;
    grid-template-columns: 1fr 48px;
    grid-template-rows: auto auto;
  }

  .nystio-nav__item--parent > .nystio-nav__link {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  .nystio-nav__sub-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 2;
    grid-row: 1;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--ny-border);
    background: transparent;
    cursor: pointer;
    color: var(--ny-ink);
  }

  .nystio-nav__sub-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.35s var(--ny-ease);
  }

  .nystio-nav__item--parent.is-open > .nystio-nav__sub-toggle {
    color: var(--ny-accent);
    background: rgba(255, 100, 30, 0.06);
  }

  .nystio-nav__item--parent.is-open > .nystio-nav__sub-toggle svg {
    transform: rotate(180deg);
  }

  .nystio-services-card {
    grid-column: 1 / -1;
    grid-row: 2;
    position: static;
    width: 100%;
    max-width: none;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    background: rgba(255, 100, 30, 0.04);
    transition: max-height 0.4s var(--ny-ease);
  }

  .nystio-services-card::before,
  .nystio-services-card::after {
    display: none;
  }

  .nystio-nav__item--parent.is-open > .nystio-services-card {
    overflow: visible;
  }

  .nystio-service__link {
    display: block;
    height: auto !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  .nystio-service__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px 13px 20px;
    border-top: 1px solid var(--ny-separator);
    transition: background 0.2s ease;
  }

  .nystio-service:first-child .nystio-service__item {
    border-top: 0;
  }

  .nystio-service__link:hover .nystio-service__item,
  .nystio-service__link:active .nystio-service__item {
    background: rgba(255, 100, 30, 0.07);
    transform: none;
  }

  .nystio-service__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ny-icon-bg);
  }

  .nystio-service__icon img,
  .nystio-service__img {
    display: block;
    width: 22px;
    height: 22px;
    object-fit: contain;
  }

  .nystio-service__desc {
    display: none !important;
  }

  .nystio-service__title {
    font-size: 14px;
    font-weight: 500;
    color: var(--ny-muted);
    line-height: 1.3;
  }

  .nystio-service__link:hover .nystio-service__title,
  .nystio-service.current-menu-item .nystio-service__title {
    color: var(--ny-accent);
  }

  .nystio-service__item {
    border-left: 3px solid transparent;
  }

  .nystio-service__link:hover .nystio-service__item,
  .nystio-service.current-menu-item .nystio-service__item {
    border-left-color: var(--ny-accent);
  }
}
