/*
 * 龍山寺購物網 全站主題 — 對齊新官網 (lungshan-temple.devellen.com)
 * 色票：朱紅 #C83C28 / 深赭 #8e2f02 / 橘 #e86829 / 暖米 #f5f3ec / 墨灰 #333332
 * 以 body.lst-theme 提高優先權，蓋過 v2_style.php 內嵌樣式。
 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&family=Noto+Serif+TC:wght@600;700;900&display=swap');

:root {
    --accent-color: #C83C28;
    --accent-hover: #8e2f02;
    --traditional-red: #C83C28;
    --bg-warm: #f5f3ec;
    --text-dark: #333332;
    --lst-red: #C83C28;
    --lst-red-deep: #8e2f02;
    --lst-orange: #e86829;
    --lst-paper: #f5f3ec;
    --lst-ink: #333332;
}

body.lst-theme {
    background: #f5f3ec !important;
    background-image: none !important;
    color: #333332;
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif !important;
    height: auto;
    min-height: 100vh;
}
body.lst-theme h1, body.lst-theme h2, body.lst-theme h3,
body.lst-theme h4, body.lst-theme h5, body.lst-theme h6,
body.lst-theme .step-item, body.lst-theme .product-title {
    font-family: 'Noto Serif TC', serif;
}
body.lst-theme a { color: #C83C28; }
body.lst-theme a:hover { color: #8e2f02; }

/* ---------- 導覽列：一般頁面為白底朱紅下緣 ---------- */
body.lst-theme:not(.page-productselection) nav.navbar {
    background: #ffffff !important;
    border-bottom: 3px solid #C83C28 !important;
    box-shadow: 0 2px 14px rgba(51, 51, 50, .08) !important;
}
body.lst-theme .navbar_title span {
    font-family: 'Noto Serif TC', serif;
    letter-spacing: .25em;
    color: #C83C28 !important;
}
body.lst-theme .navbar a:hover { color: #8e2f02 !important; }

/* ---------- 按鈕：朱紅膠囊 ---------- */
body.lst-theme .btn-primary,
body.lst-theme .btn-success {
    background: #C83C28 !important;
    border-color: #C83C28 !important;
    border-radius: 999px;
    letter-spacing: .08em;
    box-shadow: 0 6px 16px rgba(200, 60, 40, .25) !important;
}
body.lst-theme .btn-primary:hover, body.lst-theme .btn-primary:focus,
body.lst-theme .btn-success:hover, body.lst-theme .btn-success:focus,
body.lst-theme .btn-success:active {
    background: #8e2f02 !important;
    border-color: #8e2f02 !important;
    box-shadow: 0 8px 20px rgba(142, 47, 2, .3) !important;
}
body.lst-theme .btn-outline-primary { color: #C83C28 !important; border-color: #C83C28 !important; border-radius: 999px; }
body.lst-theme .btn-outline-primary:hover { background: #C83C28 !important; color: #fff !important; }
body.lst-theme .btn-outline-secondary, body.lst-theme .btn-secondary { border-radius: 999px; }

/* ---------- 卡片 / 表單 ---------- */
body.lst-theme .card {
    border: 0 !important;
    border-top: 3px solid #C83C28 !important;
    border-radius: 6px !important;
    box-shadow: 0 12px 32px rgba(142, 47, 2, .08) !important;
    background: #fff;
}
body.lst-theme .card.rounded-4, body.lst-theme .rounded-4 { border-radius: 6px !important; }
body.lst-theme .bg-primary { background-color: #C83C28 !important; }
body.lst-theme .text-primary { color: #C83C28 !important; }
body.lst-theme .form-control, body.lst-theme .form-select { border-radius: 4px; border-color: rgba(51, 51, 50, .25); }
body.lst-theme .form-control:focus, body.lst-theme .form-select:focus {
    border-color: #C83C28 !important;
    box-shadow: 0 0 0 .22rem rgba(200, 60, 40, .16) !important;
}
body.lst-theme .table > thead { background: #f5f3ec; color: #8e2f02; }
body.lst-theme .alert-warning { background: #f5f3ec; border-color: #e86829; color: #8e2f02; }
body.lst-theme .badge.bg-primary, body.lst-theme .badge.bg-success { background: #C83C28 !important; }

/* ---------- 步驟列 ---------- */
body.lst-theme .progress-stepper {
    border: 0;
    border-bottom: 3px solid #C83C28;
    border-radius: 6px;
    box-shadow: 0 8px 22px rgba(142, 47, 2, .1);
}
body.lst-theme .step-item.active { color: #C83C28; }

/* 商品頁 Hero 維持原本設計（桌機白底、手機黑底），不套用朱紅 */
body.lst-theme .product-card { border-radius: 6px; }
body.lst-theme .product-price { color: #C83C28; }

/* ---------- 頁尾：深墨灰（對齊新官網） ---------- */
body.lst-theme .v2-static-footer {
    background: #333332;
    color: rgba(255, 255, 255, .78);
    border-top: 4px solid #C83C28;
}
body.lst-theme .v2-static-footer p { color: inherit; }
body.lst-theme footer.fixed-bottom .footer-copyright { color: #333332 !important; }

/* 捲軸與選取色 */
body.lst-theme ::selection { background: #C83C28; color: #fff; }

/* ===== 購物車按鈕：無底色，灰色購物車圖示 + 右上紅圈數字 + 下方「購物車」 ===== */
body.lst-theme .sticky-finish-bar .btn-view-cart,
body.lst-theme .sticky-finish-bar.has-items .btn-view-cart {
    position: relative !important;
    flex-direction: column !important;
    gap: 4px;
    min-width: 64px !important;
    padding: 6px 14px 2px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    color: #333332 !important;
    line-height: 1.1;
    animation: none;
}
body.lst-theme .sticky-finish-bar .btn-view-cart:hover { background: rgba(200, 60, 40, .08) !important; }
body.lst-theme .sticky-finish-bar .btn-view-cart .fa-shopping-cart {
    font-size: 1.9rem;
    color: #5a5a58;
    transition: color .2s;
}
body.lst-theme .sticky-finish-bar.has-items .btn-view-cart .fa-shopping-cart {
    color: #C83C28;
    animation: lstCartWiggle 2.4s ease-in-out infinite;
}
body.lst-theme .sticky-finish-bar .btn-view-cart .cart-cta-label {
    display: block;
    margin: 0;
    font-size: .95rem;
    font-weight: 500;
    letter-spacing: .08em;
    color: #333332;
    white-space: nowrap;
}
/* 右上角紅色圓圈數字 */
body.lst-theme.page-productselection .sticky-finish-bar .btn-view-cart .cart-badge {
    position: absolute !important;
    top: -2px !important;
    left: auto !important;
    right: 2px !important;
    min-width: 26px;
    height: 26px !important;
    width: auto !important;
    padding: 0 6px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: .95rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    color: #C83C28 !important;
    background: #ffffff !important;
    border: 2px solid #C83C28 !important;
    border-radius: 50% !important;
    animation: lstBadgePulse 1.8s ease-in-out infinite;
}
body.lst-theme.page-productselection .sticky-finish-bar .btn-view-cart .cart-badge.d-none { display: none !important; }
@keyframes lstBadgePulse {
    0%   { box-shadow: 0 0 0 0 rgba(200, 60, 40, .5); }
    70%  { box-shadow: 0 0 0 9px rgba(200, 60, 40, 0); }
    100% { box-shadow: 0 0 0 0 rgba(200, 60, 40, 0); }
}
@keyframes lstCartWiggle {
    0%, 70%, 100% { transform: rotate(0); }
    78% { transform: rotate(-12deg); }
    86% { transform: rotate(10deg); }
    94% { transform: rotate(-6deg); }
}
@media (max-width: 767.98px) {
    body.lst-theme .sticky-finish-bar .btn-view-cart,
    body.lst-theme .sticky-finish-bar.has-items .btn-view-cart { min-width: 56px !important; padding: 4px 8px 0 !important; }
    body.lst-theme .sticky-finish-bar .btn-view-cart .fa-shopping-cart { font-size: 1.6rem; }
    body.lst-theme .sticky-finish-bar .btn-view-cart .cart-cta-label { font-size: .8rem; }
    body.lst-theme.page-productselection .sticky-finish-bar .btn-view-cart .cart-badge { min-width: 22px; height: 22px !important; font-size: .8rem !important; }
}
@media (prefers-reduced-motion: reduce) {
    body.lst-theme .sticky-finish-bar .btn-view-cart .fa-shopping-cart,
    body.lst-theme.page-productselection .sticky-finish-bar .btn-view-cart .cart-badge { animation: none; }
}
/* ===== 購物車 BAR 整體縮小 10%（文字 / 圖示 / 數字圈），並預留空間避免「購物車」被版權列蓋住 ===== */
body.lst-theme.page-productselection .sticky-finish-bar { padding-bottom: 42px !important; }
body.lst-theme.page-productselection .sticky-finish-bar .btn-view-cart { font-size: 2.142rem !important; }
body.lst-theme.page-productselection .sticky-finish-bar .btn-view-cart .cart-cta-label { font-size: .855rem !important; }
body.lst-theme.page-productselection .sticky-finish-bar .btn-view-cart .cart-badge { min-width: 23px; height: 23px !important; font-size: .855rem !important; }
body.lst-theme.page-productselection .sticky-finish-bar .summary-text { font-size: 1.044rem !important; }
body.lst-theme.page-productselection .sticky-finish-bar .summary-text .text-danger { font-size: 1.602rem !important; }
@media (max-width: 767.98px) {
    body.lst-theme.page-productselection .sticky-finish-bar { padding-bottom: 38px !important; }
    body.lst-theme.page-productselection .sticky-finish-bar .btn-view-cart { font-size: 2.412rem !important; }
    body.lst-theme.page-productselection .sticky-finish-bar .btn-view-cart .cart-cta-label { font-size: .72rem !important; }
    body.lst-theme.page-productselection .sticky-finish-bar .btn-view-cart .cart-badge { min-width: 20px; height: 20px !important; font-size: .72rem !important; }
    body.lst-theme.page-productselection .sticky-finish-bar .summary-text { font-size: .918rem !important; }
    body.lst-theme.page-productselection .sticky-finish-bar .summary-text .text-danger { font-size: 1.332rem !important; }
}
/* ===== 購物車按鈕：移除紅圈數字；「購物車」文字右移 1px、字級再縮小 1px ===== */
body.lst-theme .sticky-finish-bar .btn-view-cart .cart-badge,
body.lst-theme.page-productselection .sticky-finish-bar .btn-view-cart .cart-badge { display: none !important; }
body.lst-theme.page-productselection .sticky-finish-bar .btn-view-cart .cart-cta-label {
    position: relative;
    left: 3px;
    font-size: 12.68px !important;
}
@media (max-width: 767.98px) {
    body.lst-theme.page-productselection .sticky-finish-bar .btn-view-cart .cart-cta-label { font-size: 10.52px !important; }
}
/* ===== 購物車側欄：數量達上限(+ 按鈕被 disabled)時隱藏 + 號，保留位置避免數字跳動 ===== */
body.lst-theme #cartOffcanvas .btn-cart-qty-adjust[data-action="plus"]:disabled {
    visibility: hidden !important;
}
/* ===== 購物車側欄：縮小卡片四周留白，讓卡片本身更大 ===== */
body.lst-theme #cartOffcanvas .flex-grow-1.overflow-auto { padding: 6px !important; }
body.lst-theme #cartOffcanvas .flex-grow-1.overflow-auto > .card { margin-bottom: 6px !important; }
body.lst-theme #cartOffcanvas .flex-grow-1.overflow-auto > .card > .row { padding: 4px !important; }