html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* ===== DDܼ ===== */


.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem var(--surface), 0 0 0 0.25rem var(--ring);
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
    background-color: var(--background-color);
    color: var(--text-color);
}

.form-label.required::after,
.required-label::after {
    content: " *";
    color: #dc3545;
    font-weight: 700;
}

/* X Product Grid / Card X */
.p-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 12px;
}

@media (min-width:768px) {
    .p-grid {
        grid-template-columns: repeat(4,1fr);
    }
}

.p-card {
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 12px;
    background: var(--product-bg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.p-card__img {
    display: block;
    aspect-ratio: 4/3; /* ϤϩTw */
    background: #f8f9fa;
}

    .p-card__img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.p-card__body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.p-card__name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--secondary-color);
}

.p-card__store,
.p-card__snippet {
    font-size: 12px;
    color: rgba(154,55,52,.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p-card__price {
    margin-top: 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary-color);
}

/* ===== Header ===== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: var(--primary-color);
    border-bottom: 1px solid rgba(0,0,0,.12);
    color: var(--header-text);
}

    .topbar .brand {
        display: flex;
        align-items: center;
        gap: 12px;
        text-decoration: none;
        color: var(--header-text);
    }

        .topbar .brand img {
            width: 54px;
            height: 54px;
            border-radius: 50%;
            object-fit: cover;
        }

        .topbar .brand span {
            font-weight: 600;
            font-size: 20px;
            letter-spacing: .5px;
        }

    .topbar .search {
        flex: 1;
        display: flex;
        align-items: center;
        max-width: 540px;
        margin: 0 24px;
        position: relative;
        background: var(--header-text);
        border-radius: 22px;
        overflow: hidden;
    }

        .topbar .search input {
            flex: 1;
            height: 40px;
            border: 0;
            border-right: 0;
            padding: 0 44px 0 14px;
            outline: none;
            background: transparent;
            color: var(--secondary-color);
        }

        .topbar .search .clear {
            position: absolute;
            right: 92px;
            top: 50%;
            transform: translateY(-50%);
            border: 0;
            background: transparent;
            font-size: 18px;
            color: #555;
            display: none;
        }

        .topbar .search input:not(:placeholder-shown) ~ .clear {
            display: block;
        }

        .topbar .search .submit {
            height: 40px;
            border: 0;
            background: var(--secondary-color);
            color: var(--header-text);
            padding: 0 18px;
        }

/* vjMU */
.search-history-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--product-bg);
    border: 1px solid rgba(0,0,0,.12);
    border-top: none;
    z-index: 1050;
    max-height: 220px;
    overflow-y: auto;
}

.search-history-item {
    display: block;
    width: 100%;
    padding: 6px 10px;
    text-align: left;
    border: 0;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
}

    .search-history-item:hover {
        background: rgba(0,0,0,.03);
    }

.topbar .account {
    min-width: 64px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* |Y & nJs */
.avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 12px;
    background: var(--header-text);
    padding: 4px 8px;
    color: var(--secondary-color);
}

    .avatar-btn img {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        object-fit: cover;
    }

.signin-btn {
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 12px;
    background: var(--header-text);
    padding: 6px 12px;
    color: var(--secondary-color);
}

@media (max-width: 768px) {
    .topbar {
        padding: 10px 12px;
    }

        .topbar .brand span {
            display: none;
        }

        .topbar .search {
            margin: 0 12px;
            max-width: none;
        }
}

/*  */
.hero {
    margin: 12px 0 20px;
}

    /* ===== Banner slider ===== */
    .hero .slider {
        position: relative;
        overflow: hidden; /* Guܤ@ */
        border-radius: 12px;
        box-shadow: 0 6px 12px rgba(0,0,0,.12);
    }

        .hero .slider .slides {
            display: flex; /* VƦC */
            transition: transform .5s ease;
            will-change: transform;
        }

            /* CӤl]<a>  <img>^ 100% e */
            .hero .slider .slides > * {
                flex: 0 0 100%;
                width: 100%;
            }

        .hero .slider img {
            display: block;
            width: 100%;
            height: auto;
            object-fit: cover;
            aspect-ratio: 21 / 7; /* ݭnTweҴNOdFnNR */
        }

        /* kbYi */
        .hero .slider .nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 36px;
            height: 36px;
            border: 0;
            border-radius: 50%;
            background: var(--overlay);
            color: var(--surface);
            line-height: 36px;
            font-size: 20px;
            cursor: pointer;
        }

            .hero .slider .nav.prev {
                left: 8px;
            }

            .hero .slider .nav.next {
                right: 8px;
            }

