/* =========================================================
   OPENMARKET MAIN NAVBAR
   Fully functional mobile toggle
========================================================= */

.openmarket-navbar {
    width: 100%;
    height: 76px;
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
    position: sticky;
    top: 0;
    z-index: 999;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* Required so mobile menu positions under the bar */
    position: sticky;
}

/* Keep relative positioning context for absolute mobile menu */
.openmarket-navbar {
    position: sticky;
}

.openmarket-navbar-container {
    width: min(1400px, calc(100% - 40px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 28px;
    position: relative;
}

/* =========================================================
   BRAND
========================================================= */

.openmarket-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
    white-space: nowrap;
}

.openmarket-logo {
    display: block;
    width: 60px;
    height: 48px;
    object-fit: contain;
}

.openmarket-brand-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.openmarket-brand-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #111827;
    line-height: 1;
}

.openmarket-brand-tagline {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    color: #6b7280;
    line-height: 1;
}

@media (max-width: 768px) {
    .openmarket-brand {
        gap: 7px;
    }

    .openmarket-logo {
        width: 48px;
        height: 40px;
    }

    .openmarket-brand-text {
        font-size: 1.15rem;
    }

    .openmarket-brand-tagline {
        font-size: 0.58rem;
    }

    .openmarket-brand-info {
        gap: 2px;
    }
}

/* =========================================================
   DESKTOP NAVIGATION
========================================================= */

.openmarket-desktop-navigation {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 4px;
    flex-shrink: 0;
}

.openmarket-nav-link {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 11px;
    border: 0;
    background: transparent;
    color: #52606d;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
    font-family: inherit;
}

.openmarket-nav-link i {
    font-size: 14px;
}

.openmarket-nav-link:hover {
    color: #071a2d;
    background: #f7f8fa;
}

.openmarket-nav-link.is-active {
    color: #ff5a00;
    font-weight: 600;
}

.openmarket-nav-link.is-active i {
    color: #ff5a00;
}

/* =========================================================
   CATEGORY DROPDOWN
========================================================= */

.openmarket-nav-dropdown {
    position: relative;
}

.openmarket-dropdown-button {
    appearance: none;
}

.openmarket-chevron {
    font-size: 10px !important;
    margin-left: 1px;
    transition: transform 0.2s ease;
}

.openmarket-nav-dropdown.is-open .openmarket-chevron {
    transform: rotate(180deg);
}

.openmarket-dropdown-menu {
    position: absolute;
    top: calc(100% + 9px);
    left: 50%;
    width: 245px;
    transform: translateX(-50%) translateY(-5px);
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 15px 45px rgba(7, 26, 45, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
    z-index: 1000;
}

.openmarket-nav-dropdown.is-open .openmarket-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.openmarket-dropdown-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 11px;
    border-radius: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
}

.openmarket-dropdown-item:hover {
    background: #fff5ef;
    color: #ff5a00;
}

.openmarket-category-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    background: #f7f8fa;
    color: #071a2d;
    transition: background 0.18s ease, color 0.18s ease;
}

.openmarket-dropdown-item:hover .openmarket-category-icon {
    background: #ff5a00;
    color: #ffffff;
}

.openmarket-dropdown-divider {
    height: 1px;
    margin: 7px 4px;
    background: #eeeeee;
}

.openmarket-dropdown-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 11px;
    color: #ff5a00;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
}

.openmarket-dropdown-all:hover {
    background: #fff5ef;
}

.openmarket-dropdown-all i {
    font-size: 13px;
}

/* =========================================================
   SEARCH
========================================================= */

.openmarket-search-form {
    height: 42px;
    flex: 1;
    min-width: 160px;
    max-width: 390px;
    display: flex;
    align-items: center;
    background: #f7f8fa;
    border: 1px solid #edf0f2;
    border-radius: 9px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.openmarket-search-form:focus-within {
    background: #ffffff;
    border-color: #ff5a00;
    box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.08);
}

