/* =========================================================
   ND HEADER - GO.SOCIALSTUDIES.COM

   Custom shortcode header for Hello Elementor.
   Search is intentionally NOT included here.
   Existing Go Elementor search remains separate.
========================================================= */

.nd-new-header {
    --nd-font: "Inter", sans-serif;
    --nd-black: #000000;
    --nd-white: #ffffff;
    --nd-orange: #f36f32;
    --nd-border: #e8e8e8;
    --nd-container: 1240px;
    --nd-gutter: clamp(20px, 4vw, 60px);
    position: relative;
    z-index: 999;
    width: 100%;
    margin: 0;
    padding: 0;
    background: var(--nd-white);
    color: var(--nd-black);
    font-family: var(--nd-font);
    box-sizing: border-box;
}

.nd-new-header *,
.nd-new-header *::before,
.nd-new-header *::after {
    box-sizing: border-box;
}


/* =========================================================
   CONTAINER
========================================================= */

.nd-header-container {
    width: calc(100% - (var(--nd-gutter) * 2));
    max-width: var(--nd-container);
    margin-left: auto;
    margin-right: auto;
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

.nd-new-header .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}


/* =========================================================
   TOP BAR
========================================================= */

.nd-header-top {
    width: 100%;
    padding: 12px 0;
    background: var(--nd-black);
}

.nd-header-top-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 38px;
}

.nd-header-top-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--nd-white);
    font-family: var(--nd-font);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.nd-header-top-links a:hover,
.nd-header-top-links a:focus {
    color: var(--nd-orange);
    text-decoration: none !important;
}

.nd-header-cart svg {
    display: block;
}


/* =========================================================
   MAIN HEADER
========================================================= */

.nd-header-main {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--nd-white);
}

.nd-header-main-row {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 175px;
    align-items: center;
    gap: 28px;
    min-height: 108px;
}


/* =========================================================
   LOGO
========================================================= */

.nd-header-branding {
    min-width: 0;
}

.nd-header-logo {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 0;
    padding: 0;
    text-decoration: none !important;
}

.nd-header-logo img {
    display: block;
    width: auto;
    max-width: 220px;
    max-height: 72px;
    margin: 0;
    padding: 0;
    border: 0;
    object-fit: contain;
}


/* =========================================================
   NAVIGATION - BASE
========================================================= */

.nd-header-navigation {
    position: static;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.nd-header-navigation ul,
.nd-header-navigation li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nd-header-navigation .menu-main-menu-container {
    width: 100%;
}

.nd-header-navigation #primary-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: clamp(18px, 1.6vw, 30px);
    width: 100%;
    margin: 0;
    padding: 0;
}

.nd-header-navigation #primary-menu>.menu-item {
    position: relative;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
}

.nd-header-navigation #primary-menu .menu-item>a {
    color: var(--nd-black);
    font-family: var(--nd-font);
    text-decoration: none !important;
}

.nd-header-navigation #primary-menu>.menu-item>a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 24px 0;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0;
    white-space: nowrap;
}

.nd-header-navigation #primary-menu>.menu-item>a:hover,
.nd-header-navigation #primary-menu>.menu-item>a:focus,
.nd-header-navigation #primary-menu>.current-menu-item>a,
.nd-header-navigation #primary-menu>.current-menu-ancestor>a {
    color: var(--nd-orange);
}


/* Desktop dropdown indicator */

.nd-header-navigation #primary-menu>.menu-item-has-children>a::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
}


/* =========================================================
   DESKTOP DROPDOWNS
========================================================= */

.nd-header-navigation #primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: block;
    min-width: 235px;
    margin: 0;
    padding: 8px 0;
    border: 1px solid #ededed;
    border-radius: 3px;
    background: var(--nd-white);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

.nd-header-navigation #primary-menu .sub-menu .menu-item {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
}

.nd-header-navigation #primary-menu .sub-menu .menu-item>a {
    display: block;
    width: 100%;
    padding: 10px 18px;
    color: var(--nd-black);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
}

.nd-header-navigation #primary-menu .sub-menu .menu-item>a:hover,
.nd-header-navigation #primary-menu .sub-menu .menu-item>a:focus {
    color: var(--nd-orange);
    background: #f8f8f8;
}


/* Second/third level */

.nd-header-navigation #primary-menu .sub-menu .sub-menu {
    top: -9px;
    left: calc(100% + 2px);
}


/* Open dropdown */

.nd-header-navigation #primary-menu .menu-item:hover>.sub-menu,
.nd-header-navigation #primary-menu .menu-item:focus-within>.sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}


/* Child dropdown arrow */

.nd-header-navigation #primary-menu .sub-menu .menu-item-has-children>a {
    position: relative;
    padding-right: 35px;
}