/* ϶D */
.sec-title {
    text-align: center;
    margin: 18px 0;
    font-weight: 600;
    color: var(--secondary-color);
}

/* ]Vdưʡ^ */
.hot-wrap {
    position: relative;
}

.hot-row {
    display: flex;
    gap: 16px;
    overflow: auto;
    scroll-behavior: smooth;
    padding: 2px 4px 6px;
}

.card-p {
    width: 240px;
    min-width: 240px;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 10px;
    background: var(--product-bg);
}

    .card-p .thumb {
        width: 100%;
        height: 160px;
        object-fit: cover;
        border-radius: 10px 10px 0 0;
    }

    .card-p .body {
        padding: 10px;
    }

    .card-p .name {
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: var(--secondary-color);
    }

    .card-p .muted {
        color: rgba(154,55,52,.7);
        font-size: .9rem;
    }

/* kbY */
.hot-wrap .arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--overlay);
    color: var(--surface);
    border: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

    .hot-wrap .arrow.left {
        left: -6px;
    }

    .hot-wrap .arrow.right {
        right: -6px;
    }

/* KB */
.vouchers {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 14px;
}

.voucher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px dashed var(--secondary-color);
    border-radius: 10px;
    padding: 12px 14px;
    background: var(--product-bg);
}

    .voucher .txt {
        line-height: 1.2;
        color: var(--secondary-color);
    }

    .voucher .btn {
        border: none;
        background: var(--secondary-color);
        border-radius: 8px;
        padding: 6px 10px;
        color: var(--header-text);
    }

/* Lӫ~ 54 */
.grid-5x4 {
    display: grid;
    grid-template-columns: repeat(5,1fr);
    gap: 16px;
}

    .grid-5x4 .card-p {
        width: auto;
        min-width: 0;
    }

/* Footer ²]pGΡ^ */
.simple-footer {
    margin-top: 24px;
    border-top: 1px solid rgba(0,0,0,.08);
    padding: 20px 0;
    color: var(--text-color);
}

    .simple-footer .cols {
        display: grid;
        grid-template-columns: repeat(3,1fr);
        gap: 16px;
    }

    .simple-footer a {
        color: var(--secondary-color);
        text-decoration: none;
    }

@media (max-width: 992px) {
    .vouchers {
        grid-template-columns: repeat(2,1fr);
    }

    .grid-5x4 {
        grid-template-columns: repeat(3,1fr);
    }
}

@media (max-width: 576px) {
    .grid-5x4 {
        grid-template-columns: repeat(2,1fr);
    }
}

.favorite-btn {
    border: 0;
    background: transparent;
    color: #9b6a55;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    cursor: pointer;
    font-size: .9rem;
    line-height: 1.2;
}

.favorite-btn.is-active,
.favorite-btn:hover {
    color: #c0392b;
}

.favorite-btn:disabled {
    opacity: .65;
    cursor: wait;
}

.favorite-icon {
    font-size: 1rem;
    line-height: 1;
}

.favorite-btn--detail {
    border: 1px solid rgba(155, 106, 85, .35);
    border-radius: 999px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, .72);
    font-weight: 700;
}

.favorite-btn--detail.is-active {
    border-color: rgba(192, 57, 43, .35);
    background: rgba(192, 57, 43, .08);
}

.pd-favorite-row {
    margin: 8px 0 14px;
}

.favorite-card__name {
    color: inherit;
    display: block;
    text-decoration: none;
}

.favorite-card__name:hover {
    color: #9a3734;
}

.favorite-empty__icon {
    color: #c0392b;
    font-size: 2.4rem;
}

.favorite-grid {
    align-items: stretch;
}

