/* ===================================================
   Shop / E-Commerce Styles
   與現有 app.css、tokens.css 共用 CSS 變數
   =================================================== */

/* --- 商品卡片 --- */
.shop-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0.5rem;
    cursor: pointer;
}
.shop-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
}
.shop-card .card-body {
    padding: 0.875rem;
}
.shop-card .card-title {
    font-size: 1.2rem;
    color: var(--greentwo);
}
 .news-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 50rem;
    font-size: 0.7rem;
    white-space: nowrap;
    background-color: var(--earth-brown);
    color: var(--color-white);
}

/* --- 商店大圖輪播高度限制（與其他頁面一致） --- */
.p-shop-index .hero-image { position: relative; }
.p-shop-index .hero-img { max-height: 80vh; aspect-ratio: 21/9; object-fit: cover; }
@media (max-width: 991.98px) { .p-shop-index .hero-img { aspect-ratio: 16/9; } }
@media (max-width: 575.98px) { .p-shop-index .hero-img { aspect-ratio: auto; max-height: 80vh; object-fit: contain; background: var(--color-black); } }

/* --- 商品標籤（左上角） --- */
.shop-tag-badge {
    z-index: 2;
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
}

.shop-empty-state {
    max-width: 1080px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    border-radius: 1rem;
    text-align: center;
    background: var(--empty-state-bg, #f8f9fa);
    border: 1px solid rgba(23, 103, 124, .14);
    box-shadow: 0 10px 30px rgba(17, 24, 39, .06);
}

.shop-empty-state .order-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--empty-state-color, var(--greentwo));
    font-size: 2rem;
    box-shadow: 0 8px 20px rgba(17, 24, 39, .08);
}

.shop-empty-state h5 {
    color: var(--empty-state-color, var(--greentwo));
    font-weight: 800;
}

.shop-no-results {
    width: 100%;
    min-height: clamp(18rem, 34vw, 24rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(3rem, 8vw, 5.5rem) 1rem;
    text-align: center;
    background: transparent;
    border: 0;
    color: #858c91;
}

.shop-no-results-icon {
    color: #858c91;
    font-size: clamp(3.7rem, 9vw, 5rem);
    line-height: 1;
    margin-bottom: 1.15rem;
}

.shop-no-results-title {
    color: #7f878d;
    font-size: clamp(1.2rem, 2.8vw, 1.45rem);
    font-weight: 900;
    line-height: 1.35;
}

.shop-no-results-text {
    color: #90979d;
    font-size: clamp(.95rem, 2.2vw, 1.05rem);
    font-weight: 800;
    line-height: 1.5;
}

.shop-no-results-clear {
    min-height: 2.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin-top: 1.75rem;
    padding: .45rem .9rem;
    border: 1.5px solid #2634d8;
    border-radius: .6rem;
    background: transparent;
    color: #2634d8;
    font-weight: 900;
    line-height: 1.2;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.shop-no-results-clear:hover,
.shop-no-results-clear:focus {
    background: #2634d8;
    color: #fff;
    box-shadow: 0 0 0 .2rem rgba(38, 52, 216, .12);
}

.shop-no-results-clear:active {
    transform: translateY(1px);
}

@media (max-width: 575.98px) {
    .shop-no-results {
        min-height: 16rem;
        padding: 2.75rem .75rem;
    }

    .shop-no-results-clear {
        width: min(100%, 11rem);
    }
}

/* --- 愛心收藏按鈕（右上角） --- */
.shop-wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s;
    font-size: .88rem;
    z-index: 2;
    color: #9ca3af;
}
.shop-wishlist-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: #dc3545;
    transform: scale(1.1);
}
.shop-wishlist-btn.active {
    background: rgba(255, 255, 255, 1);
    color: #dc3545;
}
.shop-wishlist-btn.active:hover {
    transform: scale(1.15);
}

