/*
 * 檔案名稱：assets/css/site.css
 * 修改日期：2026/09/25 10:53（UTC+8）
 * 檔案用途：PHC-PORTAL 前台共用 Design System、桌機導覽、手機 Drawer／底部五大圖示、商品、門市、會員、圖片防護與響應式版面。
 * 修改說明：v0.6.24 修正手機商品分類在部分瀏覽器未可靠置頂，改採定位錨點＋fixed 固定＋占位保留版面；APP 底部導覽與桌機版維持原方式。
 */

:root {
    --phc-site-css-loaded:1;
    --bg:#fbf7f0;
    --surface:#fff;
    --soft:#f4ede3;
    --ink:#2e241d;
    --muted:#75685d;
    --line:#e2d6c8;
    --brown:#70461f;
    --gold:#a86d2a;
    --danger:#b84c3d;
    --ok:#2d7649;
    --radius:16px;
    --shadow:0 18px 50px rgba(65,45,27,.08);
    --container:1420px;
    --header:94px
}
* {
    box-sizing:border-box
}
html,body {
    max-width:100%;
    overflow-x:hidden
}
body {
    margin:0;
    color:var(--ink);
    background:var(--bg);
    font-family:Arial,"Noto Sans TC",sans-serif;
    font-size:17px;
    line-height:1.7
}
img {
    max-width:100%;
    height:auto
}
a {
    color:inherit;
    text-decoration:none
}
button,input,select,textarea {
    font:inherit
}
button {
    cursor:pointer
}
.site-shell {
    min-height:100vh;
    display:flex;
    flex-direction:column
}
.container {
    width:min(var(--container),calc(100% - 48px));
    margin:auto
}
.site-header {
    min-height:var(--header);
    background:#fbf7f0;
    border-bottom:1px solid var(--line);
    position:sticky;
    top:0;
    z-index:80;
    backdrop-filter:blur(12px)
}
.header-row {
    min-height:var(--header);
    display:grid;
    grid-template-columns:minmax(220px,300px) 1fr auto;
    align-items:center;
    gap:24px
}
.logo img {
    display:block;
    width:min(300px,100%);
    max-height:72px;
    object-fit:contain;
    object-position:left center
}
.nav {
    justify-self:center;
    min-width:0
}
.nav-list {
    display:flex;
    align-items:center;
    gap:clamp(18px,2.2vw,36px);
    list-style:none;
    padding:0;
    margin:0
}
.nav-item {
    position:relative;
    white-space:nowrap;
    font-weight:800;
    font-size:16px
}
.nav-item>a {
    display:inline-flex;
    align-items:center;
    min-height:44px
}
.nav-sub {
    display:none;
    position:absolute;
    left:50%;
    top:100%; /* 子選單貼齊主選單，不留 4px 滑鼠空隙 */
    transform:translateX(-50%);
    min-width:230px;
    padding:10px;
    margin:0;
    list-style:none;
    background:#fff;
    border:1px solid var(--line);
    border-radius:14px;
    box-shadow:var(--shadow)
}
.nav-item:hover>.nav-sub,.nav-item:focus-within>.nav-sub {
    display:grid
}
.nav-sub a {
    display:block;
    padding:9px 12px;
    border-radius:9px
}
.nav-sub a:hover {
    background:var(--soft)
}
.actions {
    display:flex;
    align-items:center;
    gap:8px
}
.icon-btn {
    min-width:50px;
    width:50px;
    height:50px;
    display:inline-grid;
    place-items:center;
    border:1px solid transparent;
    border-radius:12px;
    background:transparent;
    color:var(--ink)
}
.icon-btn svg {
    width:27px;
    height:27px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.9;
    stroke-linecap:round;
    stroke-linejoin:round
}
.icon-btn:hover {
    background:#fff;
    border-color:var(--line)
}
.cart-badge {
    position:relative
}
.cart-count {
    position:absolute;
    right:1px;
    top:0;
    min-width:21px;
    height:21px;
    padding:0 5px;
    border-radius:999px;
    background:var(--brown);
    color:#fff;
    font-size:11px;
    display:grid;
    place-items:center
}
.mobile-menu-btn,.mobile-drawer,.drawer-mask {
    display:none
}
.hero {
    position:relative;
    min-height:min(680px,calc(100vh - var(--header)));
    overflow:hidden
}
.hero-slide {
    display:none;
    min-height:inherit;
    background:linear-gradient(100deg,#fcf8f1,#f7eee2 62%,#efe0cf)
}
.hero-slide.is-active {
    display:block
}
.hero-inner {
    min-height:inherit;
    display:grid;
    grid-template-columns:minmax(0,1.05fr) minmax(420px,.95fr);
    align-items:center;
    gap:clamp(40px,6vw,100px);
    padding:64px 0
}
.hero-eyebrow {
    font-weight:900;
    letter-spacing:.18em;
    color:var(--brown);
    margin-bottom:20px
}
.hero-title {
    margin:0;
    font-family:Georgia,"Noto Serif TC",serif;
    font-size:clamp(48px,5.1vw,82px);
    line-height:1.18
}
.hero-line {
    display:block;
    white-space:nowrap
}
.hero-lead {
    margin:28px 0 0;
    max-width:760px;
    color:var(--muted);
    font-size:clamp(17px,1.25vw,21px)
}
.hero-buttons {
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-top:30px
}
.btn {
    min-height:50px;
    padding:0 22px;
    border:1px solid var(--brown);
    border-radius:10px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    font-weight:900;
    white-space:nowrap;
    background:transparent;
    color:var(--brown)
}
.btn.primary {
    background:var(--brown);
    color:#fff
}
.btn.soft {
    border-color:var(--line);
    background:#fff;
    color:var(--ink)
}
.hero-visual img {
    width:100%;
    max-height:550px;
    object-fit:contain
}
.hero-mark {
    min-height:440px;
    border-radius:50% 42% 48% 44%;
    background:radial-gradient(circle at 30% 25%,#835b36,#4b2f1c 52%,#2d2019);
    display:grid;
    place-items:center;
    padding:60px
}
.hero-mark img {
    width:min(290px,68%);
    filter:brightness(0) invert(1);
    opacity:.9
}
.section {
    padding:82px 0
}
.section.white {
    background:#fff
}
.section-head {
    display:flex;
    align-items:end;
    justify-content:space-between;
    gap:24px;
    margin-bottom:32px
}
.section-title {
    margin:0;
    font-family:Georgia,"Noto Serif TC",serif;
    font-size:clamp(30px,3vw,44px)
}
.section-subtitle {
    margin:8px 0 0;
    color:var(--muted)
}
.grid {
    display:grid;
    gap:20px
}
.grid4 {
    grid-template-columns:repeat(4,minmax(0,1fr))
}
.grid5 {
    grid-template-columns:repeat(5,minmax(0,1fr))
}
.card {
    border:1px solid var(--line);
    border-radius:var(--radius);
    background:#fff;
    overflow:hidden;
    box-shadow:0 8px 30px rgba(65,45,27,.04)
}
.card-body {
    padding:20px
}
.category-card {
    min-height:280px;
    display:flex;
    flex-direction:column;
    background:linear-gradient(145deg,#fff,#f3eadf)
}
.category-image {
    min-height:168px;
    display:grid;
    place-items:center;
    padding:18px;
    background:#f5eee5
}
.category-image img {
    width:100%;
    height:168px;
    object-fit:contain
}
.category-body {
    padding:22px 24px 24px
}
.category-body p {
    margin:8px 0 0;
    color:var(--muted)
}
.category-card h3,.product-card h3 {
    margin:0 0 8px
}
.product-image {
    aspect-ratio:1;
    background:#f4eee7;
    display:grid;
    place-items:center;
    overflow:hidden
}
.product-image img {
    width:100%;
    height:100%;
    object-fit:contain
}
.placeholder {
    width:44%!important;
    height:auto!important;
    opacity:.35
}
.price {
    font-weight:900;
    font-size:21px;
    color:var(--brown)
}
.price s {
    color:var(--muted);
    font-weight:500;
    font-size:14px;
    margin-right:6px
}
.store-card {
    min-height:330px
}
.store-image {
    min-height:150px;
    display:grid;
    place-items:center;
    padding:16px;
    background:#f5eee5
}
.store-image img {
    width:100%;
    height:150px;
    object-fit:contain
}
.store-body {
    padding:22px
}
.store-card h3,.store-card h2 {
    margin:0 0 8px
}
.service {
    color:var(--brown);
    font-weight:900;
    font-size:14px
}
.store-card p {
    margin:8px 0;
    color:var(--muted);
    font-size:15px
}
.shop-layout {
    display:grid;
    grid-template-columns:260px minmax(0,1fr);
    gap:30px;
    padding:48px 0 80px
}
.shop-sidebar {
    align-self:start;
    position:sticky;
    top:calc(var(--header) + 20px)
}
.shop-filter {
    background:#fff;
    border:1px solid var(--line);
    border-radius:14px;
    padding:18px
}
.shop-filter ul {
    list-style:none;
    padding:0;
    margin:16px 0 0;
    display:grid;
    gap:6px
}
.shop-filter a {
    display:block;
    padding:9px 11px;
    border-radius:8px
}
.shop-filter a.active,.shop-filter a:hover {
    background:var(--soft);
    color:var(--brown);
    font-weight:900
}
.field {
    display:grid;
    gap:8px;
    min-width:0
}
.field label {
    min-height:25px;
    font-weight:900
}
.field input,.field select,.field textarea {
    width:100%;
    min-height:50px;
    border:1px solid var(--line);
    border-radius:10px;
    padding:0 13px;
    background:#fff;
    color:var(--ink)
}
.field textarea {
    padding:12px;
    min-height:120px;
    resize:vertical
}
.product-page {
    display:grid;
    grid-template-columns:minmax(520px,1.15fr) minmax(420px,.85fr);
    gap:clamp(42px,5vw,84px);
    padding:46px 0 64px
}
.gallery-main {
    width:100%;
    height:clamp(380px,44vw,720px);
    min-width:0;
    border:1px solid var(--line);
    border-radius:18px;
    background:#f3ede5;
    overflow:hidden;
    display:grid;
    place-items:center;
    padding:clamp(12px,1.8vw,24px)
}
.gallery-main-zoom {
    width:100%;
    height:100%;
    min-width:0;
    min-height:0;
    padding:0;
    border:0;
    background:transparent;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:zoom-in
}
.gallery-main img {
    display:block;
    width:auto;
    height:auto;
    max-width:100%;
    max-height:100%;
    object-fit:contain
}
.gallery-main > img.placeholder {
    width:auto;
    height:auto;
    max-width:min(72%,420px);
    max-height:72%;
    object-fit:contain
}
.gallery-thumbs {
    display:flex;
    gap:10px;
    margin-top:12px;
    overflow-x:auto;
    padding-bottom:5px
}
.gallery-thumb {
    flex:0 0 88px;
    aspect-ratio:1;
    border:1px solid var(--line);
    border-radius:10px;
    background:#fff;
    padding:4px
}
.gallery-thumb img {
    width:100%;
    height:100%;
    object-fit:contain
}
.product-image-lightbox {
    position:fixed;
    inset:0;
    z-index:220;
    padding:32px;
    background:rgba(20,16,13,.88);
    display:grid;
    place-items:center
}
.product-image-lightbox[hidden] {
    display:none
}
.product-image-lightbox-stage {
    width:100%;
    height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden
}
.product-image-lightbox-stage img {
    display:block;
    width:auto;
    height:auto;
    max-width:calc(100vw - 64px);
    max-height:calc(100vh - 64px);
    object-fit:contain
}
.product-image-lightbox-close {
    position:fixed;
    top:18px;
    right:18px;
    z-index:221;
    width:46px;
    height:46px;
    border:1px solid rgba(255,255,255,.34);
    border-radius:50%;
    background:rgba(0,0,0,.45);
    color:#fff;
    font-size:30px;
    line-height:1;
    cursor:pointer
}
body.image-lightbox-open {
    overflow:hidden
}
.product-info h1 {
    font-family:Georgia,"Noto Serif TC",serif;
    font-size:clamp(36px,3.2vw,52px);
    line-height:1.25;
    margin:0 0 14px
}
.product-summary {
    font-size:18px;
    color:var(--muted);
    white-space:pre-line
}
.buybox {
    margin-top:28px;
    padding-top:24px;
    border-top:1px solid var(--line)
}
.buybox .price {
    font-size:34px
}
.qty-row {
    display:flex;
    align-items:center;
    gap:12px;
    margin-top:22px
}
.qty-row input {
    width:100px;
    min-height:48px;
    border:1px solid var(--line);
    border-radius:10px;
    text-align:center
}
.buy-actions {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
    margin-top:18px
}
.cms-content {
    font-size:18px;
    line-height:1.9;
    overflow-wrap:anywhere
}
.cms-content img {
    max-width:100%!important;
    height:auto!important
}
.cms-content table {
    width:100%!important;
    max-width:100%;
    border-collapse:collapse;
    display:block;
    overflow-x:auto
}
.cms-content td,.cms-content th {
    border:1px solid var(--line);
    padding:10px
}
.page-pad {
    padding:48px 0 86px
}
.cart-table {
    width:100%;
    border-collapse:collapse;
    background:#fff;
    border:1px solid var(--line);
    border-radius:14px;
    overflow:hidden
}
.cart-table th,.cart-table td {
    padding:16px;
    border-bottom:1px solid var(--line);
    text-align:left;
    vertical-align:middle
}
.cart-product {
    display:flex;
    align-items:center;
    gap:14px;
    min-width:240px
}
.cart-product img {
    width:70px;
    height:70px;
    object-fit:contain;
    background:#f3ede5;
    border-radius:10px
}
.summary-box {
    margin-left:auto;
    width:min(440px,100%);
    background:#fff;
    border:1px solid var(--line);
    border-radius:14px;
    padding:22px
}
.summary-row {
    display:flex;
    justify-content:space-between;
    gap:16px;
    padding:8px 0
}
.summary-row.total {
    border-top:1px solid var(--line);
    margin-top:8px;
    padding-top:16px;
    font-size:24px;
    font-weight:900
}
.form-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:18px
}
.wide {
    grid-column:1/-1
}
.notice,.error,.success {
    padding:14px 16px;
    border-radius:10px;
    margin:16px 0
}
.notice {
    background:#fff8e8;
    border:1px solid #ead4a3;
    color:#725322
}
.error {
    background:#fff0ed;
    border:1px solid #efb9b0;
    color:#8b3226
}
.success {
    background:#edf8ef;
    border:1px solid #b9ddc1;
    color:#28613b
}
.site-footer {
    margin-top:auto;
    background:#efe4d7;
    color:var(--ink);
    border-top:1px solid var(--line);
    padding:50px 0 28px
}
.footer-grid {
    display:grid;
    grid-template-columns:330px 1fr 1fr;
    gap:42px
}
.footer-logo {
    width:min(320px,100%)
}
.footer-logo img {
    display:block;
    width:100%;
    height:auto;
    mix-blend-mode:multiply
}
.site-footer a,.site-footer p {
    color:#665548
}
.footer-bottom {
    margin-top:36px;
    padding-top:20px;
    border-top:1px solid rgba(87,62,43,.16);
    color:#806c5c
}
.page-cover {
    margin:28px 0 34px;
    border-radius:var(--radius);
    overflow:hidden;
    background:#f5eee5
}
.page-cover img {
    display:block;
    width:100%;
    max-height:620px;
    object-fit:contain
}
@media(max-width:1180px) {
    .header-row {
        grid-template-columns:minmax(180px,240px) 1fr auto;
        gap:14px
    }
    .nav-list {
        gap:14px
    }
    .nav-item {
        font-size:15px
    }
    .grid5 {
        grid-template-columns:repeat(3,minmax(0,1fr))
    }
    .grid4 {
        grid-template-columns:repeat(3,minmax(0,1fr))
    }
    .product-page {
        grid-template-columns:1fr 1fr;
        gap:34px
    }
}
@media(max-width:980px) {
    :root {
        --header:82px
    }
    .container {
        width:min(var(--container),calc(100% - 32px))
    }
    .header-row {
        grid-template-columns:minmax(180px,1fr) auto
    }
    .nav {
        display:none
    }
    .mobile-menu-btn {
        display:inline-grid
    }
    .hero-inner {
        grid-template-columns:1fr;
        padding:54px 0
    }
    .hero-visual {
        order:-1
    }
    .hero-mark {
        min-height:330px
    }
    .hero-title {
        font-size:clamp(42px,7.8vw,68px)
    }
    .grid4,.grid5 {
        grid-template-columns:repeat(2,minmax(0,1fr))
    }
    .product-page,.shop-layout {
        grid-template-columns:1fr
    }
    .gallery-main {
        height:min(68vh,620px);
        min-height:320px
    }
    .shop-sidebar {
        position:static
    }
    .footer-grid {
        grid-template-columns:1fr 1fr
    }
    .footer-brand {
        grid-column:1/-1
    }
    .drawer-mask {
        position:fixed;
        inset:0;
        background:rgba(24,17,12,.44);
        z-index:98
    }
    .drawer-mask.open {
        display:block
    }
    .mobile-drawer {
        display:flex;
        flex-direction:column;
        position:fixed;
        top:0;
        bottom:0;
        right:0;
        width:min(390px,88vw);
        background:#fff;
        z-index:99;
        transform:translateX(105%);
        transition:transform .22s ease;
        box-shadow:-16px 0 50px rgba(30,20,12,.15)
    }
    .mobile-drawer.open {
        transform:translateX(0)
    }
    .drawer-head {
        min-height:82px;
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:14px;
        padding:12px 18px;
        border-bottom:1px solid var(--line)
    }
    .drawer-head img {
        width:210px;
        max-height:58px;
        object-fit:contain;
        object-position:left
    }
    .drawer-body {
        overflow-y:auto;
        overscroll-behavior:contain;
        padding:16px
    }
    .mobile-menu {
        list-style:none;
        padding:0;
        margin:0;
        display:grid;
        gap:4px
    }
    .mobile-row {
        display:flex;
        align-items:center;
        gap:8px
    }
    .mobile-row>a {
        flex:1;
        min-height:48px;
        display:flex;
        align-items:center;
        padding:0 10px;
        font-weight:900
    }
    .mobile-toggle {
        flex:0 0 44px;
        height:44px;
        border:0;
        background:var(--soft);
        border-radius:10px
    }
    .mobile-children {
        display:none;
        list-style:none;
        padding:4px 0 10px 18px;
        margin:0
    }
    .mobile-item.open>.mobile-children {
        display:grid
    }
    .mobile-children a {
        display:block;
        padding:9px 10px;
        color:var(--muted)
    }
    body.drawer-open {
        overflow:hidden
    }
}
@media(max-width:680px) {
    body {
        font-size:16px
    }
    .container {
        width:min(100% - 24px,var(--container))
    }
    .logo img {
        width:220px
    }
    .desktop-only {
        display:none
    }
    .hero {
        min-height:auto
    }
    .hero-inner {
        gap:30px;
        padding:34px 0 46px
    }
    .hero-mark {
        min-height:260px;
        padding:40px
    }
    .hero-title {
        font-size:clamp(34px,10.2vw,50px)
    }
    .hero-line {
        white-space:nowrap
    }
    .hero-lead {
        font-size:16px
    }
    .section {
        padding:56px 0
    }
    .section-head {
        align-items:flex-start;
        flex-direction:column
    }
    .grid4,.grid5 {
        grid-template-columns:1fr
    }
    .buy-actions,.form-grid,.footer-grid {
        grid-template-columns:1fr
    }
    .wide,.footer-brand {
        grid-column:auto
    }
    .cart-table {
        display:block;
        overflow-x:auto
    }
    .product-info h1 {
        font-size:34px
    }
}

/* 結帳頁 */
.checkout-form {
    margin-top:24px;
}
.checkout-summary {
    margin-top:24px;
}
.checkout-submit {
    width:100%;
    margin-top:16px;
}

.mobile-toggle svg {
    width:22px;
    height:22px;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round
}

.member-login-wrap {
    display:grid;
    place-items:center;
    min-height:calc(100vh - var(--header) - 180px)
}
.member-login-card {
    width:min(560px,100%);
    padding:38px;
    text-align:center
}
.member-login-logo {
    width:min(320px,78%);
    margin:0 auto 28px
}
.member-login-card .section-subtitle {
    margin:12px auto 26px;
    max-width:430px
}
.line-login-btn {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:12px;
    width:100%;
    min-height:56px;
    padding:0 22px;
    border-radius:12px;
    color:#fff;
    background:#06c755;
    font-weight:900;
    white-space:nowrap
}
.line-login-btn span {
    display:grid;
    place-items:center;
    min-width:42px;
    min-height:30px;
    padding:0 6px;
    border:1px solid rgba(255,255,255,.75);
    border-radius:7px;
    font-size:12px;
    letter-spacing:.04em
}
@media (max-width:620px) {
    .member-login-card {
        padding:26px 20px
    }
}


.member-summary-grid {
    margin-top: 22px;
}

/* ============================================================
 * v0.4.0 品牌融合、首屏視覺與按鈕完成度
 * ============================================================ */

.logo img,
.footer-logo,
.drawer-head img {
    mix-blend-mode: normal;
}

.hero-slide {
    background:
        radial-gradient(circle at 78% 34%, rgba(168,109,42,.08), transparent 28%),
        linear-gradient(100deg, #fcf8f1 0%, #f9f2e9 58%, #f3e7d8 100%);
}

.hero-visual {
    position: relative;
    min-height: 470px;
    display: grid;
    place-items: center;
}

.hero-visual::before {
    content: "";
    position: absolute;
    width: min(560px, 92%);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168,109,42,.10), rgba(112,70,31,.035) 48%, transparent 72%);
}

.hero-visual picture,
.hero-visual > img,
.hero-mark {
    position: relative;
    z-index: 1;
}

.hero-mark {
    min-height: 0;
    width: min(430px, 82%);
    aspect-ratio: 1;
    padding: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(112,70,31,.08);
    box-shadow: inset 0 0 80px rgba(112,70,31,.035);
}

.hero-mark img {
    width: min(260px, 78%);
    filter: none;
    opacity: .18;
}

.btn {
    min-height: 50px;
    padding: 0 24px;
    border-radius: 12px;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(66,42,22,.10);
}

.btn.primary {
    border-color: var(--brown);
    background: linear-gradient(180deg, #805128, var(--brown));
    box-shadow: 0 9px 22px rgba(112,70,31,.20);
}

.btn.primary:hover {
    background: linear-gradient(180deg, #8d5d30, #65401f);
}

.btn.soft {
    border-color: #d7c7b7;
    background: rgba(255,255,255,.78);
}

.category-image,
.product-image,
.store-image {
    background: linear-gradient(145deg, #faf6ef, #f3eadf);
}

.category-image .placeholder,
.product-image .placeholder,
.store-image .placeholder {
    opacity: .20;
}

@media (max-width: 920px) {
    .hero-visual {
        min-height: 320px;
    }
    .hero-mark {
        width: min(360px, 76vw);
        padding: 58px;
    }
}

@media (max-width: 620px) {
    .hero-visual {
        min-height: 250px;
    }
    .hero-mark {
        width: min(300px, 80vw);
        padding: 48px;
    }
}

/* ============================================================
 * v0.4.2 前台完成度修正
 * - 門市標題一致、營業時間摘要、門市詳細頁
 * - LINE 會員登入品牌化
 * - Footer 壓縮空間
 * - 品牌圖章顯示時裁掉原始圖檔右側殘留線條
 * ============================================================ */

.section-kicker {
    margin-bottom: 10px;
    color: var(--brown);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .18em;
}

.brand-mark-frame {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: min(150px, 70%);
    overflow: hidden;
}

.brand-mark-crop {
    display: block;
    width: 118% !important;
    max-width: none;
    height: auto !important;
    transform: translateX(-1%);
    clip-path: inset(0 15% 0 0);
}

.hero-mark {
    background: transparent;
    border-color: rgba(112,70,31,.06);
    box-shadow: none;
}

.hero-mark img {
    opacity: .14;
    clip-path: inset(0 15% 0 0);
}

.store-grid {
    align-items: stretch;
}

.store-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.store-card:hover {
    transform: translateY(-3px);
    border-color: #d5c3af;
    box-shadow: 0 16px 34px rgba(65,45,27,.08);
}

.store-image {
    min-height: 154px;
    height: 154px;
    display: grid;
    place-items: center;
    padding: 18px;
    background: linear-gradient(145deg, #fbf7f1, #f2e8dc);
}

.store-image img:not(.brand-mark-crop) {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.store-image .brand-mark-frame {
    width: 118px;
    opacity: .24;
}

.store-body {
    padding: 20px;
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.store-name {
    margin: 5px 0 10px !important;
    min-height: 34px;
    font-size: 21px;
    line-height: 1.35;
    font-weight: 900;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.store-name a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-service-slot {
    min-height: 24px;
}

.store-name-slot {
    min-height: 34px;
}

.store-address-slot {
    min-height: 46px;
}

.store-phone-slot {
    min-height: 22px;
}

.store-hours-slot {
    min-height: 126px;
}

.store-address,
.store-phone {
    margin: 6px 0 !important;
    font-size: 14px !important;
    line-height: 1.55;
}

.store-phone a {
    color: var(--brown);
    font-weight: 800;
}

.store-hours-compact {
    margin-top: 13px;
    padding-top: 13px;
    border-top: 1px solid rgba(112,70,31,.10);
    display: grid;
    gap: 4px;
    color: #65584e;
    font-size: 13px;
    line-height: 1.45;
}

.store-today {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 3px;
    color: var(--ok);
}

.store-today.is-closed {
    color: #a14f3f;
}

.store-actions {
    margin-top: auto;
    padding-top: 16px;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--brown);
    font-size: 14px;
    font-weight: 900;
}

.store-detail-btn {
    width: 100%;
    min-height: 46px;
    border-color: #d6c1aa;
    background: #fffaf4;
}

.store-directory-hero {
    padding: 58px 0 34px;
    background: linear-gradient(180deg, #fbf7f0, #f7efe4);
    border-bottom: 1px solid rgba(112,70,31,.08);
}

.store-directory-hero-inner {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
}

.store-directory-section {
    padding-top: 42px;
}

.store-detail-hero {
    padding: 58px 0 64px;
    background:
        radial-gradient(circle at 82% 24%, rgba(168,109,42,.09), transparent 34%),
        linear-gradient(110deg, #fbf7f0 0%, #f6ecdf 100%);
}

.store-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .72fr);
    align-items: center;
    gap: clamp(44px, 7vw, 110px);
}

.store-detail-service {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 6px 10px;
    border: 1px solid rgba(112,70,31,.14);
    border-radius: 999px;
    background: rgba(255,255,255,.48);
}

.store-detail-title {
    margin: 0;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(44px, 5vw, 72px);
    line-height: 1.18;
    letter-spacing: -.03em;
}

.store-detail-address {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 19px;
}

.store-detail-contact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.store-detail-visual {
    min-height: 380px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(112,70,31,.08);
    border-radius: 32px;
    background: rgba(255,255,255,.35);
    overflow: hidden;
}

.store-detail-visual > img {
    width: 100%;
    height: 100%;
    max-height: 470px;
    object-fit: contain;
}

.store-detail-mark {
    width: min(230px, 62%);
    opacity: .17;
}

.store-detail-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.store-info-panel {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.store-info-panel h2 {
    margin: 0 0 18px;
    font-size: 24px;
}

.store-today-large {
    margin-bottom: 22px;
    padding: 13px 15px;
    border: 1px solid #cbe0d0;
    border-radius: 12px;
    background: #f0f8f2;
    font-size: 16px;
}

.store-today-large.is-closed {
    border-color: #ebc9c2;
    background: #fff4f1;
}

.store-hours-list {
    display: grid;
    gap: 9px;
    color: #5f5348;
}

.store-detail-list {
    margin: 0;
    display: grid;
    gap: 0;
}

.store-detail-list > div {
    display: grid;
    grid-template-columns: 86px minmax(0,1fr);
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(112,70,31,.10);
}

.store-detail-list > div:last-child {
    border-bottom: 0;
}

.store-detail-list dt {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.store-detail-list dd {
    margin: 0;
    font-weight: 700;
}

.store-description-section {
    background: #f7efe5;
}

.store-description-wrap {
    width: min(980px, calc(100% - 48px));
}

.store-description-content {
    margin-top: 22px;
    padding: 28px 30px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.empty-state {
    max-width: 720px;
    padding: 60px 0;
}

/* LINE 會員登入 */
.member-login-page {
    flex: 1;
    display: grid;
    align-items: center;
    padding: 48px 0 62px;
    background:
        radial-gradient(circle at 20% 18%, rgba(168,109,42,.08), transparent 28%),
        linear-gradient(110deg, #fbf7f0 0%, #f6ecdf 100%);
}

.member-login-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(380px, .72fr);
    align-items: center;
    gap: clamp(42px, 8vw, 120px);
}

.member-login-intro h1 {
    margin: 0;
    max-width: 760px;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(42px, 4.8vw, 68px);
    line-height: 1.22;
    letter-spacing: -.035em;
}

.member-login-intro > p {
    max-width: 680px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 18px;
}

.member-login-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 26px;
}

.member-login-benefits span {
    padding: 7px 12px;
    border: 1px solid rgba(112,70,31,.13);
    border-radius: 999px;
    background: rgba(255,255,255,.55);
    color: #5c4939;
    font-size: 14px;
    font-weight: 800;
}

.member-login-panel {
    padding: 34px;
    border: 1px solid rgba(112,70,31,.14);
    border-radius: 22px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 24px 65px rgba(65,45,27,.08);
}

.member-login-mark {
    height: 78px;
    display: flex;
    align-items: center;
}

.member-login-mark .brand-mark-frame {
    width: 92px;
    opacity: .22;
}

.member-login-label {
    margin: 18px 0 4px;
    color: var(--brown);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
}

.member-login-panel h2 {
    margin: 0;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 34px;
}

.member-login-panel > p:not(.member-login-label) {
    margin: 12px 0 24px;
    color: var(--muted);
}

.line-login-btn {
    min-height: 58px;
    border-radius: 13px;
    box-shadow: 0 12px 28px rgba(6,199,85,.18);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.line-login-btn:hover {
    transform: translateY(-1px);
    filter: brightness(.97);
    box-shadow: 0 16px 32px rgba(6,199,85,.24);
}

.line-login-btn svg {
    width: 30px;
    height: 30px;
    fill: #fff;
}

/* Footer：四區塊同列，避免 LINE 會員掉到第二列造成大片空白 */
.site-footer {
    padding: 34px 0 20px;
}

.footer-grid {
    grid-template-columns: minmax(260px, 1.45fr) repeat(3, minmax(140px, .72fr));
    gap: clamp(26px, 4vw, 58px);
    align-items: start;
}

.footer-brand p {
    max-width: 340px;
    margin: 12px 0 0;
}

.footer-logo {
    width: min(300px, 100%);
}

.footer-links {
    display: grid;
    align-content: start;
    gap: 7px;
}

.footer-links h3 {
    margin: 0 0 5px;
    font-size: 17px;
}

.footer-links a {
    color: #665548;
}

.footer-links a:hover {
    color: var(--brown);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.footer-bottom {
    margin-top: 26px;
    padding-top: 15px;
}

@media (max-width: 1180px) {
    .store-name {
        font-size: 20px;
    }
}

@media (max-width: 980px) {
    .store-detail-grid,
    .member-login-stage {
        grid-template-columns: 1fr;
    }

    .store-detail-visual {
        min-height: 310px;
        order: -1;
    }

    .store-detail-info-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .store-name {
        font-size: 21px;
    }

    .store-image {
        height: 178px;
    }

    .store-directory-hero {
        padding: 36px 0 24px;
    }

    .store-detail-hero {
        padding: 34px 0 44px;
    }

    .store-detail-title {
        font-size: 40px;
    }

    .store-detail-address {
        font-size: 17px;
    }

    .store-detail-contact-row .btn {
        width: 100%;
    }

    .store-info-panel {
        padding: 21px;
    }

    .store-description-wrap {
        width: min(100% - 24px, 980px);
    }

    .store-description-content {
        padding: 20px;
    }

    .member-login-page {
        padding: 32px 0 42px;
    }

    .member-login-intro h1 {
        font-size: 38px;
    }

    .member-login-intro > p {
        font-size: 16px;
    }

    .member-login-panel {
        padding: 24px 20px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 24px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* ============================================================
 * v0.5.0 Central Orders / Member Orders
 * ============================================================ */
.order-success-card {
    display: grid;
    gap: 12px;
    max-width: 760px;
    margin: 0 auto;
}
.order-success-card h1,
.order-success-card p {
    margin: 0;
}
.order-tech-reference {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    background: var(--soft);
    font-size: 13px;
    overflow-wrap: anywhere;
}
.order-success-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
.member-order-list {
    display: grid;
    gap: 12px;
}
.member-order-card {
    position: relative;
    display: grid;
    gap: 10px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.member-order-main,
.member-order-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.member-order-main > div,
.member-order-meta {
    flex-wrap: wrap;
}
.member-order-main > div {
    display: flex;
    align-items: center;
    gap: 10px;
}
.order-source-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--soft);
    font-size: 12px;
    font-weight: 700;
}
.order-source-badge.is-central {
    color: var(--ok);
    border-color: rgba(45, 118, 73, 0.28);
    background: rgba(45, 118, 73, 0.08);
}
.member-order-link,
.text-link {
    color: var(--brown);
    font-weight: 800;
}
.member-order-link {
    justify-self: end;
}
.order-detail-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}
.order-detail-heading .section-title {
    margin-bottom: 0;
}
.order-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.order-detail-panel,
.order-items-panel {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.order-detail-panel h2,
.order-items-panel h2 {
    margin-top: 0;
}
.order-detail-list {
    display: grid;
    gap: 10px;
    margin: 0;
}
.order-detail-list > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
}
.order-detail-list dt {
    color: var(--muted);
}
.order-detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}
.order-items-panel {
    margin-top: 16px;
}
.order-items-table td small {
    display: block;
    color: var(--muted);
}
.order-total-box {
    display: grid;
    gap: 6px;
    width: min(420px, 100%);
    margin: 18px 0 0 auto;
}
.order-total-box > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.order-total-box .total {
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: 1.08em;
}
.order-reference-details {
    margin-top: 16px;
    color: var(--muted);
    font-size: 13px;
}
.order-reference-details p {
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .order-detail-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .order-detail-grid {
        grid-template-columns: 1fr;
    }
    .member-order-main,
    .member-order-meta {
        align-items: flex-start;
        flex-direction: column;
    }
    .member-order-link {
        justify-self: start;
    }
    .order-detail-list > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}


/* v0.6.1 商品詳情主圖手機顯示與放大檢視 */
@media(max-width:620px) {
    .gallery-main {
        height:min(64vh,520px);
        min-height:280px;
        padding:10px
    }
    .product-image-lightbox {
        padding:18px
    }
    .product-image-lightbox-stage img {
        max-width:calc(100vw - 36px);
        max-height:calc(100vh - 36px)
    }
}

/* ==========================================================
 * v0.6.8：桌機主選單與門市卡片圖片庫式展示
 * - 門市圖片不再區分直式／橫式。
 * - 採後台圖片庫相同的 4:3 固定舞台與 object-fit: contain。
 * - 圖片舞台直接貼合卡片上緣，利用卡片 overflow:hidden 融合圓弧邊框。
 * ========================================================== */
@media (min-width: 981px) {
    .nav-item {
        font-size: 18px;
    }
}

.store-image {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 0;
    background: linear-gradient(145deg, #faf6ef, #f3eadf);
}

.store-image img:not(.brand-mark-crop) {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
}

.store-card .service {
    font-size: 16px;
}

.store-name {
    min-height: 38px;
    font-size: 23px;
}

.store-name-slot {
    min-height: 38px;
}

.store-address,
.store-phone {
    font-size: 16px !important;
}

.store-address-slot {
    min-height: 54px;
}

.store-phone-slot {
    min-height: 26px;
}

.store-hours-compact {
    font-size: 15px;
}

.store-hours-slot {
    min-height: 138px;
}

.store-detail-btn {
    font-size: 16px;
}

@media (max-width: 680px) {
    .store-image {
        height: auto;
        min-height: 0;
        aspect-ratio: 4 / 3;
    }
}


/* ==========================================================
 * v0.6.3：商品階層導覽、麵包屑、前後商品與缺貨鎖定
 * ========================================================== */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumb a {
    color: var(--brown);
    font-weight: 800;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.catalog-tree {
    display: grid;
    gap: 5px;
    margin-top: 16px;
}

.catalog-all-link,
.catalog-category-link,
.catalog-product-link {
    min-width: 0;
    border-radius: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-all-link {
    display: block;
    padding: 10px 11px;
    font-weight: 900;
}

.catalog-tree-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 3px;
}

.catalog-toggle {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: var(--brown);
    background: transparent;
}

.catalog-toggle span {
    display: inline-block;
    font-size: 23px;
    line-height: 1;
    transition: transform 0.16s ease;
}

.catalog-branch.open > .catalog-tree-row > .catalog-toggle span {
    transform: rotate(90deg);
}

.catalog-toggle:hover:not(:disabled) {
    background: var(--soft);
}

.catalog-toggle:disabled {
    color: #c6bbb0;
    cursor: default;
}

.catalog-category-link {
    display: block;
    padding: 9px 10px;
    font-weight: 900;
}

.catalog-parent-row .catalog-category-link {
    font-size: 16px;
}

.catalog-child {
    margin: 3px 0 3px 14px;
}

.catalog-child-row .catalog-category-link {
    color: #58483a;
    font-size: 14px;
}

.catalog-panel {
    display: grid;
    gap: 3px;
    padding: 2px 0 5px 22px;
}

.catalog-panel[hidden] {
    display: none;
}

.catalog-child > .catalog-panel {
    padding-left: 35px;
}

.catalog-product-link {
    display: block;
    padding: 7px 10px;
    color: var(--muted);
    font-size: 13px;
}

.catalog-all-link:hover,
.catalog-category-link:hover,
.catalog-product-link:hover,
.catalog-all-link.active,
.catalog-category-link.active,
.catalog-product-link.active {
    color: var(--brown);
    background: var(--soft);
}

.catalog-product-link.active {
    font-weight: 900;
}

.shop-results {
    min-width: 0;
}

.shop-section-head {
    margin-bottom: 26px;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 30px;
    padding: 38px 0 80px;
}

.product-detail-sidebar {
    align-self: start;
    position: sticky;
    top: calc(var(--header) + 20px);
}

.product-detail-main {
    min-width: 0;
}

.product-detail-main .product-page {
    grid-template-columns: minmax(420px, 1.06fr) minmax(350px, 0.94fr);
    gap: clamp(28px, 3.5vw, 58px);
    padding: 20px 0 54px;
}

.product-neighbor-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    margin: -4px 0 6px;
}

.product-neighbor-link {
    min-height: 60px;
    display: grid;
    gap: 3px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
}

.product-neighbor-link.next {
    text-align: right;
}

.product-neighbor-link span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.product-neighbor-link strong {
    overflow: hidden;
    color: var(--brown);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-neighbor-link:hover {
    border-color: #cdb49a;
    background: var(--soft);
}

.product-neighbor-link.disabled {
    visibility: hidden;
}

.stock-state {
    font-weight: 900;
}

.stock-state.available {
    color: #2e7544;
}

.stock-state.sold-out {
    color: #8a5d18;
}

.qty-row input:disabled,
.buy-actions .btn:disabled,
.bean-service-option.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.qty-row input:disabled {
    background: #efede9;
}

.buy-actions .btn:disabled {
    border-color: #bcb3aa;
    color: #756d66;
    background: #e7e3df;
}

.bean-service-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}

.product-content-section {
    padding: 54px 0 0;
}

@media (max-width: 1180px) {
    .product-detail-layout {
        grid-template-columns: 230px minmax(0, 1fr);
        gap: 22px;
    }

    .product-detail-main .product-page {
        grid-template-columns: 1fr;
    }

    .product-detail-main .gallery-main {
        height: min(70vw, 680px);
    }
}

@media (max-width: 980px) {
    .product-detail-layout,
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .product-detail-sidebar,
    .shop-sidebar {
        position: static;
    }

    .shop-filter {
        max-height: none;
    }

    .catalog-tree {
        max-height: 430px;
        overflow-y: auto;
        padding-right: 4px;
    }
}

@media (max-width: 680px) {
    .product-detail-layout {
        padding-top: 24px;
    }

    .product-neighbor-nav {
        grid-template-columns: 1fr;
    }

    .product-neighbor-link.disabled {
        display: none;
    }

    .product-neighbor-link.next {
        text-align: left;
    }

    .product-detail-main .product-page {
        padding-top: 12px;
    }
}

/* ==========================================================
 * v0.6.6：商品主圖固定舞台、內容頁麵包屑與關於品皇側欄
 * ========================================================== */
.product-detail-main .gallery-main {
    --product-gallery-padding: clamp(12px, 1.8vw, 24px);
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
    padding: 0;
    contain: layout paint;
}

.product-detail-main .gallery-main-zoom {
    position: absolute;
    inset: var(--product-gallery-padding);
    width: auto;
    height: auto;
}

.product-detail-main .gallery-main > img.placeholder {
    position: absolute;
    inset: 14%;
    width: 72%;
    height: 72%;
    max-width: none;
    max-height: none;
    margin: auto;
}

.product-detail-main .gallery-main img[data-main] {
    flex: 0 0 auto;
}

.gallery-thumb.active {
    border-color: var(--brown);
    box-shadow: 0 0 0 2px rgba(125, 74, 31, 0.12);
}

.content-page-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 30px;
    padding: 38px 0 80px;
}

.content-page-sidebar {
    align-self: start;
    position: sticky;
    top: calc(var(--header) + 20px);
}

.content-page-main {
    min-width: 0;
}

.content-page-main .content-page-article {
    min-width: 0;
}

.content-page-main .section-title,
.content-page-standalone .section-title {
    margin-top: 0;
}

.content-page-standalone .breadcrumb {
    margin-bottom: 18px;
}

@media (max-width: 1180px) {
    .product-detail-main .gallery-main {
        height: auto;
        min-height: 0;
    }

    .content-page-layout {
        grid-template-columns: 230px minmax(0, 1fr);
        gap: 22px;
    }
}

@media (max-width: 980px) {
    .content-page-layout {
        grid-template-columns: 1fr;
    }

    .content-page-sidebar {
        position: static;
    }
}

@media (max-width: 620px) {
    .product-detail-main .gallery-main {
        height: auto;
        min-height: 0;
        aspect-ratio: 1 / 1;
    }
}


/* v0.6.6：分類直接啟用商品數量小計。 */
.catalog-count {
    font: inherit;
    white-space: nowrap;
}

/* ============================================================
 * v0.6.6：LINE 第一次加入會員隱私權聲明
 * ============================================================ */
.member-login-join {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    color: var(--muted);
    font-size: 14px;
}

.member-login-join a {
    color: var(--brown);
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.member-privacy-page {
    flex: 1;
    padding: 46px 0 72px;
    background: #fbf7f0;
}

.member-privacy-stage {
    width: min(1040px, calc(100% - 32px));
}

.member-privacy-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.member-privacy-head h1 {
    margin: 4px 0 8px;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(36px, 4vw, 52px);
}

.member-privacy-head p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
}

.member-privacy-card {
    padding: clamp(24px, 4vw, 44px);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(63, 43, 27, .06);
}

.member-privacy-card h2 {
    margin-top: 0;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 34px;
}

.member-privacy-card h3 {
    margin: 34px 0 8px;
    color: var(--brown);
    font-size: 20px;
}

.member-privacy-card p {
    margin: 0 0 15px;
}

.member-privacy-error {
    margin-bottom: 16px;
}

.member-privacy-consent {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 45px rgba(58, 39, 24, .12);
    backdrop-filter: blur(8px);
}

.member-privacy-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 900;
    cursor: pointer;
}

.member-privacy-check input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    flex: 0 0 auto;
}

.member-privacy-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

@media (max-width: 720px) {
    .member-privacy-page {
        padding: 30px 0 52px;
    }

    .member-privacy-head {
        align-items: stretch;
        flex-direction: column;
    }

    .member-privacy-head .btn {
        align-self: flex-start;
    }

    .member-privacy-card {
        padding: 22px 18px;
        border-radius: 16px;
    }

    .member-privacy-consent {
        bottom: 8px;
        padding: 14px;
    }

    .member-privacy-actions {
        flex-direction: column-reverse;
    }

    .member-privacy-actions .btn {
        width: 100%;
    }
}


/* ============================================================
 * v0.6.9：商品卡片品名固定兩行，價格水平線一致
 * ============================================================ */
.product-card .card-body > small {
    display: block;
    min-height: 1.5em;
    overflow: hidden;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card h3 {
    display: -webkit-box;
    min-height: 2.9em;
    margin-bottom: 8px;
    overflow: hidden;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}


/* ============================================================
 * v0.6.12：商品詳細頁手機優先商品內容
 * - 桌機（981px 以上）完全保留既有左側商品分類與版面。
 * - 手機／平板不再把完整分類樹放在商品內容上方。
 * - 分類改為底部抽屜；商品主圖、品名、售價、購買區與介紹優先。
 * ============================================================ */
.product-mobile-nav,
.product-mobile-catalog-mask,
.product-mobile-catalog-drawer {
    display: none;
}

@media (max-width: 980px) {
    .product-detail-layout {
        display: block;
        padding-top: 16px;
        padding-bottom: 56px;
    }

    .product-detail-sidebar {
        display: none;
    }

    .product-detail-main {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .product-mobile-nav {
        display: block;
        order: 0;
        margin-bottom: 8px;
    }

    .product-mobile-catalog-trigger {
        width: 100%;
        min-height: 50px;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 9px 13px;
        border: 1px solid var(--line);
        border-radius: 12px;
        color: var(--ink);
        background: #fff;
        text-align: left;
    }

    .product-mobile-catalog-trigger-label {
        color: var(--brown);
        font-size: 13px;
        font-weight: 900;
        white-space: nowrap;
    }

    .product-mobile-catalog-trigger strong {
        min-width: 0;
        overflow: hidden;
        font-size: 15px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .product-mobile-catalog-trigger-arrow {
        color: var(--brown);
        font-size: 25px;
        line-height: 1;
        transform: rotate(90deg);
    }

    .product-detail-main > .breadcrumb {
        order: 1;
        flex-wrap: nowrap;
        gap: 6px;
        margin: 0 0 10px;
        padding: 4px 1px 7px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        color: var(--muted);
        font-size: 12px;
        scrollbar-width: none;
        white-space: nowrap;
    }

    .product-detail-main > .breadcrumb::-webkit-scrollbar {
        display: none;
    }

    .product-detail-main > .breadcrumb > * {
        flex: 0 0 auto;
    }

    .product-detail-main > .product-page {
        order: 2;
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 0 0 10px;
    }

    .product-detail-main > .product-content-section {
        order: 3;
    }

    .product-detail-main > .product-neighbor-nav {
        order: 4;
    }

    .product-detail-main .gallery-main {
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 1 / 1;
        border-radius: 15px;
        background: #fff;
    }

    .product-detail-main .gallery-thumbs {
        gap: 8px;
        margin-top: 9px;
    }

    .product-detail-main .gallery-thumb {
        flex-basis: 70px;
        border-radius: 9px;
    }

    .product-detail-main .product-info {
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: 15px;
        background: #fff;
    }

    .product-detail-main .product-info > small {
        display: block;
        margin-bottom: 5px;
        color: var(--muted);
        font-size: 13px;
    }

    .product-detail-main .product-info h1 {
        margin-bottom: 9px;
        font-family: Arial, "Noto Sans TC", sans-serif;
        font-size: clamp(25px, 5.8vw, 32px);
        line-height: 1.38;
    }

    .product-detail-main .product-summary {
        margin: 8px 0 0;
        font-size: 15px;
        line-height: 1.65;
    }

    .product-detail-main .buybox {
        margin-top: 16px;
        padding-top: 15px;
    }

    .product-detail-main .buybox .price {
        font-size: 30px;
        line-height: 1.25;
    }

    .product-detail-main .stock-state {
        margin: 8px 0 0;
        font-size: 14px;
    }

    .product-detail-main .qty-row {
        margin-top: 14px;
    }

    .product-detail-main .qty-row input {
        min-height: 44px;
    }

    .product-detail-main .bean-service-option {
        margin-top: 13px;
        font-size: 14px;
    }

    .product-detail-main .buy-actions {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
        gap: 9px;
        margin-top: 14px;
    }

    .product-detail-main .buy-actions .btn {
        min-width: 0;
        min-height: 48px;
        padding: 0 12px;
        white-space: nowrap;
    }

    .product-content-section {
        margin-top: 12px;
        padding: 18px 16px 20px;
        border: 1px solid var(--line);
        border-radius: 15px;
        background: #fff;
    }

    .product-content-section .section-title {
        margin: 0 0 14px;
        font-size: 23px;
    }

    .product-content-section .cms-content {
        font-size: 16px;
        line-height: 1.78;
    }

    .product-neighbor-nav {
        margin: 14px 0 0;
    }

    .product-mobile-catalog-mask {
        position: fixed;
        inset: 0;
        z-index: 188;
        background: rgba(31, 23, 17, .46);
    }

    .product-mobile-catalog-mask.open {
        display: block;
    }

    .product-mobile-catalog-mask[hidden] {
        display: none;
    }

    .product-mobile-catalog-drawer {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 189;
        max-height: min(84vh, 760px);
        display: flex;
        flex-direction: column;
        border: 1px solid var(--line);
        border-bottom: 0;
        border-radius: 20px 20px 0 0;
        background: #fff;
        box-shadow: 0 -18px 50px rgba(47, 31, 18, .18);
        transform: translateY(105%);
        transition: transform .22s ease;
    }

    .product-mobile-catalog-drawer.open {
        transform: translateY(0);
    }

    .product-mobile-catalog-head {
        flex: 0 0 auto;
        min-height: 72px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--line);
    }

    .product-mobile-catalog-head > div {
        min-width: 0;
        display: grid;
        gap: 2px;
    }

    .product-mobile-catalog-head strong {
        color: var(--ink);
        font-size: 19px;
    }

    .product-mobile-catalog-head span {
        overflow: hidden;
        color: var(--muted);
        font-size: 13px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .product-mobile-catalog-close {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 50%;
        color: var(--ink);
        background: var(--soft);
        font-size: 27px;
        line-height: 1;
    }

    .product-mobile-catalog-body {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 10px 12px calc(20px + env(safe-area-inset-bottom));
    }

    .product-mobile-catalog-body .shop-filter {
        padding: 4px;
        border: 0;
        background: transparent;
    }

    .product-mobile-catalog-body .catalog-tree {
        max-height: none;
        margin-top: 0;
        overflow: visible;
        padding-right: 0;
    }

    body.product-catalog-open {
        overflow: hidden;
    }
}

@media (max-width: 680px) {
    .product-detail-layout {
        padding-top: 12px;
        padding-bottom: 44px;
    }

    .product-detail-main > .product-page {
        gap: 10px;
    }

    .product-detail-main .gallery-main {
        border-radius: 13px;
    }

    .product-detail-main .product-info,
    .product-content-section {
        border-radius: 13px;
    }

    .product-detail-main .product-info {
        padding: 14px;
    }

    .product-detail-main .product-info h1 {
        font-size: 26px;
    }

    .product-detail-main .buybox .price {
        font-size: 28px;
    }

    .product-detail-main .buy-actions {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    }

    .product-detail-main .buy-actions .btn {
        font-size: 15px;
    }

    .product-content-section {
        padding: 17px 14px 19px;
    }

    .product-content-section .section-title {
        font-size: 22px;
    }
}


/* ============================================================
 * v0.6.13：商品分類只顯示分類；商品選購手機雙欄緊湊卡片
 * - 商品分類選單不列產品名稱，只保留大類與第二階分類。
 * - 桌機商品仍在右側以卡片格狀呈現。
 * - 680px 以下只針對商品選購結果維持兩欄，不影響其他 grid4/grid5。
 * ============================================================ */
.catalog-category-list {
    display: grid;
    gap: 3px;
    padding: 2px 0 5px 35px;
}

.catalog-category-list[hidden] {
    display: none;
}

.catalog-second-level-link {
    padding: 8px 10px;
    color: #58483a;
    font-size: 14px;
    font-weight: 700;
}

.shop-product-grid {
    align-items: stretch;
}

.shop-product-grid .product-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.shop-product-grid .product-card .card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.shop-product-grid .product-card .price {
    margin-top: auto;
}

@media (max-width: 680px) {
    .shop-layout {
        gap: 20px;
        padding-top: 22px;
        padding-bottom: 52px;
    }

    .shop-sidebar .shop-filter {
        padding: 14px;
        border-radius: 13px;
    }

    .shop-sidebar .catalog-tree {
        max-height: 340px;
        margin-top: 12px;
    }

    .shop-section-head {
        margin-bottom: 16px;
    }

    .shop-section-head .section-title {
        font-size: clamp(27px, 8vw, 34px);
    }

    .shop-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .shop-product-grid .product-card {
        border-radius: 13px;
        box-shadow: 0 6px 20px rgba(65, 45, 27, .04);
    }

    .shop-product-grid .product-image {
        aspect-ratio: 1 / 1;
    }

    .shop-product-grid .product-card .card-body {
        padding: 10px 10px 12px;
    }

    .shop-product-grid .product-card .card-body > small {
        min-height: 1.4em;
        font-size: 11px;
        line-height: 1.4;
    }

    .shop-product-grid .product-card h3 {
        min-height: 2.8em;
        margin-bottom: 6px;
        font-size: 15px;
        line-height: 1.4;
    }

    .shop-product-grid .product-card .price {
        font-size: 18px;
        line-height: 1.35;
        white-space: nowrap;
    }

    .catalog-category-list {
        padding-left: 35px;
    }
}

@media (max-width: 380px) {
    .shop-product-grid {
        gap: 8px;
    }

    .shop-product-grid .product-card .card-body {
        padding-right: 8px;
        padding-left: 8px;
    }

    .shop-product-grid .product-card h3 {
        font-size: 14px;
    }

    .shop-product-grid .product-card .price {
        font-size: 17px;
    }
}

/* ============================================================
 * v0.6.16：商品標題列排序／篩選小按鈕
 * - 桌機與手機都不再常駐排序下拉選單。
 * - 「排序」與「篩選」兩顆小按鈕移到商品標題右側，從右側向左排列。
 * - 排序按鈕開啟浮動選單，點選排序項目後直接送出並收回。
 * - 篩選按鈕維持浮動條件面板，套用、點外部或按 Esc 後收回。
 * - 保留桌機每頁 20 項、手機每頁 10 項、分類切換歸零與全站回頂。
 * ============================================================ */
.shop-title-block {
    width: 100%;
    min-width: 0;
}

.shop-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.shop-title-row .section-title {
    min-width: 0;
}

.shop-controls {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    margin-left: auto;
    flex: 0 0 auto;
}

.shop-control-toggle {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--brown);
    background: var(--soft);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.shop-control-toggle:hover,
.shop-control-toggle:focus-visible,
.shop-control-toggle[aria-expanded="true"] {
    border-color: #cdb49a;
    background: #eadbc9;
}

.shop-sort-panel,
.shop-filter-panel {
    position: absolute;
    top: calc(100% + 8px);
    z-index: 45;
    display: none;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(55, 39, 24, .18);
}

.shop-sort-panel {
    right: 0;
    width: min(245px, calc(100vw - 40px));
    padding: 8px;
}

.shop-sort-panel.open {
    display: grid;
    gap: 4px;
}

.shop-sort-option {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 8px 11px;
    border: 0;
    border-radius: 9px;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.shop-sort-option:hover,
.shop-sort-option:focus-visible {
    background: #f6efe7;
}

.shop-sort-option.active {
    color: var(--brown);
    background: var(--soft);
    font-weight: 900;
}

.shop-filter-panel {
    right: 0;
    width: min(520px, calc(100vw - 40px));
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
}

.shop-filter-panel.open {
    display: grid;
}

.shop-control-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.shop-control-field label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.shop-control-field select {
    width: 100%;
    min-height: 38px;
    padding: 6px 32px 6px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    background: #fff;
}

.shop-check-control {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--soft);
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
}

.shop-check-control input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--brown);
}

.shop-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.shop-filter-actions .btn {
    width: 100%;
    justify-content: center;
}

.shop-filter-actions .btn:only-child {
    grid-column: 1 / -1;
}

.btn-small {
    min-height: 40px;
    padding: 7px 12px;
    white-space: nowrap;
}

.shop-result-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.shop-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 34px 0 0;
}

.shop-page-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.shop-page-link,
.shop-page-ellipsis {
    min-width: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 900;
}

.shop-page-link:hover,
.shop-page-link.active {
    border-color: #cdb49a;
    color: #fff;
    background: var(--brown);
}

.shop-page-link.disabled {
    pointer-events: none;
    opacity: .42;
}

.shop-page-ellipsis {
    min-width: 26px;
    padding-right: 3px;
    padding-left: 3px;
    border-color: transparent;
    background: transparent;
}

.shop-page-nav {
    min-width: 76px;
    white-space: nowrap;
}

.back-to-top {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 76;
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(112, 70, 31, .22);
    border-radius: 50%;
    color: #fff;
    background: rgba(112, 70, 31, .94);
    box-shadow: 0 10px 28px rgba(65, 45, 27, .22);
    font-size: 27px;
    font-weight: 900;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .18s ease, transform .18s ease, background .18s ease;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
    background: var(--ink);
}

@media (max-width: 680px) {
    .shop-title-row {
        align-items: center;
        flex-wrap: wrap;
        gap: 9px 10px;
    }

    .shop-title-row .section-title {
        flex: 1 1 auto;
    }

    .shop-controls {
        gap: 6px;
        margin-left: auto;
    }

    .shop-control-toggle {
        min-height: 34px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .shop-sort-panel {
        right: 0;
        width: min(230px, calc(100vw - 38px));
    }

    .shop-filter-panel {
        right: 0;
        width: min(460px, calc(100vw - 38px));
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
        padding: 12px;
    }

    .shop-control-field select {
        min-height: 42px;
        font-size: 13px;
    }

    .shop-result-meta {
        margin-bottom: 10px;
        font-size: 12px;
    }

    .shop-pagination {
        gap: 7px;
        margin-top: 24px;
    }

    .shop-page-numbers {
        max-width: 46vw;
        gap: 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .shop-page-numbers::-webkit-scrollbar {
        display: none;
    }

    .shop-page-link,
    .shop-page-ellipsis {
        min-width: 38px;
        min-height: 40px;
        padding: 6px 8px;
        font-size: 13px;
        flex: 0 0 auto;
    }

    .shop-page-nav {
        min-width: 66px;
    }

    .back-to-top {
        right: max(14px, env(safe-area-inset-right));
        bottom: max(14px, env(safe-area-inset-bottom));
        width: 46px;
        height: 46px;
        font-size: 25px;
    }
}

@media (max-width: 420px) {
    .shop-filter-panel {
        grid-template-columns: 1fr;
    }

    .shop-filter-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: none;
    }
}


/* ============================================================
 * v0.6.22：商品選購手機第一階分類橫列與自動續載
 * - 手機第一階分類固定在共用 Logo／主選單下方，同一列左右滑動。
 * - 目前第一階分類如有第二階分類，以第二列緊湊橫向捷徑保留既有分類能力。
 * - 手機原本的大型分類樹隱藏，但搜尋欄保留為單列，不移除既有搜尋功能。
 * - 啟用 IntersectionObserver 後隱藏手機分頁並改為接近底部自動續載；無 JS 或載入失敗時仍保留原分頁 fallback。
 * - 桌機版不套用本段行為。
 * ============================================================ */
.shop-mobile-category-shell {
    display: none;
}

.shop-infinite-status {
    display: none;
}

.shop-infinite-status[hidden] {
    display: none;
}

@media (max-width: 680px) {
    .site-header {
        top: 0;
    }

    .shop-mobile-category-shell {
        position: sticky;
        top: var(--header);
        z-index: 74;
        display: block;
        width: 100%;
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 8px 22px rgba(65, 45, 27, .05);
    }

    .shop-mobile-category-scroll,
    .shop-mobile-subcategory-scroll {
        display: flex;
        align-items: stretch;
        width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .shop-mobile-category-scroll::-webkit-scrollbar,
    .shop-mobile-subcategory-scroll::-webkit-scrollbar {
        display: none;
    }

    .shop-mobile-category-link {
        position: relative;
        flex: 0 0 auto;
        min-height: 50px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 18px;
        border-bottom: 3px solid transparent;
        color: #65574c;
        background: #fff;
        font-size: 15px;
        font-weight: 800;
        line-height: 1.25;
        white-space: nowrap;
        scroll-snap-align: center;
    }

    .shop-mobile-category-link.active {
        border-bottom-color: var(--brown);
        color: var(--brown);
        background: #f5eee5;
        font-weight: 900;
    }

    .shop-mobile-subcategory-scroll {
        min-height: 42px;
        gap: 7px;
        padding: 6px 12px 7px;
        border-top: 1px solid rgba(226, 214, 200, .72);
        background: #fbf7f0;
    }

    .shop-mobile-subcategory-link {
        flex: 0 0 auto;
        min-height: 30px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 4px 11px;
        border: 1px solid var(--line);
        border-radius: 999px;
        color: #67584b;
        background: #fff;
        font-size: 12px;
        font-weight: 800;
        line-height: 1.2;
        white-space: nowrap;
        scroll-snap-align: center;
    }

    .shop-mobile-subcategory-link.active {
        border-color: #cdb49a;
        color: #fff;
        background: var(--brown);
        font-weight: 900;
    }

    .shop-layout {
        gap: 12px;
        padding-top: 12px;
    }

    .shop-sidebar {
        display: block;
        margin: 0;
    }

    .shop-sidebar .shop-filter {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .shop-sidebar .shop-filter > form {
        margin: 0;
    }

    .shop-sidebar .shop-filter > form .field {
        position: relative;
        display: block;
        margin: 0;
    }

    .shop-sidebar .shop-filter > form .field label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .shop-sidebar .shop-filter > form .field input {
        min-height: 44px;
        padding: 0 14px;
        border-radius: 12px;
        background: #fff;
        font-size: 15px;
    }

    .shop-sidebar .catalog-tree {
        display: none;
    }

    .shop-results > .breadcrumb {
        margin-top: 0;
    }

    body.shop-infinite-active .shop-pagination {
        display: none;
    }

    .shop-infinite-status {
        min-height: 54px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        margin: 20px 0 2px;
        padding: 10px 12px;
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        text-align: center;
    }

    .shop-infinite-retry {
        min-height: 34px;
        padding: 5px 11px;
        border: 1px solid var(--line);
        border-radius: 9px;
        color: var(--brown);
        background: var(--soft);
        font-size: 12px;
        font-weight: 900;
    }
}


/* ==========================================================
 * v0.6.18｜前台圖片一般另存防護與文字浮水印覆蓋層
 * ========================================================== */
img {
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    user-select: none;
}

.phc-image-watermark-overlay {
    position: absolute;
    z-index: 4;
    display: block;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.phc-image-watermark-overlay[hidden] {
    display: none;
}

.phc-image-watermark-single {
    position: absolute;
    left: 50%;
    top: 50%;
    display: block;
    width: max-content;
    max-width: 92%;
    font-family: Arial, "Noto Sans TC", sans-serif;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    white-space: pre-line;
    opacity: 0.38;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.48);
    transform-origin: center center;
}

/* ==========================================================
 * v0.6.21｜商用服務頁：咖啡機租賃方案／企業採購與供豆
 * 修改日期：2026/09/22 22:12（UTC+8）
 * ========================================================== */
.service-page {
    padding-top: 34px;
    padding-bottom: 72px;
}

.service-page-head {
    max-width: 900px;
    margin: 22px auto 40px;
    text-align: center;
}

.service-page-eyebrow {
    margin: 0 0 8px;
    color: var(--brown);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .16em;
}

.service-page-summary {
    max-width: 780px;
    margin-right: auto;
    margin-left: auto;
}

.service-page-cover {
    margin-bottom: 34px;
}

.service-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 24px;
    margin: 0 0 42px;
}

.service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100%;
    padding: 28px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .74);
}

.service-card-badge {
    position: absolute;
    top: -12px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 12px;
    color: #fff;
    background: var(--brown);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
}

.service-card h2 {
    margin: 6px 0 8px;
    font-size: clamp(21px, 2vw, 28px);
    line-height: 1.35;
}

.service-card-subtitle {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.service-card-content {
    flex: 1;
    margin-top: 22px;
}

.service-card-content ul,
.service-card-content ol {
    margin: 0;
    padding-left: 1.3em;
}

.service-card-content li + li {
    margin-top: 8px;
}

.service-card-price {
    margin: 24px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--brown);
    font-weight: 900;
}

.service-card-action {
    display: flex;
    align-items: flex-end;
    min-height: 58px;
    margin-top: 22px;
}

.service-card-action.is-empty {
    visibility: hidden;
}

.service-card-button {
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid var(--ink);
    color: #fff;
    background: var(--ink);
    font-weight: 900;
    text-align: center;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.service-card-button:hover,
.service-card-button:focus-visible {
    border-color: var(--brown);
    background: var(--brown);
    transform: translateY(-1px);
}

.service-page-content {
    max-width: 980px;
    margin: 0 auto;
    padding: 34px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .56);
}

@media (max-width: 980px) {
    .service-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .service-page {
        padding-top: 20px;
        padding-bottom: 48px;
    }

    .service-page-head {
        margin-top: 16px;
        margin-bottom: 28px;
        text-align: left;
    }

    .service-page-summary {
        margin-left: 0;
    }

    .service-card-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .service-card {
        padding: 24px 20px;
    }

    .service-page-content {
        padding: 24px 20px;
    }
}

/* ============================================================
 * v0.6.25：桌機版手機底部導覽漏出緊急修正
 * - mobile-bottom-nav 在所有 viewport 預設隱藏。
 * - 只有手機／平板 breakpoint 才明確啟用 grid。
 * - 桌機再加一道 min-width 強制隱藏，避免 APP 導覽落入一般文件流。
 * - SVG 加入基礎尺寸上限，避免任何樣式失配時放大撐開頁面。
 * ============================================================ */
.mobile-bottom-nav {
    display: none;
}

.mobile-bottom-nav svg {
    width: 25px;
    height: 25px;
    max-width: 25px;
    max-height: 25px;
}

@media (min-width: 981px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* ============================================================
 * v0.6.23：手機 APP 式底部導覽、商品分類雙列置頂與置頂切換
 * - 後台可切換 APP 式底部五大圖示 / 原右上三條線抽屜。
 * - 商品頁手機版讓 Logo 頁首正常隨頁面上滑；分類碰到畫面頂端後固定。
 * - 分類固定後縮小兩列高度，保留更多商品可視空間。
 * - 置頂狀態切分類時只更新分類與商品內容，不把完整頁首重新拉回畫面。
 * ============================================================ */
@media (max-width: 980px) {
    .site-header.mobile-nav-mode-bottom .mobile-menu-btn {
        display: none;
    }

    body.mobile-bottom-nav-enabled {
        padding-bottom: calc(82px + env(safe-area-inset-bottom));
    }

    body.mobile-bottom-nav-enabled .back-to-top {
        bottom: calc(92px + env(safe-area-inset-bottom));
    }

    .mobile-bottom-nav {
        position: fixed;
        right: 12px;
        bottom: max(10px, env(safe-area-inset-bottom));
        left: 12px;
        z-index: 96;
        min-height: 70px;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: end;
        padding: 7px 8px 8px;
        border: 1px solid rgba(112, 70, 31, .18);
        border-radius: 28px;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 10px 34px rgba(36, 25, 17, .18);
        backdrop-filter: blur(16px);
    }

    .mobile-bottom-nav-item {
        position: relative;
        min-width: 0;
        min-height: 55px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 3px;
        padding: 5px 2px 1px;
        border-radius: 18px;
        color: #73685f;
        font-size: 11px;
        font-weight: 800;
        line-height: 1.1;
        text-align: center;
    }

    .mobile-bottom-nav-item > svg {
        width: 25px;
        height: 25px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-bottom-nav-item.active {
        color: var(--brown);
        background: #f4ecdf;
    }

    .mobile-bottom-nav-primary {
        padding-top: 0;
        background: transparent !important;
    }

    .mobile-bottom-nav-primary-icon {
        position: relative;
        width: 54px;
        height: 54px;
        display: grid;
        place-items: center;
        margin-top: -24px;
        border: 5px solid rgba(255, 255, 255, .98);
        border-radius: 50%;
        color: #fff;
        background: var(--brown);
        box-shadow: 0 8px 20px rgba(112, 70, 31, .28);
    }

    .mobile-bottom-nav-primary-icon svg {
        width: 25px;
        height: 25px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-bottom-nav-primary.active .mobile-bottom-nav-primary-icon {
        background: var(--ink);
    }

    .mobile-bottom-nav-count {
        position: absolute;
        top: -5px;
        right: -5px;
        min-width: 19px;
        height: 19px;
        display: grid;
        place-items: center;
        padding: 0 5px;
        border: 2px solid #fff;
        border-radius: 999px;
        color: #fff;
        background: #9a5f24;
        font-size: 10px;
        font-weight: 900;
        line-height: 1;
    }
}

@media (max-width: 680px) {
    body.shop-page .site-header {
        position: relative;
        top: auto;
    }

    body.shop-page .shop-mobile-category-shell {
        top: 0;
        transition: box-shadow .16s ease;
    }

    body.shop-page .shop-mobile-category-shell.is-pinned {
        box-shadow: 0 10px 24px rgba(47, 31, 18, .12);
    }

    body.shop-page .shop-mobile-category-shell.is-pinned .shop-mobile-category-link {
        min-height: 43px;
        padding-right: 15px;
        padding-left: 15px;
        font-size: 14px;
    }

    body.shop-page .shop-mobile-category-shell.is-pinned .shop-mobile-subcategory-scroll {
        min-height: 35px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    body.shop-page .shop-mobile-category-shell.is-pinned .shop-mobile-subcategory-link {
        min-height: 26px;
        padding: 3px 9px;
        font-size: 11px;
    }

    body.shop-page.shop-category-switching .shop-results,
    body.shop-page.shop-category-switching .shop-sidebar {
        opacity: .55;
        pointer-events: none;
    }

    body.shop-page .shop-results,
    body.shop-page .shop-sidebar {
        transition: opacity .12s ease;
    }
}


/* ============================================================
 * v0.6.24：手機商品分類置頂相容性修正
 * - 不再依賴 body/html overflow 狀態下可能失效的 position:sticky。
 * - 使用頁面中的定位錨點判斷分類是否已碰到 viewport top。
 * - 碰頂後分類 shell 改為 fixed；原位置以等高 spacer 保留，避免商品整頁跳動。
 * - 固定狀態仍沿用 v0.6.23 的雙列縮小與局部分類切換。
 * - 回到分類原始位置上方時才解除 fixed，恢復完整頁首＋完整分類呈現。
 * ============================================================ */
.shop-mobile-category-anchor,
.shop-mobile-category-spacer {
    display: none;
}

@media (max-width: 680px) {
    body.shop-page .shop-mobile-category-anchor {
        display: block;
        width: 100%;
        height: 0;
        pointer-events: none;
    }

    body.shop-page .shop-mobile-category-spacer {
        display: block;
        width: 100%;
        height: 0;
        pointer-events: none;
    }

    body.shop-page .shop-mobile-category-shell {
        position: relative;
        top: auto;
        right: auto;
        left: auto;
        z-index: 74;
        width: 100%;
    }

    body.shop-page .shop-mobile-category-shell.is-pinned {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 76;
        width: 100%;
    }

    body.shop-page .shop-mobile-category-spacer.is-active {
        height: var(--shop-mobile-category-pinned-height, 0px);
    }
}

@media (max-width: 380px) {
    .mobile-bottom-nav {
        right: 7px;
        left: 7px;
        padding-right: 5px;
        padding-left: 5px;
    }

    .mobile-bottom-nav-item {
        font-size: 10px;
    }
}

.shopping-login-hint {
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 1px solid #dcc7ad;
    border-radius: 10px;
    color: #6f4c28;
    background: #fbf4e8;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.55;
}

@media (max-width: 980px) {
    .mobile-bottom-nav-icon-wrap {
        position: relative;
        width: 27px;
        height: 27px;
        display: grid;
        place-items: center;
    }

    .mobile-bottom-nav-icon-wrap svg {
        width: 25px;
        height: 25px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
}

@media (max-width: 980px) {
    button.mobile-bottom-nav-item {
        border: 0;
        background: transparent;
        font-family: inherit;
        cursor: pointer;
    }

    button.mobile-bottom-nav-item:hover,
    button.mobile-bottom-nav-item:focus-visible {
        color: var(--brown);
        background: #f4ecdf;
        outline: none;
    }
}

/* 0.7.0 商用洽詢表單。與品牌配色一致、手機單欄、實體鍵盤可操作。 */
.service-inquiry{max-width:1050px;margin:36px auto 0;padding:30px;border:1px solid var(--line);background:#fff}
.service-inquiry h2{margin:0 0 10px;font-size:clamp(24px,2.5vw,34px)}
.service-inquiry-intro{margin:0 0 26px;color:var(--muted)}
.inquiry-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 16px}
.inquiry-field{min-width:0;margin:0;padding:0;border:0}
.inquiry-field legend,.inquiry-field>label{display:block;margin-bottom:8px;font-weight:800;color:var(--ink)}
.inquiry-field .required{color:#9c3333}
.inquiry-field input:not([type=checkbox]):not([type=radio]),.inquiry-field textarea{display:block;width:100%;min-height:48px;box-sizing:border-box;padding:11px 12px;border:1px solid #d6c5b5;border-radius:2px;background:#faf7f4;color:var(--ink);font:inherit}
.inquiry-field textarea{min-height:100px;resize:vertical}
.inquiry-field.full{grid-column:1/-1}
.inquiry-options{display:flex;flex-wrap:wrap;gap:9px}
.inquiry-choice{position:relative;display:inline-flex;max-width:100%;min-height:45px;align-items:center;cursor:pointer}
.inquiry-choice input{position:absolute;opacity:0;width:1px;height:1px}
.inquiry-choice span{display:flex;align-items:center;justify-content:center;min-height:45px;box-sizing:border-box;padding:10px 14px;border:1px solid #dbc7b5;color:var(--ink);background:#faf7f4;font-size:14px;line-height:1.45;font-weight:650}
.inquiry-choice input:checked+span{border-color:#3a281c;background:#efe2d0;box-shadow:inset 0 0 0 1px #3a281c}
.inquiry-choice input:focus-visible+span{outline:3px solid #966b44;outline-offset:2px}
.inquiry-hint{font-size:12px;color:var(--muted);margin:6px 0 0}
.inquiry-agree{display:flex;gap:9px;align-items:flex-start;margin:26px 0 15px;line-height:1.6}
.inquiry-agree input{width:18px;height:18px;flex:0 0 auto;margin-top:3px}
.inquiry-submit{min-height:54px;width:100%;background:var(--ink);color:white;border:none;font-size:17px;font-weight:800;cursor:pointer}
.inquiry-submit:hover,.inquiry-submit:focus-visible{background:var(--brown)}
.inquiry-alert{padding:13px 16px;margin:18px 0;border:1px solid #92b18b;background:#eef8ea}
.inquiry-honeypot{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
@media(max-width:700px){.service-inquiry{padding:20px 15px}.inquiry-grid{grid-template-columns:1fr}.inquiry-field.full{grid-column:auto}.inquiry-choice span{font-size:14px}}

/* PHC Portal v0.7.4 — preserve service-card anchor without disabled-form placeholder content. */
.service-contact-anchor {height:1px;scroll-margin-top:96px;}
#service-contact {scroll-margin-top:96px;}

/* v0.7.5: each assigned inquiry form has its own stable anchor. */
.service-inquiry {scroll-margin-top:95px;}