/* Footer - JOGO  */
.jogo-footer {
    border-top: 1px solid rgba(0,0,0,.1);
    margin-top: 40px;
    padding: 24px 0 16px;
    background: var(--secondary-color);
    color: var(--header-text);
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

    .jogo-footer .top {
        display: flex;
        gap: 32px;
        align-items: flex-start;
    }

    .jogo-footer .brand {
        width: 160px;
    }

        .jogo-footer .brand img {
            width: 64px;
            height: 64px;
            object-fit: contain;
        }

        .jogo-footer .brand .ig {
            display: inline-block;
            margin-top: 8px;
            color: var(--header-text);
            text-decoration: none;
/*            border: 1px solid var(--header-text);*/
            border-radius: 10px;
            padding: 4px 8px;
        }

    .jogo-footer .cols {
        display: flex;
        gap: 80px;
        flex-wrap: wrap;
    }

        .jogo-footer .cols .hd {
            font-weight: 600;
            margin-bottom: 8px;
        }

        .jogo-footer .cols a {
            display: block;
            color: var(--header-text);
            text-decoration: none;
            line-height: 1.9;
        }

            .jogo-footer .cols a:hover {
                text-decoration: underline;
            }

    .jogo-footer .bottom {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        border-top: 1px solid rgba(248,238,222,.4);
        margin-top: 16px;
        padding-top: 12px;
        font-size: 14px;
        color: var(--header-text);
    }


/* LINE Modal - match JOGO footer theme */

.line-login-modal .modal-content {
    background: var(--secondary-color);
    color: var(--header-text);
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 14px;
}



.line-login-modal .modal-header {
    border-bottom: 1px solid rgba(248,238,222,.4);
}



.line-login-modal .modal-title {
    font-weight: 600;
}



.line-login-modal .modal-body {
    padding: 16px 16px 18px;
}



/* Close button 在深色背景更清楚 */

.line-login-modal .btn-close {
    filter: invert(1) grayscale(100%);
    opacity: .85;
}



    .line-login-modal .btn-close:hover {
        opacity: 1;
    }



/* 視窗不要太窄（你有 modal-sm，這行會把寬度拉回來） */

#lineLoginModal .modal-dialog {
    max-width: 360px;
}



/* QR 外框改用 wrapper */

.line-login-modal .qr-box {
    display: inline-block;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(248,238,222,.4);
    background: rgba(255,255,255,.08);
}



/* img 本身不要 padding/border，避免「框擠內容」 */

.line-login-modal .line-qr {
    display: block;
    width: 220px;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}



/* 「官方好友」文字不要跟框黏在一起 */

.line-login-modal .line-hint {
    color: var(--header-text);
    opacity: .9;
    font-size: 14px;
}





/* LINE 登入按鈕：LINE 綠 */

.line-login-modal .line-login-link {
    background: #06C755;
    border: 1px solid #06C755;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 600;
    text-align: center;
}



    .line-login-modal .line-login-link:hover {
        filter: brightness(0.95);
        text-decoration: none;
    }



    .line-login-modal .line-login-link:focus {
        outline: none;
        box-shadow: 0 0 0 .2rem rgba(6, 199, 85, .35);
    }



    .line-login-modal .line-login-link:hover {
        text-decoration: underline;
    }





/* ʪs */
.nav-cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(248,238,222,.7);
    background: var(--header-text);
    text-decoration: none;
    color: var(--secondary-color);
}

    .nav-cart-btn .icon-cart {
        font-size: 18px;
    }

    .nav-cart-btn .badge {
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        border-radius: 999px;
        font-size: 11px;
        line-height: 18px;
        text-align: center;
        background: var(--secondary-color);
        color: var(--header-text);
    }

@media (max-width:768px) {
    .jogo-footer .top {
        flex-direction: column;
    }

    .jogo-footer .bottom {
        flex-direction: column;
    }
}

/* 首頁個人化推薦 */
.home-recommend-section {
    margin-top: 32px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-heading h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #6f4e37;
    margin: 0;
}

.section-heading p {
    color: #8a7b6a;
    margin: 4px 0 0;
}

.recommend-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.recommend-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(120, 90, 60, .14);
    border-radius: 18px;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}

.recommend-card:hover {
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(80, 60, 40, .12);
}

.recommend-card__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #f5efe5;
}

.recommend-card__body {
    padding: 12px 14px;
}