/* --- 購物車浮動按鈕 --- */
.shop-cart-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.shop-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #dc3545;
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* --- 導航列：會員下拉選單 --- */
.member-nav-dropdown .nav-link {
    color: #374151;
    transition: color 0.2s ease;
    position: relative;
}
.member-nav-dropdown .nav-link:hover {
    color: var(--greenthree);
}
.member-nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--greenthree);
}
.member-nav-dot {
    position: absolute;
    top: 8px;
    right: 16px;
    width: 8px;
    height: 8px;
    background-color: #dc3545;
    border-radius: 50%;
    border: 2px solid #fff;
}
.member-nav-menu {
    border-radius: 0.65rem;
    border: 1px solid var(--color-border-subtle);
    min-width: 220px;
    padding: 0.4rem 0;
    margin-top: 0.5rem;
}
.member-nav-menu .dropdown-item {
    padding: 0.55rem 1rem;
    font-size: 0.92rem;
    transition: all 0.15s;
}
.member-nav-menu .dropdown-item:hover {
    background-color: #f0fdf4;
    color: var(--greentwo);
}
.member-nav-menu .dropdown-item:hover i {
    color: #fff !important;
}
.member-nav-menu .dropdown-divider {
    border-color: var(--color-border-subtle);
}
.member-nav-greeting {
    background-color: var(--soft-cream);
    border-bottom: 1px solid var(--color-border-subtle);
    margin-bottom: 0.25rem;
}

/* --- 商品詳情頁（舊版相容） --- */
.shop-thumb {
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
    cursor: pointer;
}
.shop-thumb.active,
.shop-thumb:hover {
    border-color: var(--greenthree);
}
.shop-spec-btn.active {
    background-color: var(--greenthree) !important;
    border-color: var(--greenthree) !important;
    color: #fff !important;
}

/* 數量輸入框隱藏上下箭頭 */
#qtyInput::-webkit-outer-spin-button,
#qtyInput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#qtyInput[type=number] {
    -moz-appearance: textfield;
}

/* --- 商品詳情頁（新版） --- */
.product-detail-card {
    border-radius: 1rem;
}
.product-gallery-col {
    background: linear-gradient(135deg, var(--soft-cream) 0%, #fafaf5 100%);
}
.product-info-col {
    background: #fff;
}

/* 主圖 */
.product-main-image {
    background: #fff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.product-main-image img {
    width: 100%;
    height: 520px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.product-main-image:hover img {
    transform: scale(1.04);
}
.product-zoom-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--greentwo);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.product-zoom-btn:hover {
    background: var(--greenthree);
    color: #fff;
}

/* 縮圖 */
.product-thumb {
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}
.product-thumb img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}
.product-thumb:hover {
    border-color: var(--greenthree);
}
.product-thumb.active {
    border-color: var(--greenthree);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.15);
}

/* 價格區塊 */
.product-price-box {
    background: linear-gradient(135deg, #fff7ed 0%, #fef3e2 100%);
    /*border-left: 4px solid var(--earth-brown);*/
}

/* 規格按鈕（新版） */
.product-spec-btn {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    color: #374151;
    padding: 0.45rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.product-spec-btn:hover {
    border-color: var(--greenthree);
    color: var(--greenthree);
}

.product-spec-btn:disabled,
.product-spec-btn.is-sold-out {
    border-color: #d1d5db;
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

.product-spec-btn:disabled:hover,
.product-spec-btn.is-sold-out:hover {
    border-color: #d1d5db;
    color: #9ca3af;
}

.product-spec-btn.is-sold-out.active {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #94a3b8;
}

.product-spec-btn.is-sold-out.active::after {
    background: #94a3b8;
}

.spec-sold-out-label {
    display: inline-flex;
    align-items: center;
    margin-left: .35rem;
    padding: .05rem .35rem;
    border-radius: 999px;
    background: #e5e7eb;
    color: #6b7280;
    font-size: .72rem;
    font-weight: 700;
}

.product-spec-btn.active {
    border-color: var(--greenthree);
    background: rgba(25, 135, 84, 0.08);
    color: var(--greentwo);
    font-weight: 600;
}
.product-spec-btn.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 14px;
    height: 14px;
    background: var(--greenthree);
    border-top-left-radius: 0.5rem;
    border-bottom-right-radius: 0.45rem;
}
.product-spec-btn.active::before {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    bottom: -1px;
    right: 0;
    color: #fff;
    font-size: 0.55rem;
    z-index: 1;
    line-height: 14px;
    width: 14px;
    text-align: center;
}

/* 數量控制（新版） */
.product-qty-group {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
}
.product-qty-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
}
.product-qty-btn:hover {
    background: var(--greenthree);
    color: #fff;
}
.product-qty-input {
    width: 60px;
    height: 38px;
    border: none;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--greentwo);
    outline: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
}
.product-qty-input::-webkit-outer-spin-button,
.product-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.product-qty-input[type=number] {
    -moz-appearance: textfield;
}

