/* Java Pro — Generic Header */

.java-pro-header {
    position: relative;
    z-index: 1000;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.java-pro-header-top {
    width: 100%;
}

.java-pro-header-top-inner {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.java-pro-brand-wrap {
    flex: 0 0 auto;
    min-width: 180px;
}

.java-pro-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.java-pro-brand img {
    display: block;
    max-width: 220px;
    width: auto;
    height: auto;
    max-height: 64px;
}

.java-pro-logo {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--java-pro-primary, #2563eb);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
}

.java-pro-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
}

.java-pro-brand-text strong {
    font-size: 18px;
    font-weight: 800;
}

.java-pro-brand-text small {
    color: #6b7280;
    font-size: 12px;
}

.java-pro-header-search {
    flex: 1 1 auto;
    min-width: 180px;
}

.java-pro-header-search form {
    position: relative;
    display: flex;
    width: 100%;
}

.java-pro-header-search input {
    width: 100%;
    min-height: 44px;
    padding: 0 48px 0 16px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
    color: #111827;
    outline: none;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.java-pro-header-search input:focus {
    border-color: var(--java-pro-primary, #2563eb);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.java-pro-header-search button {
    position: absolute;
    inset-inline-end: 0;
    top: 0;
    width: 48px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
}

.java-pro-header-search svg,
.java-pro-header-actions svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.java-pro-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.java-pro-account,
.java-pro-cart {
    position: relative;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    color: #374151;
    text-decoration: none;
    border-radius: 9px;
    transition: background .2s ease, color .2s ease;
}

.java-pro-account:hover,
.java-pro-cart:hover {
    color: var(--java-pro-primary, #2563eb);
    background: #f3f4f6;
}

.java-pro-cart b {
    position: absolute;
    top: 1px;
    inset-inline-end: 1px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--java-pro-primary, #2563eb);
    color: #fff;
    font-size: 10px;
    line-height: 1;
}

.java-pro-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 9px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
}

.java-pro-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 5px 0;
    background: #374151;
    border-radius: 2px;
}

.java-pro-nav-wrap {
    width: 100%;
    border-top: 1px solid #f3f4f6;
}

.java-pro-main-nav {
    width: 100%;
}

.java-pro-menu,
.java-pro-menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.java-pro-menu {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
}

.java-pro-menu > li {
    position: relative;
}

.java-pro-menu a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 15px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    transition: color .2s ease, background .2s ease;
}

.java-pro-menu a:hover,
.java-pro-menu a:focus {
    color: var(--java-pro-primary, #2563eb);
    background: #f9fafb;
}

.java-pro-menu .sub-menu {
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    z-index: 1100;
    min-width: 210px;
    padding: 8px 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

.java-pro-menu li:hover > .sub-menu,
.java-pro-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.java-pro-menu .sub-menu li {
    position: relative;
}

.java-pro-menu .sub-menu a {
    width: 100%;
    min-height: 42px;
    padding: 8px 14px;
    white-space: nowrap;
}

.java-pro-menu .sub-menu .sub-menu {
    top: -9px;
    inset-inline-start: 100%;
}

.java-pro-menu .menu-item-has-children > a::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-inline-start: 8px;
    border-inline-end: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

@media (max-width: 900px) {
    .java-pro-header-top-inner {
        min-height: 70px;
        gap: 12px;
    }

    .java-pro-brand-wrap {
        min-width: 0;
        flex: 1 1 auto;
    }

    .java-pro-header-search {
        flex: 0 0 42px;
        width: 42px;
        min-width: 42px;
    }

    .java-pro-header-search form {
        width: 42px;
    }

    .java-pro-header-search input {
        position: absolute;
        top: 52px;
        inset-inline-end: 0;
        z-index: 1200;
        width: min(320px, calc(100vw - 24px));
        opacity: 0;
        visibility: hidden;
    }

    .java-pro-header-search:focus-within input {
        opacity: 1;
        visibility: visible;
    }

    .java-pro-header-actions {
        gap: 2px;
    }

    .java-pro-account span {
        display: none;
    }

    .java-pro-menu-toggle {
        display: block;
    }

    .java-pro-nav-wrap {
        display: none;
    }

    .java-pro-menu-open .java-pro-nav-wrap {
        display: block;
    }

    .java-pro-menu {
        display: block;
        padding: 8px 0;
    }

    .java-pro-menu > li {
        border-bottom: 1px solid #f3f4f6;
    }

    .java-pro-menu a {
        min-height: 44px;
        padding: 8px 12px;
    }

    .java-pro-menu .sub-menu {
        position: static;
        display: none;
        width: 100%;
        min-width: 0;
        padding: 0 12px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .java-pro-menu li:hover > .sub-menu,
    .java-pro-menu li:focus-within > .sub-menu {
        display: none;
    }

    .java-pro-menu .sub-menu .sub-menu {
        position: static;
    }
}

@media (max-width: 560px) {
    .java-pro-header-top-inner {
        padding-inline: 12px;
    }

    .java-pro-brand-text small {
        display: none;
    }

    .java-pro-brand-text strong {
        font-size: 16px;
    }

    .java-pro-logo {
        width: 40px;
        height: 40px;
    }

    .java-pro-cart {
        padding: 0 6px;
    }
}


/* =========================================================
   MEGA MENU — MOVED FROM MAIN.CSS
   ========================================================= */

/* =========================================================
   MEGA MENU
   ========================================================= */

.java-pro-mega-menu {
    position: absolute;

    top: 100%;
    right: 0;

    width: 700px;

    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 0;

    padding: 24px;

    background: #ffffff;

    border:
        1px solid #e2e8f0;

    border-top: 0;

    border-radius:
        0 0 14px 14px;

    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.15);

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(8px);

    transition:
        opacity 160ms ease,
        visibility 160ms ease,
        transform 160ms ease;
}

.java-pro-mega-parent:hover > .java-pro-mega-menu {
    opacity: 1;

    visibility: visible;

    transform:
        translateY(0);
}

.java-pro-mega-column {
    display: flex;
    flex-direction: column;

    padding: 0 20px;
}

.java-pro-mega-column + .java-pro-mega-column {
    border-right: 1px solid #e2e8f0;
}

.java-pro-mega-column h3 {
    margin: 0 0 12px;

    color: #111827;

    font-size: 14px;
    font-weight: 900;
}

.java-pro-mega-column a {
    padding: 7px 0;

    color: #64748b;

    font-size: 13px;
    font-weight: 600;

    transition:
        color 160ms ease,
        padding-right 160ms ease;
}

.java-pro-mega-column a:hover {
    padding-right: 5px;

    color: #7c3aed;
}


/* =========================================================
   MOBILE BUTTON
   ========================================================= */

.java-pro-menu-toggle {
    width: 44px;
    height: 44px;

    display: none;

    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 5px;

    padding: 0;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    background: #ffffff;

    cursor: pointer;
}

.java-pro-menu-toggle span {
    display: block;

    width: 20px;
    height: 2px;

    border-radius: 2px;

    background: #334155;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 950px) {

    .java-pro-header-top-inner {
        min-height: 70px;

        gap: 12px;
    }

    .java-pro-brand-text strong {
        font-size: 16px;
    }

    .java-pro-header-search {
        max-width: none;
    }

    .java-pro-account-text {
        display: none;
    }

    .java-pro-account {
        width: 44px;

        padding: 0;
    }

    .java-pro-menu-toggle {
        display: flex;
    }

    .java-pro-nav-wrap {
        display: none;
    }

    .java-pro-menu-open .java-pro-nav-wrap {
        display: block;
    }

    .java-pro-main-nav {
        padding: 8px 0 14px;
    }

    .java-pro-main-nav > ul {
        flex-direction: column;

        align-items: stretch;
    }

    .java-pro-main-nav > ul > li > a {
        min-height: 44px;

        padding: 0 14px;

        border-radius: 8px;
    }

    .java-pro-mega-menu {
        position: static;

        width: auto;

        display: none;

        margin: 0 10px 8px;

        padding: 14px;

        border: 1px solid #e2e8f0;

        border-radius: 10px;

        box-shadow: none;

        opacity: 1;
        visibility: visible;

        transform: none;
    }

    .java-pro-mega-parent:hover > .java-pro-mega-menu {
        display: none;
    }

    .java-pro-mega-parent.java-pro-mobile-open
    > .java-pro-mega-menu {
        display: grid;
    }

    .java-pro-mega-column {
        padding: 8px 12px;
    }

    .java-pro-mega-column + .java-pro-mega-column {
        border-right: 0;

        border-top: 1px solid #e2e8f0;
    }
}


@media (max-width: 650px) {

    .java-pro-header-top-inner {
        flex-wrap: nowrap;
    }

    .java-pro-brand-text {
        display: none;
    }

    .java-pro-logo {
        width: 42px;
        height: 42px;
    }

    .java-pro-header-search input {
        height: 44px;

        font-size: 13px;
    }

    .java-pro-header-search button {
        width: 35px;
        height: 35px;
    }

    .java-pro-cart {
        width: 42px;
        height: 42px;
    }

    .java-pro-account {
        width: 42px;
        height: 42px;
    }

    .java-pro-menu-toggle {
        width: 42px;
        height: 42px;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 430px) {

    .java-pro-header-top-inner {
        gap: 7px;
    }

    .java-pro-logo {
        width: 38px;
        height: 38px;
    }

    .java-pro-account {
        display: none;
    }

    .java-pro-header-search input {
        padding-right: 12px;
    }
}


/* =========================================================
   Sticky Header
   ========================================================= */

.java-pro-header-sticky {
    position: sticky;
    top: 0;
    z-index: 1000;
}

body.admin-bar .java-pro-header-sticky {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .java-pro-header-sticky {
        top: 46px;
    }
}
