* { box-sizing: border-box; }

.site-header {
    position: absolute;
    z-index: 50;
    top: 24px;
    left: 5.55%;
    display: grid;
    width: 88.9%;
    grid-template-columns: minmax(170px, 236px) 1fr auto;
    align-items: center;
    gap: 24px;
    font-family: inherit;
    animation: header-in 560ms 250ms both cubic-bezier(.22, 1, .36, 1);
}

.brand-link,
.brand-logo { display: block; width: 100%; }
.brand-logo { height: auto; }

.main-nav { display: flex; align-items: center; justify-content: center; gap: clamp(16px, 2vw, 32px); white-space: nowrap; }
.nav-item { position: relative; }
.nav-link { display: inline-flex; align-items: center; gap: 8px; padding: 18px 0; color: rgb(255 255 255 / 94%); font-size: clamp(13px, 1vw, 16px); text-decoration: none; transition: color 180ms ease; }
.nav-link:hover, .nav-link:focus-visible, .nav-item.is-open > .nav-link { color: #e8e42e; outline: none; }
.chevron { width: 7px; height: 7px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 180ms ease; }
.nav-item.is-open .chevron { transform: translateY(3px) rotate(225deg); }

.sub-menu { position: absolute; top: calc(100% + 4px); left: 50%; display: grid; min-width: 330px; grid-template-columns: repeat(2, minmax(145px, 1fr)); gap: 12px; border-radius: 28px; background: #fff; padding: 16px; box-shadow: 0 16px 35px rgb(0 0 0 / 25%); opacity: 0; pointer-events: none; transform: translate(-50%, -10px) scale(.985); transition: opacity 190ms ease, transform 260ms cubic-bezier(.22, 1, .36, 1); }
.nav-item.is-open .sub-menu { opacity: 1; pointer-events: auto; transform: translate(-50%, 0) scale(1); }
.sub-menu a { display: grid; min-height: 72px; align-content: center; border-radius: 18px; background: #f4f4f4; padding: 14px 18px; color: #4b4744; font-size: 14px; text-decoration: none; transition: background 180ms ease, color 180ms ease; }
.sub-menu a:hover, .sub-menu a:focus-visible { background: #9f001a; color: #fff; outline: none; }
.sub-menu a strong { font-size: 14px; font-weight: 700; line-height: 1.5; }
.sub-menu a span { margin-top: 4px; color: #746c64; font-size: 12px; line-height: 1.55; transition: color 180ms ease; }
.sub-menu a:hover span, .sub-menu a:focus-visible span { color: rgb(255 255 255 / 80%); }

.header-actions { display: flex; align-items: center; gap: 16px; }
.language-switch { position: relative; display: grid; width: 92px; height: 50px; grid-template-columns: 1fr 1fr; align-items: center; border: 1.5px solid rgb(255 255 255 / 28%); border-radius: 30px; background: rgb(255 255 255 / 22%); padding: 4px; }
.language-switch a { position: relative; z-index: 2; display: grid; height: 40px; place-items: center; color: rgb(255 255 255 / 78%); font-size: 14px; text-decoration: none; }
.language-switch a[aria-current="true"] { color: #1f302a; }
.language-slider { position: absolute; z-index: 1; top: 4px; left: 4px; width: 40px; height: 40px; border-radius: 50%; background: #fff; transition: transform 270ms cubic-bezier(.22, 1, .36, 1); }
.language-fa .language-slider { transform: translateX(43px); }

.call-button { display: flex; min-width: 178px; height: 50px; align-items: center; justify-content: space-between; border: 3px solid #456258; border-radius: 30px; background: #fff; padding: 4px 4px 4px 20px; color: #9f001a; font-size: 15px; font-weight: 500; text-decoration: none; transition: color 220ms ease, background 220ms ease; }
.call-arrow { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: #9f001a; color: #fff; font-size: 20px; transition: transform 220ms ease, background 220ms ease, color 220ms ease; }
.call-button:hover { background: #9f001a; color: #fff; }
.call-button:hover .call-arrow { background: #fff; color: #9f001a; transform: rotate(90deg); }

.mobile-menu-button { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@keyframes header-in { from { opacity: 0; transform: translateY(-16px); } }

@media (max-width: 1180px) {
    .site-header { grid-template-columns: 190px 1fr auto; }
    .main-nav { gap: 14px; }
    .call-button { display: none; }
}

@media (max-width: 900px) {
    .site-header { top: 18px; left: 20px; width: calc(100% - 40px); grid-template-columns: minmax(150px, 210px) 1fr auto; }
    .mobile-menu-button { display: grid; width: 46px; height: 46px; grid-column: 3; grid-row: 1; align-content: center; gap: 5px; border: 1px solid rgb(255 255 255 / 30%); border-radius: 50%; background: rgb(255 255 255 / 14%); padding: 11px; cursor: pointer; }
    .mobile-menu-button span:not(.sr-only) { display: block; height: 2px; border-radius: 2px; background: #fff; }
    .header-actions { grid-column: 2; grid-row: 1; justify-self: end; margin-right: 58px; }
    .language-switch { width: 82px; height: 46px; }
    .language-switch a { height: 36px; font-size: 12px; }
    .language-slider { width: 36px; height: 36px; }
    .language-fa .language-slider { transform: translateX(37px); }
    .main-nav { position: absolute; top: 62px; left: 0; display: none; width: 100%; max-height: calc(100dvh - 100px); align-items: stretch; overflow: auto; flex-direction: column; gap: 0; border-radius: 24px; background: #fff; padding: 16px; white-space: normal; box-shadow: 0 18px 45px rgb(0 0 0 / 30%); }
    .main-nav.is-open { display: flex; }
    .nav-link { width: 100%; justify-content: space-between; padding: 14px 12px; color: #1f302a; font-size: 16px; }
    .sub-menu { position: static; display: none; min-width: 0; grid-template-columns: 1fr; box-shadow: none; opacity: 1; padding: 6px 0 10px; pointer-events: auto; transform: none; transition: none; }
    .nav-item.is-open .sub-menu { display: grid; transform: none; }
    .sub-menu a { min-height: 48px; }
}

@media (max-width: 520px) {
    .site-header { grid-template-columns: 1fr auto; }
    .brand-link { width: 180px; }
    .header-actions { position: absolute; top: 68px; right: 0; display: none; }
    .site-header:has(.main-nav.is-open) .header-actions { display: flex; }
    .main-nav { padding-top: 76px; }
}

[dir="rtl"] .language-fa .language-slider { transform: translateX(43px); }
[dir="rtl"] .call-button { padding: 4px 20px 4px 4px; }