/* 服務保障 */
.product-services i {
    font-size: 1.4rem;
}

/* Tab 頁籤 */
.nav-tabs .nav-link {
    color: var(--muted-foreground);
    font-weight: 500;
}
.nav-tabs .nav-link.active {
    color: var(--greenthree);
    border-bottom-color: var(--greenthree);
    font-weight: 600;
}

/* 商品 Tabs */
.product-tabs {
    background-color: #fff;
    border-bottom: 1px solid var(--color-border-subtle);
    padding: 0 1rem;
    flex-wrap: nowrap;
    overflow-x: auto;
}
.product-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 0.85rem 1.25rem;
    color: var(--muted-foreground);
    font-weight: 500;
    background: transparent;
    white-space: nowrap;
}
.product-tabs .nav-link:hover {
    color: var(--greentwo);
    background: transparent;
}
.product-tabs .nav-link.active {
    color: var(--greentwo);
    border-bottom-color: var(--greenthree);
    font-weight: 700;
    background: transparent;
}

/* 商品規格表格 */
.product-spec-table th {
    background-color: #f9fafb;
    color: var(--greentwo);
    font-weight: 600;
    width: 160px;
    vertical-align: middle;
}
.product-spec-table td {
    vertical-align: middle;
}

/* 沖泡建議卡片 */
.brewing-tip {
    background: var(--soft-cream);
    transition: all 0.2s;
}
.brewing-tip:hover {
    background: #e8f5e8;
    transform: translateY(-2px);
}

/* ===================================================
   Member 會員系統頁面
   =================================================== */

/* 卡片本身 */
.member-card {
    border-radius: 0.75rem;
}

/* 大型圖示（信箱/鑰匙等） */
.member-big-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--greentwo) 0%, var(--greenthree) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 8px 20px rgba(25, 135, 84, 0.25);
}
.member-big-icon-success {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
}

/* 表單輸入框 */
.member-input {
    border: 1.5px solid #e5e7eb;
    border-radius: 0.6rem;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    transition: all 0.2s;
}
.member-input:focus {
    border-color: var(--greenthree);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.1);
}

/* 密碼欄位（含眼睛） */
.member-password-wrapper {
    position: relative;
}
.member-password-wrapper input {
    padding-right: 3rem;
}
.member-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.4rem;
    transition: color 0.2s;
}
.member-password-toggle:hover {
    color: var(--greenthree);
}

/* 第三方登入按鈕 */
.member-social-btn {
    border-radius: 0.6rem;
    padding: 0.7rem 1rem;
    font-weight: 500;
    transition: all 0.2s;
    border-color: #e5e7eb;
    color: #374151;
}
.member-social-btn:hover {
    border-color: var(--greenthree);
    background-color: #f0fdf4;
    color: var(--greentwo);
    transform: translateY(-1px);
}

/* "或" 分隔線 */
.member-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #9ca3af;
    font-size: 0.85rem;
}
.member-divider::before,
.member-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}
.member-divider span {
    padding: 0 1rem;
}

/* 密碼強度條 */
.member-pwd-strength .strength-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #e5e7eb;
    transition: background 0.2s;
}

