/* ============================================================
   Site header (Views/Shared/Components/Header): logo, menu, theme switch, language, account, mobile drawer.
   ============================================================ */

.ds-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--ds-header-bg);
    backdrop-filter: saturate(1.4) blur(14px);
    border-top: 3px solid var(--ds-red);
    border-bottom: 1px solid var(--ds-line-soft);
}

.ds-header-row {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 72px;
}

.ds-logo {
    flex: none;
}

.ds-logo img {
    display: block;
    height: 34px;
    width: auto;
}

.ds-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

    .ds-nav > li {
        position: relative;
    }

    .ds-nav a.ds-nav-link,
    .ds-nav button.ds-nav-link {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        height: 40px;
        padding: 0 12px;
        border: none;
        border-radius: 10px;
        background: none;
        font-size: 15px;
        font-weight: 500;
        white-space: nowrap;
        color: var(--ds-text);
        cursor: pointer;
        transition: background .2s ease, color .2s ease;
    }

        .ds-nav .ds-nav-link:hover {
            background: var(--ds-red-soft);
            color: var(--ds-red);
        }

        .ds-nav .ds-nav-link.is-active {
            background: var(--ds-red-soft);
            color: var(--ds-red);
            font-weight: 700;
            box-shadow: inset 0 -2px 0 var(--ds-red);
        }

        .ds-nav .ds-nav-link i {
            font-size: 10px;
            opacity: .6;
        }

/* the drop-down of a menu item */
.ds-menu {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-start: 0;
    min-width: 230px;
    padding: 6px;
    border-radius: var(--ds-r-md);
    background: var(--ds-surface);
    border: 1px solid var(--ds-line-soft);
    box-shadow: var(--ds-shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

    .ds-nav > li:hover > .ds-menu,
    .ds-nav > li:focus-within > .ds-menu {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .ds-menu a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 10px;
        font-size: 14px;
        color: var(--ds-text);
    }

        .ds-menu a:hover {
            background: var(--ds-soft);
            color: var(--ds-ink);
        }

        .ds-menu a i {
            width: 30px;
            height: 30px;
            border-radius: 8px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: var(--ds-red-soft);
            color: var(--ds-red);
            font-size: 13px;
        }

.ds-header-end {
    display: flex;
    flex: none;
    align-items: center;
    gap: 8px;
}

.ds-burger {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--ds-line);
    border-radius: 12px;
    background: var(--ds-surface);
    color: var(--ds-ink);
    cursor: pointer;
}

/* the mobile drawer (bootstrap offcanvas) */
.ds-drawer.offcanvas {
    width: min(340px, 88vw);
    border: none;
}

.ds-drawer .offcanvas-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--ds-line-soft);
}

.ds-drawer-nav {
    list-style: none;
    padding: 10px;
    margin: 0;
}

    .ds-drawer-nav a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 500;
        color: var(--ds-ink);
    }

        .ds-drawer-nav a:hover {
            background: var(--ds-red-soft);
            color: var(--ds-red);
        }

        .ds-drawer-nav a.is-active {
            background: var(--ds-red);
            color: #FFF;
        }

    .ds-drawer-nav .ds-drawer-sub a {
        padding-inline-start: 34px;
        font-size: 14px;
        color: var(--ds-text);
    }

.ds-drawer-actions {
    display: grid;
    gap: 8px;
    padding: 10px 20px 24px;
}

/* ---------- the signed-in visitor: days left and the account menu ---------- */
.ds-days {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--ds-red-soft);
    font-size: 13px;
    font-weight: 700;
    color: var(--ds-red);
    white-space: nowrap;
}

.ds-account {
    position: relative;
}

.ds-account-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 240px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--ds-line);
    border-radius: 10px;
    background: var(--ds-surface);
    font-size: 14px;
    color: var(--ds-ink);
    cursor: pointer;
}

    .ds-account-btn span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.ds-account .ds-menu {
    inset-inline-start: auto;
    inset-inline-end: 0;
}

.ds-account:hover > .ds-menu,
.ds-account:focus-within > .ds-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* the bootstrap drawer follows the theme too */
.ds-drawer.offcanvas {
    background: var(--ds-surface);
    color: var(--ds-text);
}

:root[data-theme="dark"] .ds-drawer .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

:root[data-theme="dark"] .ds-header {
    border-bottom-color: var(--ds-line-soft);
}

/* ---------- responsive ---------- */
/* a menu item never breaks onto two lines: on mid-wide screens the menu gets tighter instead (Arabic labels and the
   signed-in account block are wider than the English ones) */
@media (max-width: 1439px) {
    .ds-header-row {
        gap: 14px;
    }

    .ds-nav {
        gap: 0;
    }

        .ds-nav a.ds-nav-link,
        .ds-nav button.ds-nav-link {
            padding: 0 8px;
            font-size: 14px;
        }

        .ds-nav .ds-badge-new {
            display: none;
        }
}

@media (max-width: 1199px) {
    .ds-nav,
    .ds-header-end .ds-btn-ghost,
    .ds-header-end .ds-days,
    .ds-header-end .ds-account {
        display: none;
    }

    .ds-burger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .ds-header-end {
        margin-inline-start: auto;
    }
}

@media (max-width: 575px) {
    .ds-header-row {
        height: 64px;
        gap: 12px;
    }

    .ds-header-end .ds-btn-primary {
        display: none;
    }
}
