/* Site chrome for the customer marketplace: navigation bar and footer.
   Every class is dx- prefixed. Tokens come from marketplace.css. */

:root { --dx-nav-h: 64px; }

.dx-skip {
    position: absolute; left: 0.75rem; top: -60px; z-index: 200; padding: 0.7rem 1rem; border-radius: 10px;
    background: var(--ink); color: #fff; font-weight: 700; font-size: 0.9rem; transition: top 0.15s;
}
.dx-skip:focus { top: 0.75rem; }

/* ── Navigation ─────────────────────────────────────────────── */
.dx-nav {
    position: sticky; top: 0; z-index: 60;
    background: rgba(255, 255, 255, 0.88); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--line);
}
.dx-nav-inner {
    width: min(1600px, calc(100% - 3rem)); height: var(--dx-nav-h); margin: 0 auto;
    display: flex; align-items: center; gap: 2rem;
}
.dx-brand { display: inline-flex; align-items: center; gap: 0.6rem; flex: none; }
.dx-brand-logo { width: 32px; height: 32px; object-fit: contain; }
.dx-brand-name { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--ink); }

.dx-links { display: flex; align-items: center; gap: 0.25rem; margin-right: auto; }
.dx-link-item {
    position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.85rem;
    font-size: 0.93rem; font-weight: 600; color: var(--muted); transition: color 0.15s;
}
.dx-link-item::after {
    content: ""; position: absolute; left: 0.85rem; right: 0.85rem; bottom: 4px; height: 2px; border-radius: 2px;
    background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.2s ease;
}
.dx-link-item:hover { color: var(--ink); }
.dx-link-item:hover::after { transform: scaleX(0.4); }
.dx-link-item.is-active { color: var(--ink); }
.dx-link-item.is-active::after { transform: scaleX(1); }
.dx-links-account { display: none; }