/* 密碼規則 */
.pwd-rules li {
    transition: color 0.2s;
    list-style: none;
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.25rem;
}
.pwd-rules li::before {
    content: "\f111"; /* circle */
    font-family: "Font Awesome 5 Free";
    font-weight: 400;
    position: absolute;
    left: 0;
    color: #d1d5db;
    font-size: 0.6rem;
    top: 4px;
}
.pwd-rules li.rule-pass {
    color: var(--greenthree) !important;
    text-decoration: line-through;
    text-decoration-color: rgba(25, 135, 84, 0.5);
}
.pwd-rules li.rule-pass::before {
    content: "\f00c"; /* check */
    font-weight: 900;
    color: var(--greenthree);
    font-size: 0.7rem;
    text-decoration: none;
}

/* 註冊福利卡片 */
.member-perk-card {
    background: #fff;
    border: 1px solid var(--color-border-subtle);
    transition: all 0.2s;
}
.member-perk-card:hover {
    border-color: var(--greenthree);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.1);
}

/* 評價頭像 */
.review-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--greenthree);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

/* --- 結帳步驟指示 --- */
.shop-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #adb5bd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
}
.shop-step.active {
    background-color: var(--greenthree);
    color: #fff;
}
.shop-step.completed {
    background-color: var(--greenthree);
    color: #fff;
}
.shop-step-line {
    width: 80px;
    height: 3px;
    background-color: #e9ecef;
    margin: 0 0.5rem;
}
.shop-step-line.active {
    background-color: var(--greenthree);
}

/* --- 加入購物車彈窗 --- */
.swal-cart-popup {
    max-width: 420px !important;
    border-radius: 1rem !important;
}
.swal-cart-popup .swal2-html-container {
    margin: 0.5rem 1rem 0 !important;
}

/* --- 共用頁面標題列 --- */
.shop-page-header {
    background: transparent;
}
.shop-page-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid rgba(61, 106, 72, .16);
}
.shop-page-header-main {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    min-width: 0;
}
.shop-page-header-icon {
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--greenthree) 14%, transparent);
    color: var(--greentwo);
    font-size: 1.35rem;
    flex: 0 0 auto;
}
.shop-page-header-kicker {
    color: #6f7d72;
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: .12rem;
}
.shop-page-header-title {
    color: var(--greentwo);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
}
.shop-page-header-subtitle {
    color: #6f7d72;
    font-size: .9rem;
    margin: .25rem 0 0;
}
.shop-page-header-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.shop-page-header-actions .btn,
.shop-page-header-actions .review-meta-chip {
    flex: 0 0 auto;
}
@media (max-width: 767.98px) {
    .shop-page-header-bar {
        align-items: flex-start;
        flex-direction: column;
    }
    .shop-page-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* --- 商店篩選搜尋列：收藏頁 --- */
.wishlist-filter-top {
    position: relative;
    z-index: 120;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.25rem;
    overflow: visible;
}

.wishlist-search-wrap {
    position: relative;
    z-index: 120;
    min-height: 2.95rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    border: 1px solid color-mix(in srgb, var(--greenthree) 18%, transparent);
    border-radius: 999px;
    background: #fff;
    padding: .35rem .85rem;
    margin: 0;
    overflow: visible;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.wishlist-search-combo {
    width: min(100%, 320px);
    padding-right: .45rem;
}

.wishlist-search-main {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 0;
}

.wishlist-search-wrap:focus-within {
    border-color: color-mix(in srgb, var(--greenthree) 44%, transparent);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--greenthree) 10%, transparent);
}

.wishlist-search-icon {
    color: var(--greentwo);
    flex: 0 0 auto;
}

.wishlist-search-wrap .form-control {
    border: 0;
    box-shadow: none;
    background: transparent;
    min-width: 0;
    padding-left: 0;
}

.wishlist-filter-dropdown {
    position: relative;
    z-index: 130;
    flex: 0 0 auto;
}

.wishlist-filter-dropdown.show {
    z-index: 140;
}

