/* Shared site header (index.html, inventory.html) */
section[id], footer[id] { scroll-margin-top: 64px; }

.hdr {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    font-family: 'Cairo', sans-serif;
    background: rgba(13, 17, 23, 0.35);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background-color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, transform 0.35s ease;
}
.hdr.is-hidden { transform: translateY(-100%); box-shadow: none; }
.hdr.is-scrolled {
    background: rgba(13, 17, 23, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
}
.hdr.is-menu-open { background: rgba(13, 17, 23, 0.97); }

.hdr-bar {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: height 0.35s ease;
}
.hdr.is-scrolled .hdr-bar { height: 60px; }
@media (min-width: 640px) { .hdr-bar { padding: 0 24px; } }
@media (min-width: 1024px) { .hdr-bar { padding: 0 32px; gap: 20px; height: 76px; } }

/* Brand */
.hdr-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 0 auto; }
.hdr-logo { height: 38px; width: auto; transition: transform 0.35s ease, height 0.35s ease; }
.hdr.is-scrolled .hdr-logo { height: 34px; }
.hdr-brand:hover .hdr-logo { transform: scale(1.06) rotate(-4deg); }
.hdr-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.hdr-brand-name {
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(90deg, #00a632, #3ddc84);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
}
.hdr-brand-sub { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; color: rgba(255, 255, 255, 0.55); }
.hdr-qi { height: 13px; width: auto; border-radius: 3px; }
/* Seven nav links don't fit beside the full brand on small desktops; the logo alone carries it there */
@media (min-width: 1024px) and (max-width: 1199px) { .hdr-brand-text { display: none; } }

/* Desktop nav */
.hdr-nav { display: none; flex: 1 1 auto; justify-content: center; min-width: 0; }
@media (min-width: 1024px) { .hdr-nav { display: flex; } }
.hdr-links { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.hdr-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}
@media (min-width: 1024px) and (max-width: 1199px) { .hdr-link { padding: 8px 7px; font-size: 13px; } }
@media (min-width: 1440px) { .hdr-link { padding: 8px 14px; } }
.hdr-link:hover { color: #ffffff; background: rgba(255, 255, 255, 0.07); }
.hdr-link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 1px;
    width: 18px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #008b2c, #00a632);
    transform: translateX(-50%) scaleX(0);
    transition: transform 0.25s ease;
}
.hdr-link.is-active { color: #ffffff; }
.hdr-link.is-active::after { transform: translateX(-50%) scaleX(1); }
.hdr-chevron { width: 12px; height: 12px; opacity: 0.6; transition: transform 0.25s ease; }
.hdr-new {
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 999px;
    background: #F2CD00;
    color: #1a1a2e;
}

/* Packages dropdown (hover + keyboard focus) */
.hdr-dropdown { position: relative; }
.hdr-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    min-width: 280px;
    padding: 8px;
    border-radius: 16px;
    background: rgba(17, 22, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.hdr-menu::before { content: ""; position: absolute; top: -14px; left: 0; right: 0; height: 14px; }
.hdr-dropdown:hover .hdr-menu,
.hdr-dropdown:focus-within .hdr-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.hdr-dropdown:hover .hdr-chevron,
.hdr-dropdown:focus-within .hdr-chevron { transform: rotate(180deg); }
.hdr-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.hdr-menu-item:hover,
.hdr-menu-item:focus-visible { background: rgba(0, 139, 44, 0.18); color: #ffffff; }
.hdr-menu-icon {
    flex: 0 0 auto;
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #3ddc84;
}
.hdr-menu-icon svg { width: 18px; height: 18px; }
.hdr-menu-text { display: flex; flex-direction: column; min-width: 0; }
.hdr-menu-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.hdr-menu-desc { font-size: 12px; color: rgba(255, 255, 255, 0.55); line-height: 1.4; }
.hdr-menu-tag {
    margin-inline-start: auto;
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(242, 205, 0, 0.15);
    color: #F2CD00;
}

/* Actions */
.hdr-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex: 0 0 auto; }
@media (min-width: 1024px) { .hdr-actions { margin-inline-start: 0; } }
.hdr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.hdr-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.hdr-btn-outline {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.hdr-btn-outline:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.25); }
.hdr-btn-docs {
    display: none;
    color: #ffffff;
    background: rgba(0, 139, 44, 0.12);
    border: 1px solid rgba(0, 166, 50, 0.45);
}
.hdr-btn-docs svg { color: #3ddc84; }
.hdr-btn-docs:hover { background: rgba(0, 139, 44, 0.22); border-color: rgba(0, 166, 50, 0.7); }
@media (min-width: 1024px) { .hdr-btn-docs { display: inline-flex; } }
/* Tight desktop widths: docs collapses to an icon, label stays for screen readers */
@media (min-width: 1024px) and (max-width: 1279px) {
    .hdr-btn-docs { padding: 0 10px; }
    .hdr-btn-docs .hdr-btn-label {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
}
.hdr-btn-primary {
    color: #ffffff;
    border: 0;
    background: linear-gradient(135deg, #008b2c 0%, #00a632 100%);
    box-shadow: 0 6px 16px -6px rgba(0, 166, 50, 0.7);
}
.hdr-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(0, 166, 50, 0.85); }
[dir="rtl"] .hdr-btn-primary svg { transform: scaleX(-1); }
@media (max-width: 359px) { .hdr-btn-primary { padding: 0 10px; font-size: 12px; } }
.hdr-link:focus-visible,
.hdr-btn:focus-visible,
.hdr-brand:focus-visible,
.hdr-burger:focus-visible,
.hdr-lang-option:focus-visible,
.hdr-m-link:focus-visible {
    outline: 2px solid #3ddc84;
    outline-offset: 2px;
}

/* Language switcher (desktop) */
.hdr-lang { position: relative; display: none; }
@media (min-width: 1024px) { .hdr-lang { display: block; } }
.hdr-lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    min-width: 180px;
    padding: 6px;
    border-radius: 14px;
    background: rgba(17, 22, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
}
.hdr-lang-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.hdr-lang-option:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
.hdr-lang-code {
    width: 28px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.hdr-lang-check { width: 16px; height: 16px; margin-inline-start: auto; color: #3ddc84; opacity: 0; }
.hdr-lang-option.is-current { color: #ffffff; }
.hdr-lang-option.is-current .hdr-lang-check { opacity: 1; }

/* Burger */
.hdr-burger {
    position: relative;
    width: 40px; height: 40px;
    flex: 0 0 auto;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    padding: 0;
}
.hdr-burger span {
    position: absolute;
    left: 50%;
    width: 18px;
    height: 2px;
    margin-left: -9px;
    border-radius: 2px;
    background: #ffffff;
    transition: transform 0.3s ease, opacity 0.2s ease;
}
.hdr-burger span:nth-child(1) { top: 13px; }
.hdr-burger span:nth-child(2) { top: 19px; }
.hdr-burger span:nth-child(3) { top: 25px; }
.hdr-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hdr-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hdr-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (min-width: 1024px) { .hdr-burger { display: none; } }

/* Scroll progress */
.hdr-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.hdr-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #008b2c, #00a632, #F2CD00);
    transform-origin: left center;
    transform: scaleX(var(--hdr-progress, 0));
}
[dir="rtl"] .hdr-progress span {
    transform-origin: right center;
    background: linear-gradient(270deg, #008b2c, #00a632, #F2CD00);
}

/* Mobile menu */
.hdr-mobile {
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.35s ease, visibility 0s linear 0.35s;
}
.hdr.is-menu-open .hdr-mobile {
    max-height: calc(100vh - 68px);
    max-height: calc(100svh - 68px);
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: visible;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transition: max-height 0.35s ease;
}
@media (min-width: 1024px) { .hdr-mobile { display: none; } }
.hdr-mobile-inner { padding: 12px 16px 24px; max-width: 640px; margin: 0 auto; }
.hdr.is-menu-open .hdr-m-item { animation: hdrItemIn 0.35s ease both; }
.hdr.is-menu-open .hdr-m-item:nth-child(2) { animation-delay: 0.03s; }
.hdr.is-menu-open .hdr-m-item:nth-child(3) { animation-delay: 0.06s; }
.hdr.is-menu-open .hdr-m-item:nth-child(4) { animation-delay: 0.09s; }
.hdr.is-menu-open .hdr-m-item:nth-child(5) { animation-delay: 0.12s; }
.hdr.is-menu-open .hdr-m-item:nth-child(6) { animation-delay: 0.15s; }
.hdr.is-menu-open .hdr-m-item:nth-child(7) { animation-delay: 0.18s; }
.hdr.is-menu-open .hdr-m-item:nth-child(8) { animation-delay: 0.21s; }
.hdr.is-menu-open .hdr-m-item:nth-child(9) { animation-delay: 0.24s; }
@keyframes hdrItemIn {
    from { opacity: 0; transform: translateY(-8px); }
}
.hdr-m-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.hdr-m-link:hover { background: rgba(255, 255, 255, 0.06); color: #ffffff; }
.hdr-m-link.is-active { background: rgba(0, 139, 44, 0.16); color: #ffffff; }
.hdr-m-link .hdr-new { margin-inline-start: auto; }
.hdr-m-packages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 2px 4px 10px; }
.hdr-m-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}
.hdr-m-chip:hover { background: rgba(0, 139, 44, 0.16); border-color: rgba(0, 166, 50, 0.4); }
.hdr-m-chip-tag { font-size: 10px; color: #F2CD00; font-weight: 700; }
.hdr-m-lang {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 14px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.hdr-m-lang .hdr-lang-option { justify-content: center; padding: 9px 10px; }
.hdr-m-lang .hdr-lang-option.is-current { background: #ffffff; color: #1a1a2e; }
.hdr-m-lang .hdr-lang-check { display: none; }
.hdr-m-actions { display: grid; gap: 10px; margin-top: 14px; }
.hdr-m-actions .hdr-btn { height: 48px; font-size: 15px; border-radius: 12px; }
.hdr-m-actions .hdr-btn-docs { display: inline-flex; }

.hdr-scrim {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.hdr-scrim.is-visible { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }
@media (min-width: 1024px) { .hdr-scrim { display: none; } }
body.hdr-lock { overflow: hidden; }

