/**
 * Frontend styles for WooCommerce Subtotal Tiered Discount
 */

.site-header-cart .cart-contents {
    transition: all 0.3s ease;
}

.site-header-cart .cart-contents {
    transition: all 0.3s ease;
}

.site-header-cart .cart-contents:hover {
    opacity: 0.8;
}

/* 購物車與結帳頁面折扣明細：淡綠色背景與深綠色字體 */
.cart-totals tr.quantity-discount-row,
.shop_table tr.quantity-discount-row {
    background-color: #e2f0d9 !important;
}

.cart-totals tr.quantity-discount-row th,
.cart-totals tr.quantity-discount-row td,
.shop_table tr.quantity-discount-row th,
.shop_table tr.quantity-discount-row td {
    background-color: #e2f0d9 !important;
    color: #385723 !important;
    font-weight: bold !important;
    border: none !important;
    vertical-align: middle !important;
}

/* th 前方用純 CSS 繪製圓圈問號 (?) 圖標 - 已改由 JS 動態生成真實 DOM 故隱藏偽元素 */
.cart-totals tr.quantity-discount-row th::before,
.shop_table tr.quantity-discount-row th::before {
    display: none !important;
}

/* 折後小計獨立行樣式 */
.subtotal-after-discount-row th,
.subtotal-after-discount-row td {
    font-size: 1.1em;
    font-weight: bold !important;
}

/* Mini-Cart 下拉選單頂部資訊排版 */
.wc-std-mini-cart-info {
    padding: 12px 15px;
    border-bottom: 1px solid #eeeeee;
    font-size: 14px;
    color: #43454b;
    background-color: #fcfcfc;
}

.wc-std-mini-cart-count {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 15px;
}

.wc-std-mini-cart-subtotal {
    display: flex;
    align-items: center;
    margin-top: 3px;
}

.wc-std-help-icon {
    display: inline-block;
    border: 1.5px solid #43454b;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    line-height: 12px;
    text-align: center;
    font-size: 10px;
    margin-right: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.wc-std-help-icon:hover {
    background-color: #43454b;
    color: #ffffff;
}

/* 折扣費率行內的問號 icon */
tr.quantity-discount-row th .wc-std-help-icon {
    border-color: #385723;
    color: #385723;
}

tr.quantity-discount-row th .wc-std-help-icon:hover {
    background-color: #385723;
    color: #ffffff;
}

.wc-std-subtotal-label {
    margin-right: 5px;
}

.wc-std-subtotal-value {
    font-weight: bold;
    color: #131315;
}

/* 精美懸浮提示框 (Tooltip) */
.wc-std-tooltip {
    position: absolute;
    background-color: #1e1e1e;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.6;
    z-index: 999999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 提示框箭頭 */
.wc-std-tooltip::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #1e1e1e transparent;
}

/* 啟用狀態的 Tooltip */
.wc-std-tooltip.is-active {
    opacity: 1;
    transform: translateY(0);
}