/* Royal mobile header and footer refinement. Desktop presentation is untouched. */

@media (max-width: 1000px) {
  .site-header {
    background: rgba(255, 255, 255, .96);
    border-bottom-color: rgba(214, 225, 229, .82);
    box-shadow: 0 8px 30px rgba(25, 55, 72, .045);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
  }

  .site-header.scrolled {
    box-shadow: 0 13px 36px rgba(25, 55, 72, .11);
  }

  .site-header .header-shell {
    min-height: 76px;
    height: auto;
    gap: 12px;
    padding-block: 9px;
    transform: none;
  }

  .site-header .brand {
    min-width: 0;
    gap: 9px;
  }

  .site-header .brand img {
    width: 48px;
    height: 48px;
  }

  .site-header .brand span {
    display: grid;
    letter-spacing: .22em;
  }

  .site-header .brand b {
    font-size: .86rem;
  }

  .site-header .brand small {
    margin-top: 4px;
    font-size: .48rem;
    letter-spacing: .14em;
  }

  body.menu-open::before {
    background: rgba(15, 38, 51, .42);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
  }

  .site-header .menu-toggle {
    display: flex;
    position: relative;
    z-index: 104;
    width: 46px;
    height: 46px;
    margin-right: auto;
    flex: none;
    overflow: hidden;
    border: 1px solid #d9e4e7;
    border-radius: 15px;
    background: linear-gradient(145deg, #fff, #f5f8f9);
    box-shadow: 0 9px 24px rgba(28, 58, 74, .09);
    transition: background .22s ease, border-color .22s ease, box-shadow .22s ease, transform .22s ease;
  }

  .site-header .menu-toggle:active {
    transform: scale(.96);
  }

  .site-header .menu-toggle span {
    position: absolute;
    right: 12px;
    width: 21px;
    height: 2px;
    border-radius: 999px;
    background: #17394d;
    transition: transform .25s ease, opacity .18s ease, top .25s ease, width .2s ease, background .2s ease;
  }

  .site-header .menu-toggle span:nth-child(1) { top: 15px; }
  .site-header .menu-toggle span:nth-child(2) { top: 22px; width: 16px; }
  .site-header .menu-toggle span:nth-child(3) { top: 29px; }

  .site-header .menu-toggle[aria-expanded="true"] {
    border-color: #255d61;
    background: linear-gradient(145deg, #214e53, #5d888a);
    box-shadow: 0 12px 28px rgba(37, 93, 97, .23);
  }

  .site-header .menu-toggle[aria-expanded="true"] span {
    top: 22px;
    width: 21px;
    background: #fff;
  }

  .site-header .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
  .site-header .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: translateX(11px); }
  .site-header .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg); }

  .site-header .mobile-nav,
  .site-header .mobile-nav.open {
    position: fixed;
    z-index: 103;
    top: calc(82px + env(safe-area-inset-top, 0px));
    right: 14px;
    left: 14px;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: none !important;
    gap: 11px;
    max-height: 0;
    padding: 0 14px !important;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 24px;
    background:
      radial-gradient(circle at 10% 0, rgba(59, 120, 122, .1), transparent 14rem),
      rgba(255, 255, 255, .985);
    box-shadow: 0 32px 80px rgba(15, 38, 51, .24);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px) scale(.985);
    transform-origin: top center;
    transition: opacity .24s ease, transform .24s ease, max-height .3s ease, padding .24s ease, visibility .24s;
  }

  .site-header .mobile-nav.open {
    max-height: calc(100dvh - 105px);
    padding: 15px !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-color: #dbe6e9;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }

  .mobile-nav-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 3px 4px 11px;
    border-bottom: 1px solid #e6edef;
  }

  .mobile-nav-intro span {
    color: #17394d;
    font-size: .78rem;
    font-weight: 850;
  }

  .mobile-nav-intro small {
    color: #84959e;
    font: 600 .55rem/1.2 Arial, sans-serif;
    letter-spacing: .17em;
    direction: ltr;
  }

  .mobile-nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .site-header .mobile-nav-links a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 10px 13px;
    border: 1px solid #e2eaed;
    border-radius: 14px;
    background: rgba(248, 250, 251, .88);
    color: #496270;
    font-size: .82rem;
    font-weight: 750;
    transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
  }

  .site-header .mobile-nav-links a::after {
    content: "←";
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    flex: none;
    margin-right: 8px;
    border-radius: 9px;
    background: #fff;
    color: #78909a;
    font: 600 .75rem/1 Arial, sans-serif;
    box-shadow: inset 0 0 0 1px #e3eaed;
  }

  .site-header .mobile-nav-links a:hover,
  .site-header .mobile-nav-links a.is-active {
    border-color: #bdd3d5;
    background: #edf5f5;
    color: #245c60;
  }

  .site-header .mobile-nav-links a.is-active::after {
    background: #347576;
    color: #fff;
    box-shadow: none;
  }

  .site-header .mobile-nav a.mobile-nav-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 10px 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(120deg, #204f54, #789a9c);
    color: #fff;
    font-size: .83rem;
    font-weight: 850;
    box-shadow: 0 12px 27px rgba(38, 89, 93, .18);
  }
}