.recommend-card__title {
    font-weight: 600;
    color: #5f4637;
    line-height: 1.4;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommend-card__price {
    margin-top: 8px;
    font-weight: 700;
    color: #7a4e3a;
}

.recommend-card__meta {
    margin-top: 6px;
    font-size: .82rem;
    color: #8a7b6a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 992px) {
    .recommend-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .recommend-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .recommend-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Buyer frontend RWD hardening - 2026-06-02
   Scope: shared buyer layout, home cards, favorites, member pages
   ========================================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

img, svg, video {
    max-width: 100%;
}

body {
    overflow-x: hidden;
}

.container,
.container-fluid,
.row,
[class^="col-"],
[class*=" col-"] {
    min-width: 0;
}

.table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.topbar {
    min-width: 0;
    flex-wrap: wrap;
}

.topbar .brand,
.topbar .account,
.topbar .search {
    min-width: 0;
}

.topbar .search {
    flex: 1 1 320px;
}

.topbar .account {
    align-items: center;
    flex-wrap: nowrap;
}

.grid-5x4 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid-5x4 .card-p,
.favorite-grid .card-p {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.grid-5x4 .card-p .thumb,
.favorite-grid .card-p .thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.card-p .body,
.favorite-card .body {
    min-width: 0;
}

.card-p .name,
.favorite-card__name,
.card-p .muted {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.favorite-card form,
.favorite-card .btn {
    max-width: 100%;
}

@media (max-width: 1200px) {
    .grid-5x4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .grid-5x4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .vouchers {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .simple-footer .cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .topbar {
        justify-content: flex-start;
        gap: 10px;
        padding: 10px 14px;
    }

    .topbar .brand {
        flex: 0 0 auto;
    }

    .topbar .brand img {
        width: 44px;
        height: 44px;
    }

    .topbar .search {
        order: 3;
        flex: 1 0 100%;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .topbar .search input {
        min-width: 0;
        padding-right: 40px;
    }

    .topbar .search .clear {
        right: 78px;
    }

    .topbar .search .submit {
        flex: 0 0 auto;
        padding: 0 14px;
        white-space: nowrap;
    }

    .topbar .account {
        margin-left: auto;
        gap: 8px;
    }

    .avatar-btn {
        padding: 4px 6px;
    }

    .avatar-btn img {
        width: 32px;
        height: 32px;
    }

    .nav-cart-btn {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
    }

    .hero .slider img {
        aspect-ratio: 16 / 8;
    }

    .hot-row {
        gap: 12px;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
    }

    .hot-row .card-p {
        width: 190px;
        min-width: 190px;
        scroll-snap-align: start;
    }

    .hot-wrap .arrow {
        display: none;
    }

    .jogo-footer .cols,
    .jogo-footer .bottom {
        gap: 16px;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .grid-5x4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .grid-5x4 .card-p .thumb,
    .favorite-grid .card-p .thumb {
        height: 132px;
    }

    .card-p .body {
        padding: 9px;
    }

    .card-p .name {
        font-size: .92rem;
    }

    .card-p .muted,
    .favorite-btn {
        font-size: .8rem;
    }

    .vouchers {
        grid-template-columns: 1fr;
    }

    .voucher {
        align-items: flex-start;
        gap: 10px;
        flex-direction: column;
    }

    .voucher .btn {
        width: 100%;
    }

    .simple-footer .cols {
        grid-template-columns: 1fr;
    }

    .simple-footer .bottom,
    .jogo-footer .bottom {
        flex-direction: column;
    }

    .member-center {
        margin-top: 10px;
    }

    .member-sidebar-card,
    .profile-info-card {
        width: 100%;
    }

    .profile-info-card .d-flex,
    .favorite-page > .d-flex {
        align-items: flex-start !important;
    }
}

@media (max-width: 380px) {
    .grid-5x4 {
        grid-template-columns: 1fr;
    }

    .hot-row .card-p {
        width: 78vw;
        min-width: 78vw;
    }
}

/* =========================================================
   Mobile header search width fix - 2026-06-02
   Scope: frontend topbar only
   ========================================================= */
@media (max-width: 576px) {
    .topbar {
        justify-content: space-between;
        align-items: center;
    }

    .topbar .brand {
        order: 0;
        flex: 0 0 auto;
    }

    .topbar .account {
        order: 1;
        margin-left: auto;
        flex: 0 0 auto;
    }

    .topbar .search,
    .topbar .header-search,
    .topbar .search-form {
        order: 2;
        flex: 0 0 100%;
        width: calc(100% - 48px);
        max-width: 340px;
        margin: 8px auto 0;
        display: flex;
    }

    .topbar .search input,
    .topbar .header-search input,
    .topbar .search-form input {
        flex: 1 1 auto;
        min-width: 0;
        height: 38px;
    }

    .topbar .search .submit,
    .topbar .header-search .submit,
    .topbar .search-form .submit {
        flex: 0 0 72px;
        width: 72px;
        padding: 0;
        white-space: nowrap;
    }

    .topbar .search .clear {
        right: 74px;
    }
}

/* =========================================================
   Front header compact mobile search - 2026-06-02
   Scope: frontend _Layout topbar search only
   ========================================================= */
/* =========================================================
   Front buyer header mobile fix
   Logo / Search / Actions same row
   ========================================================= */
@media (max-width: 576px) {
    .topbar.front-header {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) auto;
        grid-template-areas: "brand search actions";
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 8px 12px;
        flex-wrap: nowrap;
    }

        .topbar.front-header .front-brand {
            grid-area: brand;
            display: flex;
            align-items: center;
            min-width: 0;
            margin: 0;
        }

            .topbar.front-header .front-brand img {
                width: 40px;
                height: 40px;
                object-fit: contain;
                flex: 0 0 auto;
            }

            /* 手機版先隱藏 JOGO二手交易文字，搜尋框才放得進第一列 */
            .topbar.front-header .front-brand .brand-text,
            .topbar.front-header .front-brand-name {
                display: none;
            }

        .topbar.front-header .front-header-search {
            grid-area: search;
            order: 0;
            flex: initial;
            width: 100%;
            max-width: none;
            min-width: 0;
            margin: 0;
            display: flex;
            align-items: stretch;
            height: 38px;
            background: var(--header-text);
            border-radius: 999px;
            overflow: hidden;
        }

            .topbar.front-header .front-header-search input,
            .topbar.front-header .front-header-search .form-control {
                flex: 1 1 auto;
                min-width: 0;
                width: auto;
                height: 38px;
                border: 0;
                font-size: 0.85rem;
                padding: 0 10px;
                border-radius: 999px 0 0 999px;
                background: transparent;
            }

            .topbar.front-header .front-header-search .submit,
            .topbar.front-header .front-header-search button[type="submit"] {
                flex: 0 0 56px;
                width: 56px;
                height: 38px;
                padding: 0;
                border: 0;
                font-size: 0.82rem;
                white-space: nowrap;
                border-radius: 0 999px 999px 0;
                background: var(--secondary-color);
                color: var(--header-text);
            }

            .topbar.front-header .front-header-search .clear {
                right: 56px;
                width: 24px;
            }

        .topbar.front-header .front-header-actions {
            grid-area: actions;
            order: 0;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 6px;
            min-width: 0;
            margin-left: 0;
            white-space: nowrap;
        }

        .topbar.front-header .nav-cart-btn {
            width: 34px;
            height: 34px;
            flex: 0 0 34px;
        }

        .topbar.front-header .avatar-btn {
            padding: 3px 6px;
            border-radius: 12px;
        }

            .topbar.front-header .avatar-btn img {
                width: 30px;
                height: 30px;
            }

        .topbar.front-header .signin-btn {
            padding: 6px 10px;
            white-space: nowrap;
        }
}

/* 更窄手機再縮一點，但仍然維持同一列 */
@media (max-width: 390px) {
    .topbar.front-header {
        grid-template-columns: 38px minmax(0, 1fr) auto;
        gap: 6px;
        padding: 8px 10px;
    }

        .topbar.front-header .front-brand img {
            width: 36px;
            height: 36px;
        }

        .topbar.front-header .front-header-search {
            height: 36px;
        }

            .topbar.front-header .front-header-search input,
            .topbar.front-header .front-header-search .form-control {
                height: 36px;
                font-size: 0.8rem;
            }

            .topbar.front-header .front-header-search .submit,
            .topbar.front-header .front-header-search button[type="submit"] {
                flex-basis: 50px;
                width: 50px;
                height: 36px;
                font-size: 0.78rem;
            }

            .topbar.front-header .front-header-search .clear {
                right: 50px;
            }

        .topbar.front-header .front-header-actions {
            gap: 4px;
        }

        .topbar.front-header .nav-cart-btn {
            width: 32px;
            height: 32px;
            flex-basis: 32px;
        }

        .topbar.front-header .avatar-btn img {
            width: 28px;
            height: 28px;
        }
}
