/* ========================================================================
   DIASTOMY DESKTOP HEADER — FIGMA LOCK R12
   Exact reference geometry: Figma 1440 canvas / node 1322x77 at x=51 y=50.
   Desktop only. Mobile/tablet below 1024px stays untouched.
   ======================================================================== */

@media (min-width: 1024px) {
    /* Remove the obsolete desktop-only home header spacer. The global header
       must float above the Hero exactly like the Figma reference. */
    body[data-page="home"] .dm-home-shell-v3 {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body > header.dm-site-header-glass {
        position: absolute !important;
        top: 50px !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        inset: auto !important;
        transform: translateX(-50%) !important;

        width: min(1322px, calc(100vw - 102px)) !important;
        max-width: 1322px !important;
        height: 77px !important;
        min-height: 77px !important;

        margin: 0 !important;
        padding: 0 16px !important;

        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;

        border: 0 !important;
        border-radius: 68px !important;

        background: rgba(12, 12, 12, .80) !important;
        -webkit-backdrop-filter: blur(8px) saturate(110%) !important;
        backdrop-filter: blur(8px) saturate(110%) !important;

        box-shadow: none !important;
        overflow: visible !important;
        z-index: 1000 !important;
        direction: rtl !important;
    }

    body > header.dm-site-header-glass::before {
        display: none !important;
        content: none !important;
    }

    /* Right: brand / divider / compact nav */
    body > header.dm-site-header-glass > div:nth-of-type(1) {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        min-width: 0 !important;
        flex: 0 1 auto !important;
        direction: rtl !important;
    }

    body > header.dm-site-header-glass > div:nth-of-type(1) > a:first-child {
        display: flex !important;
        align-items: center !important;
        flex: 0 0 auto !important;
        margin: 0 1px 0 0 !important;
    }

    body > header.dm-site-header-glass img[alt="DIASTOMY"],
    body > header.dm-site-header-glass img[alt="Logo"],
    body > header.dm-site-header-glass > div:nth-of-type(1) > a:first-child img {
        width: 183px !important;
        max-width: 183px !important;
        height: 30px !important;
        max-height: 30px !important;
        object-fit: contain !important;
    }

    body > header.dm-site-header-glass > div:nth-of-type(1) > div.h-8 {
        display: block !important;
        width: 1px !important;
        height: 32px !important;
        margin: 0 7px !important;
        background: rgba(255,255,255,.20) !important;
    }

    body > header.dm-site-header-glass nav {
        display: flex !important;
        align-items: center !important;
        gap: 28px !important;
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
        direction: rtl !important;
    }

    body > header.dm-site-header-glass nav a {
        min-height: 46px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
        color: #e1e1e1 !important;
        font-family: "YekanBakh", "Yekan Bakh", sans-serif !important;
        font-size: 14px !important;
        line-height: 1 !important;
        font-weight: 300 !important;
        letter-spacing: 0 !important;
        text-decoration: none !important;
        transform: none !important;
    }

    body > header.dm-site-header-glass nav a:hover {
        color: #fff !important;
        transform: none !important;
    }

    body > header.dm-site-header-glass nav a.relative {
        color: #fff !important;
        font-weight: 800 !important;
    }

    body > header.dm-site-header-glass nav a.relative svg {
        display: block !important;
        width: 46px !important;
        height: 46px !important;
        flex: 0 0 46px !important;
        margin: 0 -8px !important;
    }

    /* Figma reference has the six main categories only. Movie Room remains
       available in the account menu and elsewhere. */
    body > header.dm-site-header-glass .dm-desktop-movie-room-link {
        display: none !important;
    }

    /* Left controls: account / bell / heart / search, matching reference. */
    body > header.dm-site-header-glass .dm-site-header-actions {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 9px !important;
        width: auto !important;
        min-width: 0 !important;
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        direction: rtl !important;
    }

    /* Search becomes the small red circular control, not a desktop search pill. */
    body > header.dm-site-header-glass .dm-site-search-shell {
        display: inline-flex !important;
        width: 43px !important;
        min-width: 43px !important;
        max-width: 43px !important;
        height: 43px !important;
        flex: 0 0 43px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 50% !important;
        overflow: visible !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    body > header.dm-site-header-glass .dm-site-search-shell > button {
        width: 43px !important;
        min-width: 43px !important;
        max-width: 43px !important;
        height: 43px !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #e41a1a !important;
        color: #fff !important;
        box-shadow: 0 7px 18px rgba(228,26,26,.28) !important;
        overflow: hidden !important;
    }

    body > header.dm-site-header-glass .dm-site-search-shell > button svg {
        display: block !important;
        width: 22px !important;
        height: 22px !important;
        flex: 0 0 22px !important;
        opacity: 1 !important;
    }

    body > header.dm-site-header-glass .dm-site-search-placeholder,
    body > header.dm-site-header-glass .dm-site-search-shortcut,
    body > header.dm-site-header-glass .dm-site-search-shell > button::after {
        display: none !important;
        content: none !important;
    }

    /* Heart / My List is present in the Figma reference. */
    body > header.dm-site-header-glass .dm-site-mylist {
        display: flex !important;
        width: 43px !important;
        min-width: 43px !important;
        max-width: 43px !important;
        height: 43px !important;
        flex: 0 0 43px !important;
        padding: 0 !important;
        margin: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
        border: 1px solid #505050 !important;
        background: #242424 !important;
        color: #b9b9b9 !important;
        box-shadow: none !important;
    }

    body > header.dm-site-header-glass .dm-site-mylist svg {
        width: 24px !important;
        height: 24px !important;
    }

    /* White notification circle from the reference. */
    body > header.dm-site-header-glass .dm-site-notification {
        display: flex !important;
        width: 43px !important;
        min-width: 43px !important;
        max-width: 43px !important;
        height: 43px !important;
        flex: 0 0 43px !important;
        padding: 0 !important;
        margin: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #fff !important;
        color: #111 !important;
        box-shadow: none !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    body > header.dm-site-header-glass .dm-site-notification svg {
        width: 22px !important;
        height: 22px !important;
        color: #111 !important;
    }

    body > header.dm-site-header-glass .dm-site-notification svg path {
        fill: currentColor !important;
    }

    /* Expanded account pill: avatar + name + phone + chevron. */
    body > header.dm-site-header-glass .dm-site-profile-wrap {
        display: flex !important;
        width: auto !important;
        min-width: 0 !important;
        height: 52px !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
    }

    body > header.dm-site-header-glass .dm-site-profile-wrap > a.dm-site-profile {
        display: flex !important;
        width: auto !important;
        min-width: 166px !important;
        height: 52px !important;
        min-height: 52px !important;
        padding: 4px 10px 4px 4px !important;
        margin: 0 !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 9px !important;
        border: 1px solid rgba(255,255,255,.20) !important;
        border-radius: 999px !important;
        background: transparent !important;
        color: #fff !important;
        box-shadow: none !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        direction: rtl !important;
    }

    body > header.dm-site-header-glass .dm-site-profile > div:first-child {
        display: flex !important;
        width: 43px !important;
        min-width: 43px !important;
        height: 43px !important;
        flex: 0 0 43px !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
        overflow: hidden !important;
        background: rgba(88,88,88,.20) !important;
        border: 0 !important;
    }

    body > header.dm-site-header-glass .dm-site-profile > div:first-child img {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: inherit !important;
    }

    body > header.dm-site-header-glass .dm-site-profile > .flex-col {
        display: flex !important;
        min-width: 66px !important;
        flex: 1 1 auto !important;
        align-items: flex-start !important;
        justify-content: center !important;
        text-align: right !important;
    }

    body > header.dm-site-header-glass .dm-site-profile > .flex-col p:first-child {
        display: block !important;
        margin: 0 0 1px !important;
        color: #fff !important;
        font-size: 11px !important;
        line-height: 15px !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
    }

    body > header.dm-site-header-glass .dm-site-profile > .flex-col p:nth-child(2) {
        display: block !important;
        margin: 0 !important;
        color: rgba(255,255,255,.48) !important;
        font-size: 9px !important;
        line-height: 12px !important;
        font-weight: 400 !important;
        white-space: nowrap !important;
    }

    body > header.dm-site-header-glass .dm-site-profile > svg:last-child {
        display: block !important;
        width: 14px !important;
        min-width: 14px !important;
        height: 14px !important;
        flex: 0 0 14px !important;
        color: rgba(255,255,255,.9) !important;
        transform: rotate(90deg) !important;
    }

    body > header.dm-site-header-glass .dm-site-profile-wrap > div.absolute {
        left: 0 !important;
        right: auto !important;
    }

    /* Home: undo the later inline flow rule that made the header a giant
       full-width row separated from the Hero. */
    body[data-page="home"] > header.dm-site-header-glass {
        position: absolute !important;
        top: 50px !important;
        left: 50% !important;
        right: auto !important;
        margin: 0 !important;
        transform: translateX(-50%) !important;
    }

    /* Let the Hero start behind the floating header, like the reference. */
    body[data-page="home"] .dm-home-hero {
        margin-top: 0 !important;
    }
}

/* Laptop: preserve the Figma proportions but avoid overflow. */
@media (min-width: 1024px) and (max-width: 1199px) {
    body > header.dm-site-header-glass {
        width: calc(100vw - 48px) !important;
        top: 28px !important;
        height: 68px !important;
        min-height: 68px !important;
    }

    body > header.dm-site-header-glass nav {
        display: none !important;
    }

    body > header.dm-site-header-glass img[alt="DIASTOMY"],
    body > header.dm-site-header-glass img[alt="Logo"] {
        width: 166px !important;
        max-width: 166px !important;
    }

    body > header.dm-site-header-glass > div:nth-of-type(1) > div.h-8 {
        display: none !important;
    }
}