.nd-header-navigation #primary-menu .sub-menu .menu-item-has-children>a::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 17px;
    width: 7px;
    height: 7px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: translateY(-50%) rotate(45deg);
}


/* =========================================================
   ACCOUNT BUTTON
========================================================= */

.nd-header-account {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.nd-header-account-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 14px 24px;
    border: 0;
    border-radius: 99px;
    background: var(--nd-orange);
    color: var(--nd-white) !important;
    font-family: var(--nd-font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background-color 0.25s ease;
}

.nd-header-account-btn:hover,
.nd-header-account-btn:focus {
    background: var(--nd-black);
    color: var(--nd-white) !important;
    text-decoration: none !important;
}


/* =========================================================
   MOBILE CONTROLS - HIDDEN ON DESKTOP
========================================================= */

.nd-header-menu-toggle,
.nd-header-drawer-head,
.nd-header-drawer-account,
.nd-header-drawer-overlay,
.nd-submenu-toggle {
    display: none;
}


/* =========================================================
   MID-SIZE DESKTOP
========================================================= */

@media screen and (max-width: 1199px) and (min-width: 992px) {
    .nd-header-main-row {
        grid-template-columns: 210px minmax(0, 1fr) 160px;
        gap: 18px;
    }
    .nd-header-logo img {
        max-width: 200px;
    }
    .nd-header-navigation #primary-menu {
        gap: 15px;
    }
    .nd-header-navigation #primary-menu>.menu-item>a {
        font-size: 16px;
    }
    .nd-header-account-btn {
        padding-left: 18px;
        padding-right: 18px;
    }
}


/* =========================================================
   MOBILE / TABLET DRAWER
   991px AND BELOW
========================================================= */