.openmarket-search-icon {
    margin-left: 13px;
    color: #7b8794;
    font-size: 15px;
}

.openmarket-search-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 10px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #071a2d;
    font-family: inherit;
    font-size: 13px;
}

.openmarket-search-input::placeholder {
    color: #9aa5b1;
}

.openmarket-search-button {
    width: 38px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #52606d;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.openmarket-search-button:hover {
    background: #ff5a00;
    color: #ffffff;
}

/* =========================================================
   SELL BUTTON
========================================================= */

.openmarket-navbar-actions {
    flex-shrink: 0;
}

.openmarket-sell-button {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    background: #ff5a00;
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 5px 14px rgba(255, 90, 0, 0.18);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.openmarket-sell-button:hover {
    background: #e84f00;
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(255, 90, 0, 0.25);
}

.openmarket-sell-button i {
    font-size: 14px;
}

/* =========================================================
   MOBILE ACTIONS
========================================================= */

.openmarket-mobile-actions {
    display: none;
    margin-left: auto;
    align-items: center;
    gap: 5px;
}

.openmarket-mobile-search-button,
.openmarket-menu-button {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #071a2d;
    cursor: pointer;
    font-family: inherit;
}

.openmarket-mobile-search-button:hover,
.openmarket-menu-button:hover {
    background: #f7f8fa;
}

.openmarket-mobile-search-button {
    font-size: 17px;
}

.openmarket-mobile-search-button.is-active {
    background: #fff5ef;
    color: #ff5a00;
}

/* Hamburger */
.openmarket-menu-button {
    flex-direction: column;
    gap: 4px;
}

.openmarket-menu-button span {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 5px;
    background: #071a2d;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.openmarket-menu-button.is-open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.openmarket-menu-button.is-open span:nth-child(2) {
    opacity: 0;
}

.openmarket-menu-button.is-open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* =========================================================
   MOBILE SEARCH
========================================================= */

.openmarket-mobile-search {
    display: none;
    padding: 10px 16px 12px;
    background: #ffffff;
    border-top: 1px solid #eeeeee;
    border-bottom: 1px solid #eeeeee;
}

.openmarket-mobile-search.is-open {
    display: block;
}

.openmarket-mobile-search-form {
    width: 100%;
}

.openmarket-mobile-search-input-wrapper {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    background: #f7f8fa;
    border: 1px solid #edf0f2;
    border-radius: 9px;
    overflow: hidden;
}

.openmarket-mobile-search-input-wrapper > i {
    margin-left: 13px;
    color: #7b8794;
}

.openmarket-mobile-search-input-wrapper input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 10px;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    color: #071a2d;
}

.openmarket-mobile-search-input-wrapper button {
    width: 44px;
    height: 100%;
    border: 0;
    background: #ff5a00;
    color: #ffffff;
    cursor: pointer;
}

/* =========================================================
   MOBILE MENU  (critical for toggle)
========================================================= */

.openmarket-mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
    box-shadow: 0 18px 40px rgba(7, 26, 45, 0.12);
    z-index: 998;
    max-height: min(80vh, 640px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.openmarket-mobile-menu.is-open {
    display: block;
}

.openmarket-mobile-menu-inner {
    width: min(100%, 700px);
    margin: 0 auto;
    padding: 12px 16px 20px;
}

.openmarket-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.openmarket-mobile-nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: transparent;
    border-radius: 9px;
    color: #334155;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.openmarket-mobile-nav-link:hover,
.openmarket-mobile-nav-link.is-active {
    background: #fff5ef;
    color: #ff5a00;
}

.openmarket-mobile-nav-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    background: #f7f8fa;
    color: #071a2d;
}

.openmarket-mobile-nav-link:hover .openmarket-mobile-nav-icon,
.openmarket-mobile-nav-link.is-active .openmarket-mobile-nav-icon {
    background: #ff5a00;
    color: #ffffff;
}

