/* "خدماتنا" dropdown (dropdown.js). Selectors are specific on purpose,
   so the header's own link styles and animations don't apply to the dropdown links. */
.chev { transition: transform .3s; }
.dd-trigger.dd-open .chev { transform: translateY(1px) rotate(225deg); }
.dd-trigger { -webkit-tap-highlight-color: transparent; }

.nav .menu .dd-panel a { padding: 0; opacity: 1; translate: none; animation: none !important; white-space: normal; }
.nav .menu .dd-panel a::after { display: none; }
.dd-panel ul { list-style: none; }

.dd-box { padding: 12px; border-radius: 22px; background: #230b3c; border: 1px solid rgba(205, 155, 250, .32); box-shadow: 0 30px 60px rgba(8, 0, 18, .6), 0 0 40px rgba(150, 60, 230, .22); }
.dd-box ul { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.nav .menu .dd-panel a.dd-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 15px; border: 1px solid transparent; transition: background .25s, border-color .25s; }
.nav .menu .dd-panel a.dd-item:hover, .nav .menu .dd-panel a.dd-item:focus-visible { background: rgba(160, 80, 232, .22); border-color: rgba(205, 155, 250, .35); }
.nav .menu .dd-panel a.dd-item.current { background: linear-gradient(90deg, rgba(100, 26, 166, .75), rgba(165, 47, 208, .55)); border-color: #c97bff; }
.dd-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: #fff; background: linear-gradient(140deg, #9b4fe0, #4d1285); transition: rotate .3s, scale .3s; }
.dd-item:hover .dd-icon { rotate: -8deg; scale: 1.07; }
.dd-icon svg { width: 25px; height: 25px; }
.dd-text { display: flex; flex-direction: column; min-width: 0; text-align: right; }
.dd-text b { font-size: 13px; font-weight: 600; line-height: 1.8; color: #fff; }
.dd-text small { font-size: 11px; font-weight: 300; line-height: 1.8; color: #d3bdec; }
.nav .menu .dd-panel a.dd-all { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; padding: 11px; border-radius: 13px; font-size: 12.5px; font-weight: 600; color: #e6c8ff; background: rgba(255, 255, 255, .06); transition: background .25s; }
.nav .menu .dd-panel a.dd-all:hover { background: rgba(160, 80, 232, .3); }
.dd-all svg { width: 16px; height: 16px; }

@media (min-width: 900px) {
  .dd-panel { position: absolute; z-index: 40; top: calc(100% + 20px); left: 0; width: 540px; visibility: hidden; opacity: 0; translate: 0 -12px; transition: opacity .25s, translate .3s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s; }
  .dd-panel.open { visibility: visible; opacity: 1; translate: 0 0; transition: opacity .25s, translate .35s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
  /* Invisible strip that joins the link to the panel, so the mouse can cross the gap */
  .dd-panel::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 34px; }
  .dd-panel::after { content: ""; position: absolute; top: -7px; left: var(--arrow, 50%); width: 13px; height: 13px; margin-left: -7px; background: #230b3c; border: solid rgba(205, 155, 250, .32); border-width: 1px 0 0 1px; transform: rotate(45deg); }
  .anim .dd-panel.open li { animation: dd-item .4s cubic-bezier(.2, .8, .2, 1) calc(var(--i) * .04s) backwards; }
}
@keyframes dd-item { from { opacity: 0; translate: 0 10px; } }

@media (max-width: 899px) {
  /* The whole phone menu scrolls if the expanded list is taller than the screen */
  /* The floating WhatsApp button steps aside while the phone menu is open */
  body:has(.menu.open) .whatsapp { visibility: hidden; opacity: 0; }
  .menu.has-dropdown { max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); overflow-y: auto; overscroll-behavior: contain; }
  /* Expands and collapses by animating the row height */
  .dd-panel { display: grid; grid-template-rows: 0fr; flex: none; visibility: hidden; opacity: 0; transition: grid-template-rows .4s cubic-bezier(.4, 0, .2, 1), opacity .25s, visibility 0s .4s; }
  .dd-panel.open { grid-template-rows: 1fr; visibility: visible; opacity: 1; transition: grid-template-rows .45s cubic-bezier(.2, .8, .2, 1), opacity .35s .05s, visibility 0s; }
  .dd-clip { min-height: 0; overflow: hidden; }
  .dd-box { margin: 0 0 6px; padding: 8px; border-radius: 16px; box-shadow: none; background: rgba(255, 255, 255, .05); }
  .dd-box ul { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .nav .menu .dd-panel a.dd-item { padding: 8px 9px; }
  .dd-icon { width: 38px; height: 38px; border-radius: 11px; }
  .dd-icon svg { width: 21px; height: 21px; }
}