@media screen and (max-width: 991px) {
    body.nd-header-drawer-open {
        overflow: hidden;
    }
    /* Header layout */
    .nd-header-main-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 56px;
        gap: 18px;
        min-height: 86px;
        padding-top: 12px;
        padding-bottom: 12px;
    }
    .nd-header-logo img {
        max-width: 210px;
        max-height: 64px;
    }
    .nd-header-account {
        display: none;
    }
    .nd-header-navigation {
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
    /* Hamburger */
    .nd-header-menu-toggle {
        display: inline-flex !important;
        position: relative;
        z-index: 3;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
        width: 46px;
        height: 46px;
        margin: 0 0 0 auto;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: var(--nd-orange);
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }
    .nd-menu-line {
        display: block;
        width: 21px;
        height: 2px;
        margin: 0;
        background: var(--nd-white);
    }
    /* Overlay */
    .nd-header-drawer-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 99998;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.2s ease, visibility 0s linear 0.2s;
    }
    .nd-header-navigation.toggled .nd-header-drawer-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity 0.2s ease, visibility 0s;
    }
    /* Drawer */
    .nd-header-drawer {
        display: flex;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 99999;
        flex-direction: column;
        width: min(390px, 88vw);
        margin: 0;
        padding: 0;
        background: var(--nd-white);
        box-shadow: -10px 0 28px rgba(0, 0, 0, 0.16);
        overflow: hidden;
        visibility: hidden;
        transform: translate3d(102%, 0, 0);
        transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.26s;
    }
    .nd-header-navigation.toggled .nd-header-drawer {
        visibility: visible;
        transform: translate3d(0, 0, 0);
        transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
    }
    /* Drawer header */
    .nd-header-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex: 0 0 auto;
        min-height: 76px;
        padding: 16px 22px;
        border-bottom: 1px solid var(--nd-border);
        background: var(--nd-white);
    }
    .nd-header-drawer-title {
        position: relative;
        padding-left: 16px;
        color: var(--nd-black);
        font-size: 22px;
        font-weight: 700;
        line-height: 1.2;
    }
    .nd-header-drawer-title::before {
        content: "";
        position: absolute;
        top: 2px;
        bottom: 2px;
        left: 0;
        width: 4px;
        border-radius: 10px;
        background: var(--nd-orange);
    }
    .nd-header-drawer-close {
        display: block;
        position: relative;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: var(--nd-orange);
        color: var(--nd-white);
        font-size: 30px;
        font-weight: 300;
        line-height: 1;
        cursor: pointer;
    }
    .nd-header-drawer-close>span {
        position: absolute;
        top: 50%;
        left: 50%;
        line-height: 1;
        transform: translate(-50%, -54%);
    }
    /* Drawer menu wrapper */
    .nd-header-navigation .menu-main-menu-container {
        display: block !important;
        flex: 1 1 auto;
        width: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }
    .nd-header-navigation #primary-menu {
        display: block !important;
        width: 100%;
        margin: 0;
        padding: 10px 20px 24px;
    }
    /* Menu items */
    .nd-header-navigation #primary-menu .menu-item {
        display: block;
        position: relative;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    .nd-header-navigation #primary-menu>.menu-item {
        border-bottom: 1px solid #ededed;
    }
    .nd-header-navigation #primary-menu .menu-item>a {
        display: block;
        width: 100%;
        padding: 17px 54px 17px 6px !important;
        color: var(--nd-black);
        background: transparent;
        font-size: 17px;
        font-weight: 600;
        line-height: 1.35;
        white-space: normal;
        text-align: left;
        text-decoration: none !important;
    }
    .nd-header-navigation #primary-menu .menu-item>a:hover,
    .nd-header-navigation #primary-menu .menu-item>a:focus,
    .nd-header-navigation #primary-menu .current-menu-item>a,
    .nd-header-navigation #primary-menu .current-menu-ancestor>a {
        color: var(--nd-orange);
    }
    /* Remove desktop arrow */
    .nd-header-navigation #primary-menu .menu-item-has-children>a::after {
        display: none;
    }
    /* Submenu toggle created by nd-header.js */
    .nd-submenu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 8px;
        right: 0;
        z-index: 2;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: #f3f3f3;
        cursor: pointer;
        transition: background-color 0.2s ease, transform 0.2s ease;
    }
    .nd-submenu-toggle::before {
        content: "";
        width: 8px;
        height: 8px;
        border-right: 2px solid var(--nd-black);
        border-bottom: 2px solid var(--nd-black);
        transform: translateY(-2px) rotate(45deg);
        transition: border-color 0.2s ease, transform 0.25s ease;
    }
    .menu-item.open>.nd-submenu-toggle::before {
        transform: translateY(2px) rotate(225deg);
    }
    .nd-submenu-toggle:hover,
    .nd-submenu-toggle:focus {
        background: var(--nd-orange);
        outline: none;
    }
    .nd-submenu-toggle:hover::before,
    .nd-submenu-toggle:focus::before {
        border-color: var(--nd-white);
    }
    /* Mobile submenus */
    .nd-header-navigation #primary-menu .sub-menu,
    .nd-header-navigation.toggled #primary-menu .sub-menu {
        display: block !important;
        position: static !important;
        width: 100% !important;
        min-width: 0 !important;
        max-height: 0;
        margin: 0 !important;
        padding: 0 0 0 12px !important;
        border: 0 !important;
        border-left: 2px solid var(--nd-orange) !important;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: hidden;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transform: none !important;
        transition: max-height 0.4s ease, opacity 0.25s ease, visibility 0.25s ease;
    }
    .nd-header-navigation #primary-menu .menu-item.open>.sub-menu {
        max-height: 1800px;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    .nd-header-navigation #primary-menu .sub-menu .menu-item>a {
        padding-top: 13px !important;
        padding-bottom: 13px !important;
        font-size: 15px;
        font-weight: 500;
    }
    /* Mobile account */
    .nd-header-drawer-account {
        display: block;
        flex: 0 0 auto;
        padding: 20px 22px;
        border-top: 1px solid var(--nd-border);
        background: var(--nd-white);
    }
    .nd-header-drawer-account .nd-header-account-btn {
        width: 100%;
    }
    /* WordPress admin bar */
    body.admin-bar .nd-header-drawer,
    body.admin-bar .nd-header-drawer-overlay {
        top: 32px;
    }
}


/* =========================================================
   WP ADMIN BAR MOBILE
========================================================= */

@media screen and (max-width: 782px) {
    body.admin-bar .nd-header-drawer,
    body.admin-bar .nd-header-drawer-overlay {
        top: 46px;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media screen and (max-width: 575px) {
    .nd-header-container {
        width: calc(100% - 36px);
    }
    .nd-header-top {
        padding: 11px 0;
    }
    .nd-header-top-links {
        justify-content: center;
        gap: 18px;
    }
    .nd-header-top-links a {
        font-size: 14px;
    }
    .nd-header-main-row {
        grid-template-columns: minmax(0, 1fr) 50px;
        min-height: 80px;
        gap: 12px;
    }
    .nd-header-logo img {
        max-width: 190px;
        max-height: 60px;
    }
    .nd-header-drawer {
        width: min(360px, 92vw);
    }
}

@media screen and (max-width: 390px) {
    .nd-header-top-links {
        gap: 12px;
    }
    .nd-header-top-links a {
        font-size: 13px;
    }
    .nd-header-logo img {
        max-width: 175px;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .nd-new-header *,
    .nd-new-header *::before,
    .nd-new-header *::after {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}