.wishlist-filter-icon-toggle {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    width: 2.35rem;
    height: 2.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--greenthree) 7%, #fff);
    color: #486252;
    padding: 0;
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.wishlist-filter-icon-toggle:hover,
.wishlist-filter-icon-toggle:focus,
.wishlist-filter-icon-toggle.show {
    background: color-mix(in srgb, var(--greenthree) 13%, #fff);
    box-shadow: 0 0 0 .16rem color-mix(in srgb, var(--greenthree) 10%, transparent);
}

.wishlist-filter-caret {
    position: absolute;
    right: .24rem;
    bottom: .2rem;
    color: #6a7b6d;
    font-size: .58rem;
    transition: transform .16s ease;
}

.wishlist-filter-icon-toggle.show .wishlist-filter-caret {
    transform: rotate(180deg);
}

.wishlist-filter-menu {
    z-index: 150 !important;
    pointer-events: auto !important;
    min-width: 13rem;
    padding: .45rem;
    --bs-dropdown-bg: #fff;
    background: #fff !important;
    background-color: #fff !important;
    opacity: 1;
    border: 1px solid color-mix(in srgb, var(--greenthree) 14%, transparent);
    border-radius: 1rem;
  /*  box-shadow: 0 16px 36px rgba(28, 54, 39, .16);*/
}

.cart-category-menu {
    position: absolute;
    display: none;
    top: calc(100% + .45rem);
    right: 0;
    left: auto;
    transform: none !important;
}

.cart-category-menu.show {
    display: block;
}

.cart-filter-section {
    position: relative;
    z-index: 20;
    opacity: 1;
    overflow: visible;
}

.cart-filter-section > .container {
    position: relative;
    z-index: 20;
    overflow: visible;
}

.cart-main-section {
    position: relative;
    z-index: 1;
}

.shop-index-filter-section {
    position: relative;
    z-index: 20;
    opacity: 1;
    overflow: visible;
}

.shop-index-filter-section > .container {
    position: relative;
    z-index: 20;
    overflow: visible;
}

.shop-index-filter-top {
    margin-bottom: 0;
}

.shop-search-combo {
    width: min(100%, 430px);
    padding-right: .45rem;
}

.shop-filter-dropdown {
    position: relative;
    z-index: 30;
}

.shop-filter-dropdown.show {
    z-index: 45;
}

.shop-filter-menu {
    --bs-dropdown-bg: #fff;
    --bs-dropdown-link-hover-bg: #f4faf5;
    --bs-dropdown-link-active-bg: #edf7ef;
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
    background-clip: padding-box;
    opacity: 1 !important;
}

.shop-filter-menu .shop-filter-option {
    background: #fff;
    background-color: #fff;
}

.shop-filter-menu .shop-filter-option:hover,
.shop-filter-menu .shop-filter-option:focus {
    background: #f4faf5 !important;
    background-color: #f4faf5 !important;
}

.shop-filter-menu .shop-filter-option.active {
    background: #edf7ef !important;
    background-color: #edf7ef !important;
}

.shop-category-menu,
.shop-sort-menu {
    position: absolute;
    display: none;
    top: calc(100% + .45rem);
    right: 0;
    left: auto;
    transform: none !important;
}

.shop-category-menu.show,
.shop-sort-menu.show {
    display: block;
}

.shop-sort-menu {
    min-width: 14rem;
}

.shop-filter-option-label {
    min-width: 0;
    flex: 1 1 auto;
}

.shop-filter-icon-sort {
    background: #eef3ff;
    color: #2940a8;
}

.p-shop-index #productContainer,
.p-shop-index .shop-item,
.p-shop-index .shop-card,
.p-shop-index .shop-card-link,
.p-shop-index .shop-card .card-body {
    min-width: 0;
}

.p-shop-index .shop-card > .d-flex,
.p-shop-index .shop-card-actions,
.p-shop-index .d-flex2 {
    min-width: 0;
}

.p-shop-index .shop-card > .d-flex .btn,
.p-shop-index .shop-card-actions .btn,
.p-shop-index .d-flex2 .btn {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    line-height: 1.2;
    white-space: normal;
}

@media (max-width: 1199.98px) {
    .p-shop-index .shop-card-horizontal-md,
    .p-shop-index .shop-card-horizontal-md .shop-card-link {
        flex-direction: column;
    }

    .p-shop-index .shop-card-horizontal-md .shop-card-img-wrap {
        width: 100%;
        min-width: 100%;
        height: 210px;
        min-height: 210px;
    }

    .p-shop-index .shop-card-horizontal-md .card-img-left {
        width: 100%;
        height: 100%;
    }

    .p-shop-index .shop-card-horizontal-md .d-flex2 {
        align-items: stretch;
        padding: 0 1rem 1rem;
    }
}

@media (max-width: 991.98px) {
    .shop-index-filter-top {
        justify-content: center;
    }

    .shop-search-combo {
        width: min(100%, 520px);
    }

    .p-shop-index .hero-img {
        max-height: 56vh;
    }
}

@media (max-width: 767.98px) {
    .shop-index-filter-section {
        padding-top: .75rem !important;
        padding-bottom: .75rem !important;
    }

    .shop-index-filter-section > .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .shop-index-filter-top {
        width: 100%;
    }

    .shop-index-filter-section .shop-search-combo {
        width: 100%;
        max-width: 100%;
    }

    .shop-index-filter-section .wishlist-filter-menu {
        min-width: min(13rem, calc(100vw - 2rem));
        max-width: calc(100vw - 2rem);
        max-height: min(62vh, 24rem);
        overflow-y: auto;
    }

    .p-shop-index #productContainer {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }

    .p-shop-index .shop-card .card-body {
        padding: .8rem;
    }

    .p-shop-index .shop-card .card-title {
        font-size: 1.05rem;
    }

    .p-shop-index .shop-card-horizontal,
    .p-shop-index .shop-card-horizontal .shop-card-link {
        flex-direction: column !important;
    }

    .p-shop-index .shop-card-horizontal .shop-card-actions {
        position: static;
        width: 100%;
        padding: 0 1rem 1rem;
    }
}

@media (max-width: 575.98px) {
    .shop-index-filter-section > .container {
        padding-left: .875rem;
        padding-right: .875rem;
    }

    .shop-index-filter-section .shop-search-combo {
        min-height: 2.72rem;
        gap: .35rem;
        padding: .3rem .45rem .3rem .7rem;
    }

    .shop-index-filter-section .wishlist-search-main {
        gap: .45rem;
    }

    .shop-index-filter-section .wishlist-search-icon {
        font-size: .95rem;
    }

    .shop-index-filter-section .wishlist-search-wrap .form-control {
        font-size: .95rem;
        text-overflow: ellipsis;
    }

    .shop-index-filter-section .wishlist-filter-icon-toggle {
        width: 2.1rem;
        height: 2.1rem;
    }

    .shop-index-filter-section .wishlist-filter-icon-toggle .wishlist-filter-icon {
        width: 1.52rem;
        height: 1.52rem;
        flex-basis: 1.52rem;
    }

    .shop-index-filter-section .wishlist-filter-menu {
        right: -.1rem;
        padding: .35rem;
        border-radius: .85rem;
    }

    .shop-index-filter-section .wishlist-filter-option {
        min-height: 2.45rem;
        gap: .5rem;
        padding: .4rem .5rem;
        font-size: .92rem;
    }

    .shop-index-filter-section .wishlist-filter-icon {
        width: 1.65rem;
        height: 1.65rem;
        flex-basis: 1.65rem;
    }

    .p-shop-index .hero-img {
        max-height: 62vh;
    }

    .p-shop-index .shop-tag-badge {
        max-width: calc(100% - 4.25rem);
        white-space: normal;
        line-height: 1.15;
    }

    .p-shop-index .shop-card > .d-flex,
    .p-shop-index .shop-card-actions,
    .p-shop-index .d-flex2 {
        flex-direction: column;
        gap: .5rem !important;
    }

    .p-shop-index .shop-card > .d-flex .btn,
    .p-shop-index .shop-card-actions .btn,
    .p-shop-index .d-flex2 .btn {
        width: 100%;
        flex: 1 1 auto;
    }

    .p-shop-index .shop-card-horizontal .shop-card-img-wrap,
    .p-shop-index .shop-card-horizontal-md .shop-card-img-wrap {
        height: 200px;
        min-height: 200px;
    }
}

@media (max-width: 360px) {
    .shop-index-filter-section .shop-search-combo {
        gap: .25rem;
        padding-left: .55rem;
    }

    .shop-index-filter-section .wishlist-search-wrap .form-control {
        font-size: .9rem;
    }

    .shop-index-filter-section .wishlist-filter-icon-toggle {
        width: 2rem;
        height: 2rem;
    }

    .p-shop-index .shop-card .card-body {
        padding: .7rem;
    }
}

.wishlist-filter-option {
    position: relative;
    z-index: 1;
    pointer-events: auto;
    min-height: 2.65rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-radius: .75rem;
    color: #486252;
    font-weight: 800;
    padding: .45rem .6rem;
    transition: background-color .16s ease, color .16s ease;
}

.wishlist-filter-option:hover,
.wishlist-filter-option:focus {
    background: color-mix(in srgb, var(--greenthree) 8%, #fff);
    color: var(--greentwo);
}

.wishlist-filter-option.active {
    background: color-mix(in srgb, var(--greenthree) 12%, #fff);
    color: var(--greentwo);
}

.wishlist-filter-icon {
    width: 1.8rem;
    height: 1.8rem;
    flex: 0 0 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef7f1;
    color: var(--greentwo);
}

.wishlist-filter-icon-toggle .wishlist-filter-icon {
    width: 1.65rem;
    height: 1.65rem;
    flex-basis: 1.65rem;
}

.wishlist-filter-icon-category {
    background: #eef7f1;
    color: var(--greentwo);
}

.wishlist-filter-icon.shop-filter-icon-sort {
    background: #eef3ff;
    color: #2940a8;
}

.wishlist-status-icon-available {
    background: #fff3dc;
    color: #bb6b00;
}

.wishlist-status-icon-soldout {
    background: #f1f2f3;
    color: #495057;
}

.wishlist-status-icon-hidden {
    background: #eef1f4;
    color: #58616a;
}

.wishlist-status-icon-deleted {
    background: #fde8ec;
    color: #c82333;
}

@media (max-width: 767.98px) {
    .wishlist-filter-top {
        display: block;
    }

    .wishlist-search-combo {
        width: 100%;
        gap: .45rem;
        padding: .35rem .55rem;
    }

    .wishlist-filter-icon-toggle {
        width: 2.25rem;
        height: 2.25rem;
    }

    .wishlist-filter-menu {
        min-width: 12rem;
    }
}

/* --- 購物清單卡片標題列 --- */
.cart-list-header {
    background-color: var(--greentwo);
}
.cart-list-header .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.6);
    font-size: 0.78rem;
}
.cart-list-header .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}
.cart-list-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 22px;
    padding: 0 8px;
    border-radius: 50rem;
    background-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