.dx-actions { display: flex; align-items: center; gap: 0.4rem; flex: none; }
.dx-icon-btn {
    position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px; color: var(--ink); transition: background 0.15s;
}
.dx-icon-btn:hover { background: #f1f3f5; }
.dx-count-badge {
    position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: var(--ink); color: #fff; font-size: 0.68rem; font-weight: 800; line-height: 18px; text-align: center;
}
.dx-signin { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.85rem; font-size: 0.93rem; font-weight: 700; color: var(--ink); }
.dx-signin:hover { text-decoration: underline; text-underline-offset: 4px; }
.dx-nav .dx-btn, .dx-footer .dx-btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1.15rem;
    border-radius: 12px; border: 1.5px solid var(--ink); font: inherit; font-size: 0.92rem; font-weight: 700; cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.dx-nav .dx-btn:active { transform: translateY(1px); }
.dx-nav .dx-btn--dark { background: var(--ink); color: #fff; }
.dx-nav .dx-btn--dark:hover { background: #000; }

.dx-account { position: relative; }
.dx-account summary {
    list-style: none; display: inline-flex; align-items: center; gap: 0.55rem; min-height: 44px; padding: 0 0.6rem 0 0.3rem;
    border-radius: 999px; cursor: pointer; transition: background 0.15s;
}
.dx-account summary::-webkit-details-marker { display: none; }
.dx-account summary:hover, .dx-account[open] summary { background: #f1f3f5; }
.dx-avatar-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 999px; background: var(--ink); color: #fff; font-family: "Archivo", sans-serif; font-weight: 800; font-size: 0.9rem; }
.dx-account-name { font-size: 0.9rem; font-weight: 700; color: var(--ink); }
.dx-account-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; display: grid; padding: 0.4rem;
    background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 40px rgba(16, 18, 20, 0.14);
}
.dx-account-menu a { display: flex; align-items: center; min-height: 44px; padding: 0 0.85rem; border-radius: 10px; font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.dx-account-menu a:hover { background: #f4f6f8; }
.dx-account-menu a.is-danger { color: #b91c1c; }
.dx-menu-btn { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer; }
.dx-menu-btn:hover { background: #f1f3f5; }
.dx-menu-close { display: none; }
.dx-menu-btn[aria-expanded="true"] .dx-menu-open { display: none; }
.dx-menu-btn[aria-expanded="true"] .dx-menu-close { display: block; }

.dx-nav a:focus-visible, .dx-nav button:focus-visible, .dx-nav summary:focus-visible,
.dx-footer a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }

@media (max-width: 900px) {
    .dx-nav-inner { width: calc(100% - 1.25rem); gap: 0.5rem; }
    .dx-brand { margin-right: auto; }
    .dx-signin, .dx-nav .dx-join, .dx-account-name, .dx-search-link { display: none; }
    .dx-menu-btn { display: inline-flex; }
    /* Menu sheet: drops under the bar, full width, big touch rows. */
    .dx-links {
        position: absolute; left: 0; right: 0; top: 100%; margin: 0; display: none; flex-direction: column; align-items: stretch; gap: 0;
        padding: 0.5rem 0.75rem 1rem; background: #fff; border-bottom: 1px solid var(--line);
        box-shadow: 0 24px 40px rgba(16, 18, 20, 0.12); max-height: calc(100dvh - var(--dx-nav-h)); overflow-y: auto;
    }
    .dx-links.is-open { display: flex; }
    .dx-link-item { min-height: 52px; padding: 0 0.6rem; font-size: 1.05rem; border-bottom: 1px solid #f1f3f5; }
    .dx-link-item::after { display: none; }
    .dx-link-item.is-active { color: var(--ink); font-weight: 800; }
    .dx-link-item.is-active::before { content: ""; width: 4px; height: 20px; border-radius: 2px; background: var(--accent); margin-right: 0.7rem; }
    .dx-links-account { display: grid; gap: 0; margin-top: 0.5rem; }
    .dx-link-item--danger { color: #b91c1c; }
    .dx-links-join { margin-top: 0.9rem; min-height: 52px; }
}

/* Sticky elements elsewhere sit below the bar instead of sliding under it. */
.bp-tab-bar { top: var(--dx-nav-h); }
.bp-sidebar { top: calc(var(--dx-nav-h) + 54px); }
.cart-summary-card { top: calc(var(--dx-nav-h) + 16px); }

/* ── Footer ─────────────────────────────────────────────────── */
.dx-footer { margin-top: 3rem; background: #fff; border-top: 1px solid var(--line); }
.dx-footer-inner { width: min(1600px, calc(100% - 3rem)); margin: 0 auto; padding: 3rem 0 1.5rem; }
.dx-footer-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: start; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.dx-footer-brand .dx-brand { display: flex; }
.dx-footer-brand p { margin-top: 0.6rem; max-width: 42ch; font-size: 0.95rem; line-height: 1.6; }
.dx-footer-cta { justify-self: end; max-width: 440px; padding: 1.4rem 1.5rem; border-radius: 20px; background: var(--ink); color: #fff; }
.dx-footer-cta h2 { color: #fff; font-size: 1.25rem; font-weight: 800; }
.dx-footer-cta p { margin-top: 0.4rem; color: rgba(255, 255, 255, 0.78); font-size: 0.93rem; line-height: 1.5; }
.dx-footer-cta-link { margin-top: 1rem; display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; font-weight: 800; font-size: 0.95rem; color: #fff; border-bottom: 1.5px solid rgba(255, 255, 255, 0.4); align-self: flex-start; }
.dx-footer-cta-link:hover { border-bottom-color: #fff; }
.dx-footer .dx-footer-cta a:focus-visible { outline-color: #fff; }

.dx-footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; padding: 2.25rem 0; }
.dx-footer h3 { font-family: "Public Sans", sans-serif; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }
.dx-footer ul { list-style: none; margin: 0; padding: 0; }
.dx-footer-cols a { display: inline-flex; align-items: center; min-height: 36px; font-size: 0.93rem; color: var(--ink); }
.dx-footer-cols a:hover { text-decoration: underline; text-underline-offset: 3px; }
.dx-footer-types { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }

.dx-footer-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.dx-footer-copy { margin: 0; font-size: 0.85rem; color: var(--muted); margin-right: auto; }
.dx-footer-legal { display: flex; gap: 1.5rem; }
.dx-footer-legal a { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.85rem; color: var(--muted); }
.dx-footer-legal a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.dx-footer-social { display: flex; gap: 0.35rem; }
.dx-footer-social a { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--ink); transition: background 0.15s; }
.dx-footer-social a:hover { background: #f1f3f5; }

@media (max-width: 900px) {
    .dx-footer { margin-top: 2rem; }
    .dx-footer-inner { width: calc(100% - 1.25rem); padding-top: 2rem; }
    .dx-footer-top { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
    .dx-footer-cta { justify-self: stretch; max-width: none; }
    .dx-footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1.25rem; }
    .dx-footer-cols nav:nth-child(2) { grid-column: 1 / -1; order: 4; }
    .dx-footer-bottom { flex-direction: column; align-items: flex-start; }
    .dx-footer-copy { margin-right: 0; order: 3; }
    .dx-footer-social a { width: 44px; height: 44px; }
    .dx-footer-cols a { min-height: 44px; }
    .dx-brand { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .dx-link-item::after, .dx-skip, .dx-icon-btn, .dx-btn { transition: none; }
}

/* ──────────────────────────────────────────────────────────────────────────────
   Nav search
   A real field in the bar from 901px up; on phones the magnifier opens it as a
   full-width sheet, because an input cannot share that row with the brand, the
   cart and the menu button. Styles live here, not in discover.css, because that
   sheet only loads on the discovery pages and this has to work everywhere.
   ────────────────────────────────────────────────────────────────────────────── */

.nav-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: clamp(220px, 26vw, 340px);
    height: 40px;
    padding: 0 0.85rem;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: #fff;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, width 0.2s ease;
}

.nav-search:focus-within {
    width: clamp(260px, 30vw, 400px);
    border-color: var(--ink);
    box-shadow: 0 0 0 4px rgba(16, 18, 20, 0.07);
}

.nav-search-icon { flex: none; color: var(--muted); }

.nav-search-input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 0.88rem;
    color: var(--ink);
}

.nav-search-input::placeholder { color: #6b737c; }
.nav-search-input::-webkit-search-cancel-button { cursor: pointer; }

/* The back arrow and the magnifier toggle are phone-only affordances. */
.nav-search-back,
.nav-search-toggle { display: none; }

.nav-suggest {
    position: absolute;
    z-index: 70;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    max-height: min(60vh, 24rem);
    margin: 0;
    padding: 0.35rem;
    overflow-y: auto;
    list-style: none;
    background: #fff;
    border: 1.5px solid var(--line-strong, #d4d9de);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(16, 18, 20, 0.16);
}

.nav-suggest[hidden] { display: none; }

.nav-suggest li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    cursor: pointer;
}

.nav-suggest li:hover,
.nav-suggest li.is-active { background: #f1f4f7; }

.nav-suggest .dx-suggest-title { font-weight: 600; color: var(--ink); }
.nav-suggest .dx-suggest-meta { flex-shrink: 0; font-size: 0.85rem; color: var(--muted); }

@media (max-width: 900px) {
    /* Closed: the field is out of the bar and only the magnifier shows. */
    .nav-search { display: none; }
    .nav-search-toggle { display: inline-flex; }

    body.nav-search-open .nav-search {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 80;
        display: flex;
        width: auto;
        height: var(--dx-nav-h, 64px);
        padding: 0 0.75rem;
        border: 0;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
        background: #fff;
        box-shadow: 0 10px 30px rgba(16, 18, 20, 0.1);
    }

    body.nav-search-open .nav-search-back {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: none;
        width: 38px;
        height: 38px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: var(--ink);
        cursor: pointer;
    }

    body.nav-search-open .nav-search-back:hover { background: #f1f3f5; }
    body.nav-search-open .nav-search-icon { display: none; }
    body.nav-search-open .nav-search-input { font-size: 1rem; }

    body.nav-search-open .nav-suggest {
        top: calc(var(--dx-nav-h, 64px) + 1px);
        left: 0;
        right: 0;
        max-height: calc(100vh - var(--dx-nav-h, 64px) - 1px);
        border: 0;
        border-radius: 0;
        box-shadow: 0 18px 40px rgba(16, 18, 20, 0.12);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-search, .nav-search:focus-within { transition: none; }
}