@media (max-width: 680px) {
  .site-header .header-shell {
    min-height: 72px;
    padding-block: 8px;
  }

  .site-header .brand img {
    width: 45px;
    height: 45px;
  }

  .site-header .brand b { font-size: .8rem; }
  .site-header .brand small { font-size: .44rem; }

  .site-header .mobile-nav,
  .site-header .mobile-nav.open {
    top: calc(76px + env(safe-area-inset-top, 0px));
    right: 10px;
    left: 10px;
    border-radius: 21px;
  }

  .site-header .mobile-nav.open {
    max-height: calc(100dvh - 92px);
    padding: 12px !important;
  }

  .mobile-nav-links {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .site-header .mobile-nav-links a {
    min-height: 49px;
    border-radius: 13px;
  }

  .site-footer {
    padding-top: 36px !important;
    background: linear-gradient(180deg, #fff 0%, #f8fafb 100%);
  }

  .site-footer .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 27px 16px !important;
    padding-bottom: 28px;
  }

  .site-footer .footer-brand,
  .site-footer .footer-contact {
    grid-column: 1 / -1;
  }

  .site-footer .footer-brand {
    align-items: center !important;
    gap: 12px;
    text-align: center;
  }

  .site-footer .footer-brand .brand {
    gap: 10px;
  }

  .site-footer .footer-brand .brand img {
    width: 55px;
    height: 55px;
  }

  .site-footer .footer-brand .brand span {
    display: grid;
    text-align: left;
  }

  .site-footer .footer-brand .brand b {
    font-size: .9rem;
  }

  .site-footer .footer-brand .brand small {
    font-size: .47rem;
  }

  .site-footer .footer-brand p {
    max-width: 350px;
    margin: 0 auto;
    color: #6b7f89;
    font-size: .8rem !important;
    line-height: 1.95;
  }

  .site-footer .social-row {
    justify-content: center;
    gap: 9px;
    margin-top: 2px;
  }

  .site-footer .social-row a {
    width: 42px;
    height: 42px;
    border-color: #dce6e9;
    border-radius: 14px;
    background: #fff;
    color: #214f5a;
    box-shadow: 0 8px 20px rgba(28, 58, 74, .055);
  }

  .site-footer .social-row svg {
    width: 18px;
    height: 18px;
  }

  .site-footer .footer-links {
    align-items: stretch !important;
    gap: 0;
    text-align: right;
  }

  .site-footer .footer-links h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    margin: 0 0 7px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dfe8eb;
    color: #17394d;
    font-size: .87rem !important;
  }

  .site-footer .footer-links h2::before,
  .site-footer .footer-contact h2::before {
    content: "";
    width: 16px;
    height: 3px;
    flex: none;
    border-radius: 999px;
    background: linear-gradient(90deg, #347576, #83a6a7);
  }

  .site-footer .footer-links a:not(.brand) {
    display: flex;
    align-items: center;
    min-height: 39px;
    padding: 7px 1px;
    border-bottom: 1px solid #edf1f3;
    color: #657985;
    font-size: .75rem !important;
    line-height: 1.55;
  }

  .site-footer .footer-links a:not(.brand):last-child {
    border-bottom: 0;
  }

  .site-footer .footer-contact {
    width: 100%;
    align-items: stretch !important;
    padding: 25px 0 0 !important;
    border: 0 !important;
    border-top: 1px solid #dce6e9 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: right !important;
    transform: none !important;
  }

  .site-footer .footer-contact h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: none !important;
    margin: 0 0 10px !important;
    color: #17394d;
    text-align: right !important;
  }

  .site-footer .footer-contact-list {
    width: 100%;
    max-width: none !important;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0 !important;
    direction: rtl;
  }

  .site-footer .footer-contact-item {
    width: 100%;
    min-height: 58px !important;
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) !important;
    align-items: center;
    gap: 11px;
    padding: 9px 0 !important;
    border-bottom: 1px solid #e8eef0;
    color: #526b78 !important;
    direction: rtl;
  }

  .site-footer .footer-contact-item:last-child {
    border-bottom: 0;
  }

  .site-footer .footer-contact-icon {
    width: 36px !important;
    height: 36px !important;
    border: 1px solid #d8e6e7;
    border-radius: 12px;
    background: #edf5f5;
    color: #2b686b;
  }

  .site-footer .footer-contact-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .site-footer .footer-contact-copy {
    min-width: 0;
    justify-items: start !important;
    text-align: right !important;
    direction: rtl;
  }

  .site-footer .footer-contact-copy b,
  .site-footer .footer-email-item .footer-contact-copy b {
    max-width: 100%;
    color: #3d5967;
    font: 600 .81rem/1.55 Arial, Vazirmatn, sans-serif !important;
    letter-spacing: .01em;
    white-space: nowrap;
  }

  .site-footer .footer-contact-copy small {
    margin: 1px 0 0 !important;
    color: #82939c;
    font-size: .65rem !important;
    line-height: 1.55;
    text-align: right !important;
  }

  .site-footer .footer-email-item .footer-contact-copy b {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .site-footer .footer-bottom {
    min-height: 64px;
    align-items: center;
    justify-content: center;
    padding: 17px 9px calc(17px + env(safe-area-inset-bottom, 0px)) !important;
    color: #81929b;
    font-size: .68rem !important;
    line-height: 1.9;
    text-align: center;
  }
}

@media (min-width: 520px) and (max-width: 680px) {
  .site-footer .footer-contact-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 22px !important;
  }
}

@media (max-width: 350px) {
  .site-header .brand small { display: none; }
  .site-header .brand b { font-size: .75rem; }
  .mobile-nav-intro small { display: none; }
  .site-footer .footer-grid { gap-inline: 12px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header .mobile-nav,
  .site-header .menu-toggle,
  .site-header .menu-toggle span {
    transition: none !important;
  }
}