/* --- 分類橫條 --- */
.cart-category-bar {
    background-color: #fff7ed;
    border-left: 3px solid var(--earth-brown);
}

/* --- 購物車項目（緊湊列表式） --- */
.cart-list-body .cart-item {
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    background: #fff;
}
.cart-list-body .cart-item:hover {
    background-color: #f8faf7;
    box-shadow: inset 3px 0 0 var(--greenthree);
}

.cart-list-body .cart-item-unavailable {
    background-color: #f8f9fa;
}

.cart-list-body .cart-item-unavailable:hover {
    background-color: #f8f9fa;
    box-shadow: inset 3px 0 0 #adb5bd;
}

.cart-item-unavailable .cart-thumb,
.cart-item-unavailable .cart-item-title,
.cart-item-unavailable .cart-item-desc {
    opacity: .62;
}

/* 商品縮圖 */
.cart-item-row {
    gap: 1rem;
}
.cart-item-select {
    flex: 0 0 auto;
}
.cart-thumb-link {
    display: block;
    width: 76px;
    height: 76px;
}
.cart-item-main {
    padding-right: .5rem;
}
.cart-item-title {
    font-size: 1rem;
    line-height: 1.3;
}
.cart-item-desc {
    color: #667085 !important;
    line-height: 1.45;
}
.cart-item-meta {
    min-height: 24px;
}