.openmarket-mobile-category-button {
    position: relative;
}

.mobile-category-chevron {
    margin-left: auto;
    font-size: 11px;
    transition: transform 0.2s ease;
}

.openmarket-mobile-category-button.is-open .mobile-category-chevron {
    transform: rotate(180deg);
}

.openmarket-mobile-categories {
    display: none;
    margin: 0 0 5px 46px;
    padding: 4px 0 4px 10px;
    border-left: 1px solid #eeeeee;
}

.openmarket-mobile-categories.is-open {
    display: block;
}

.openmarket-mobile-categories a {
    min-height: 39px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    color: #64748b;
    font-size: 13px;
    text-decoration: none;
    border-radius: 7px;
}

.openmarket-mobile-categories a:hover {
    color: #ff5a00;
    background: #fff5ef;
}

.openmarket-mobile-categories i {
    width: 18px;
    text-align: center;
}

.openmarket-mobile-seller {
    margin-top: 14px;
    padding-top: 16px;
    border-top: 1px solid #eeeeee;
}

.openmarket-mobile-seller-heading {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 13px;
}

.openmarket-mobile-seller-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9px;
    background: #fff5ef;
    color: #ff5a00;
    font-size: 18px;
}

.openmarket-mobile-seller-heading strong {
    display: block;
    color: #071a2d;
    font-size: 13px;
}

.openmarket-mobile-seller-heading small {
    display: block;
    margin-top: 3px;
    color: #8a96a3;
    font-size: 11px;
    line-height: 1.4;
}

.openmarket-mobile-seller-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.openmarket-mobile-sell-button,
.openmarket-mobile-login-button {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.openmarket-mobile-sell-button {
    background: #ff5a00;
    color: #ffffff;
}

.openmarket-mobile-sell-button:hover {
    background: #e84f00;
}

.openmarket-mobile-login-button {
    background: #f7f8fa;
    color: #071a2d;
    border: 1px solid #e9ecef;
}

.openmarket-mobile-login-button:hover {
    background: #eef1f4;
}

/* Lock body scroll when mobile menu is open */
body.openmarket-menu-active {
    overflow: hidden;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1200px) {
    .openmarket-navbar-container {
        gap: 18px;
    }

    .openmarket-nav-link {
        padding: 0 8px;
        font-size: 12px;
    }

    .openmarket-nav-link i {
        font-size: 13px;
    }

    .openmarket-sell-button {
        padding: 0 12px;
        font-size: 11px;
    }
}

@media (max-width: 1050px) {
    .openmarket-desktop-navigation {
        gap: 0;
    }

    .openmarket-nav-link {
        padding: 0 7px;
    }

    .openmarket-nav-link span {
        display: none;
    }

    .openmarket-nav-link i {
        font-size: 16px;
    }

    .openmarket-chevron {
        display: none;
    }

    .openmarket-dropdown-button {
        gap: 0;
    }
}

/* Mobile breakpoint — show hamburger, hide desktop nav */
@media (max-width: 800px) {
    .openmarket-navbar {
        height: 68px;
    }

    .openmarket-navbar-container {
        width: calc(100% - 24px);
        gap: 0;
    }

    .openmarket-desktop-navigation,
    .openmarket-search-form,
    .openmarket-navbar-actions {
        display: none !important;
    }

    .openmarket-mobile-actions {
        display: flex !important;
    }
}

@media (max-width: 480px) {
    .openmarket-navbar {
        height: 64px;
    }

    .openmarket-navbar-container {
        width: calc(100% - 16px);
    }

    .openmarket-mobile-search-button,
    .openmarket-menu-button {
        width: 39px;
        height: 39px;
    }

    .openmarket-mobile-menu-inner {
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .openmarket-nav-link,
    .openmarket-dropdown-menu,
    .openmarket-sell-button,
    .openmarket-mobile-nav-link,
    .openmarket-menu-button span {
        transition: none;
    }
}