/* Shared customer-facing topbar (calendar / bookingsheet / reserve / store / …) */
.topbar {
    background: var(--surface, #ffffff);
    border-bottom: 1px solid var(--border, #dfe5ec);
    padding: 14px 20px;
}

.topbar-inner {
    max-width: var(--topbar-max-width, 1200px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
}

.topbar-logo-link {
    display: inline-flex;
    line-height: 0;
    text-decoration: none;
    color: inherit;
}

.topbar-logo {
    max-height: 52px;
    max-width: 220px;
}

.topbar-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.topbar .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: normal;
    text-decoration: none;
    color: var(--text, #101828);
    border: 1px solid var(--border, #dfe5ec);
    background: #fff;
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    box-sizing: border-box;
}

.topbar .nav-link:hover {
    background: var(--bg-soft, #f1f5f9);
}

.topbar .nav-link.active {
    background: #fffaeb;
    color: var(--warn, #b54708);
    border-color: #fedf89;
}

.topbar .nav-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.topbar .nav-link.sign-out {
    color: var(--danger, #b42318);
    border-color: #fecdca;
}

.topbar .lang-dd {
    position: relative;
}

.topbar .lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border, #dfe5ec);
    background: #fff;
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
}

.topbar .lang-toggle img {
    height: 18px;
    width: auto;
    display: block;
}

.topbar .lang-toggle .caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--muted, #667085);
}

.topbar .lang-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 6px;
    background: #fff;
    border: 1px solid var(--border, #dfe5ec);
    border-radius: 10px;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
    z-index: 50;
}

.topbar .lang-menu.open {
    display: block;
}

.topbar .lang-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text, #101828);
    font-size: 13px;
    font-weight: 600;
}

.topbar .lang-menu a:hover,
.topbar .lang-menu a.active {
    background: #f2f4f7;
}

.topbar .lang-menu a img {
    height: 14px;
    width: auto;
}

.topbar .location-dd {
    position: relative;
}

.topbar .location-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border, #dfe5ec);
    background: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #101828);
}

.topbar .location-toggle svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--muted, #667085);
}

.topbar .location-toggle .caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--muted, #667085);
}

.topbar .location-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 6px;
    background: #fff;
    border: 1px solid var(--border, #dfe5ec);
    border-radius: 10px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
    z-index: 50;
    padding: 6px 0;
}

.topbar .location-menu.open {
    display: block;
}

.topbar .location-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #101828);
    cursor: pointer;
}

.topbar .location-menu button:hover,
.topbar .location-menu button.active {
    background: #f2f4f7;
}

.topbar [data-customer-auth-button].customer-authenticated {
    background: #ecfdf3;
    color: var(--success, #027a48);
    border-color: #abefc6;
}

/* Phone + iPad: row1 centered logo; nav below, centered, wrapping as needed */
@media (max-width: 1024px) {
    .topbar {
        width: 100vw;
        max-width: 100vw;
        box-sizing: border-box;
        padding: 10px 16px;
    }

    .topbar-inner {
        width: 100%;
        max-width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .topbar-brand {
        order: 1;
        align-self: center;
        flex: 1 0 100%;
        width: auto;
        max-width: 100%;
        height: auto;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: visible;
    }

    .topbar-logo {
        display: block;
        width: auto;
        height: auto;
        max-width: min(240px, 72vw);
        max-height: 64px;
        object-fit: contain;
        object-position: center center;
    }

    .topbar-nav {
        display: contents;
    }

    .topbar .nav-link,
    .topbar .location-toggle,
    .topbar .lang-toggle {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .topbar .nav-link.sign-out {
        display: none;
    }

    .topbar [data-customer-auth-button] {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar .nav-link,
    .topbar .location-dd,
    .topbar .lang-dd {
        order: 2;
    }

    .topbar .location-menu {
        max-width: calc(100vw - 32px);
    }
}

/* iPad / iPad mini: taller centered logo */
@media (min-width: 641px) and (max-width: 1024px) {
    .topbar-logo {
        max-width: min(240px, 46vw);
        max-height: 72px;
    }
}

/* Phone-only tightening */
@media (max-width: 640px) {
    .topbar {
        padding: 8px 12px;
    }

    .topbar-inner {
        gap: 6px 8px;
    }

    .topbar-logo {
        max-height: 56px;
        max-width: min(200px, 68vw);
    }

    .topbar .nav-link {
        min-height: 36px;
        padding: 0 10px;
        font-size: 12px;
        border-radius: 8px;
        gap: 4px;
    }

    .topbar .nav-link svg {
        width: 14px;
        height: 14px;
    }

    .topbar-store-link .topbar-nav-text {
        display: none;
    }

    .topbar-store-link {
        padding: 5px 8px;
    }

    .topbar [data-customer-auth-button] {
        max-width: 108px;
    }

    .topbar .location-toggle {
        padding: 6px 10px;
        font-size: 12px;
        max-width: none;
    }

    .topbar .location-toggle svg {
        width: 12px;
        height: 12px;
    }

    #locationToggleLabel {
        overflow: visible;
        text-overflow: unset;
        white-space: nowrap;
    }

    .topbar .location-menu {
        max-width: calc(100vw - 24px);
    }

    .topbar .lang-toggle {
        min-height: 36px;
        padding: 0 10px;
        border-radius: 8px;
        gap: 4px;
    }

    .topbar .lang-toggle img {
        height: 16px;
    }
}

/* iPhone SE / narrow phones: keep nav rows inside ~375px */
@media (max-width: 400px) {
    .topbar {
        padding: 6px 8px;
    }

    .topbar-inner {
        gap: 4px 6px;
    }

    .topbar-logo {
        max-height: 48px;
        max-width: min(168px, 64vw);
    }

    .topbar .nav-link {
        min-height: 32px;
        padding: 0 8px;
        font-size: 11px;
    }

    .topbar [data-customer-auth-button] {
        max-width: 72px;
    }

    .topbar .location-dd {
        min-width: 0;
        max-width: 42%;
    }

    .topbar .location-toggle {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        padding: 4px 8px;
    }

    #locationToggleLabel {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar .lang-toggle {
        min-height: 32px;
        padding: 0 8px;
    }
}