.cart-variant-wrap {
    max-width: 360px;
}

.cart-variant-control {
    max-width: 360px;
}

.cart-variant-icon {
    background-color: var(--greentwo);
    border-color: var(--greentwo);
    color: #fff;
}

.cart-variant-select {
    border-color: #dbe5dd;
    color: #44564a;
}

.cart-stock-status {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    color: #fff;
    border: 1px solid transparent;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.4;
}

.cart-stock-ok {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
}

.cart-stock-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.cart-stock-muted {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.cart-meta-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    background-color: var(--greentwo);
    color: #e5e7eb;
    border: var(--greentwo);
    font-size: .75rem;
    font-weight: 600;
}
.cart-item-actions {
    flex: 0 0 auto;
    gap: .75rem;
}
.cart-item-price {
    min-width: 96px;
}

.cart-thumb {
    width: 76px;
    height: 76px;
    border-radius: 0.65rem;
    object-fit: cover;
    background-color: #fef3e2;
    padding: 4px;
    border: 1px solid #fde4c4;
}

/* SKU 標籤 */
.cart-sku {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    background-color: #ecfdf5;
    color: var(--greentwo);
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid #d1fae5;
}

/* 數量控制（無邊框版本） */
.cart-qty-group {
    border: 1px solid #e5e7eb;
    border-radius: 0.4rem;
    padding: 2px;
    gap: 0 !important;
    background: #fff;
}
.cart-qty-btn {
    border: none;
    background: transparent;
    color: #6b7280;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.15s;
}
.cart-qty-btn:hover {
    background-color: #f3f4f6;
    color: var(--greenthree);
}
.cart-qty-input {
    border: none;
    background: transparent;
    width: 36px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    outline: none;
    padding: 0;
}
.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.cart-qty-input[type=number] {
    -moz-appearance: textfield;
}

/* 單位 */
.cart-unit {
    min-width: 24px;
    text-align: center;
}

/* 移除按鈕 */
.cart-remove-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #dc3545;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 0.85rem;
}
.cart-remove-btn:hover {
    background-color: #fee2e2;
}

/* --- 結帳 運送/付款選項 --- */
.shipping-option {
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.shipping-option:hover {
    border-color: var(--greenthree) !important;
}
.shipping-option.active-option {
    border-color: var(--greenthree) !important;
    background-color: #f0fdf4;
}

/* --- 會員訂單卡片 --- */
.order-card {
    transition: box-shadow 0.2s ease;
}
.order-card:hover {
    box-shadow: 0 .3rem .8rem rgba(0,0,0,.1) !important;
}

/* --- Line Clamp 工具類 --- */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- 響應式調整 --- */
@media (max-width: 991.98px) {
    /* 手機版導航列：會員下拉選單微調 */
    .member-nav-dropdown {
        width: 100%;
        padding: 0.5rem 0;
        border-top: 1px solid #dee2e6;
        margin-top: 0.5rem;
    }
    .member-nav-menu {
        margin-top: 0;
    }
}

@media (max-width: 767.98px) {
    .shop-cart-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }
    .shop-step-line {
        width: 40px;
    }
}

@media (max-width: 991.98px) {
    .product-main-image img {
        height: 320px;
    }
}

@media (max-width: 575.98px) {
    .shop-step-line {
        width: 30px;
    }
    .shop-wishlist-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    .product-main-image img {
        height: 280px;
    }
    /* 購物車項目：手機版改為兩行排列 */
    .cart-list-body .cart-item {
        flex-wrap: wrap;
        row-gap: 0.5rem;
        align-items: flex-start !important;
    }
    .cart-thumb-link,
    .cart-thumb {
        width: 64px;
        height: 64px;
    }
    .cart-list-body .cart-item > .cart-item-main {
        flex-basis: calc(100% - 112px);
        padding-right: 0;
    }
    .cart-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .cart-item-price {
        margin-right: auto;
        text-align: left !important;
    }
}
