/* ============================================================
   TB Stationery Enquiry — 前端样式
   匹配 tbstationery.com 设计系统 (Astra 主题 + WooCommerce)
   全局色变量:
     #5c9735  主绿色 (按钮/强调)
     #4d4f48  暗灰 (按钮 hover)
     #141a0f  深近黑绿 (标题)
     #f4f6f3  极浅绿 (柔和底色)
     #768471  灰绿 (辅助文字)
     #eaeaea  边框色
   字体:
     标题  Unna (serif)
     正文  DM Sans (sans-serif)
   按钮: 直角 (border-radius:0)  bg:#5c9735  hover bg:#4d4f48
   ============================================================ */

/* ---------- 弹窗遮罩 ---------- */
.tb-enq-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 26, 15, .6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: tbEnqFade .25s ease;
}

@keyframes tbEnqFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- 弹窗主体 ---------- */
.tb-enq-modal {
    background: #ffffff;
    border-radius: 0;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 12px 48px rgba(20, 26, 15, .2);
    animation: tbEnqRise .3s ease;
    border-top: 4px solid #5c9735;
}

@keyframes tbEnqRise {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ---------- 关闭按钮 ---------- */
.tb-enq-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #768471;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
    transition: color .2s;
}

.tb-enq-close:hover {
    color: #5c9735;
}

/* ---------- 弹窗头部 ---------- */
.tb-enq-modal-header {
    padding: 28px 28px 14px;
    border-bottom: 1px solid #eaeaea;
}

.tb-enq-modal-header h3 {
    font-family: "Unna", serif;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #141a0f;
    line-height: 1.3;
}

.tb-enq-modal-sub {
    font-size: 14px;
    color: #768471;
    margin: 0;
}

/* ---------- 弹窗主体内容区 ---------- */
.tb-enq-modal-body {
    padding: 22px 28px 28px;
}

/* ---------- 产品信息条 ---------- */
.tb-enq-product-info {
    background: #f4f6f3;
    border-left: 3px solid #5c9735;
    border-radius: 0;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #4d4f48;
}

.tb-enq-product-info strong {
    color: #141a0f;
    font-weight: 600;
}

/* ---------- 表单字段 ---------- */
.tb-enq-field {
    margin-bottom: 16px;
}

.tb-enq-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #4d4f48;
    margin-bottom: 6px;
    font-family: "DM Sans", sans-serif;
}

.tb-enq-field label span {
    color: #5c9735;
}

.tb-enq-field input,
.tb-enq-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #eaeaea;
    border-radius: 0;
    font-size: 14px;
    font-family: "DM Sans", sans-serif;
    color: #141a0f;
    background: #ffffff;
    transition: border-color .2s, box-shadow .2s;
}

.tb-enq-field input::placeholder,
.tb-enq-field textarea::placeholder {
    color: #768471;
    opacity: .7;
}

.tb-enq-field input:focus,
.tb-enq-field textarea:focus {
    outline: none;
    border-color: #5c9735;
    box-shadow: 0 0 0 2px rgba(92, 151, 53, .1);
}

.tb-enq-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* ---------- 提交按钮 ---------- */
.tb-enq-submit-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 0;
    background: #5c9735;
    color: #ffffff;
    font-family: "DM Sans", sans-serif;
    font-size: 15px;
    font-weight: 500;
    text-transform: capitalize;
    cursor: pointer;
    transition: background-color .2s;
    margin-top: 6px;
}

.tb-enq-submit-btn:hover {
    background: #4d4f48;
}

.tb-enq-submit-btn:active {
    background: #4d4f48;
}

.tb-enq-submit-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
}

/* ---------- 成功提示 ---------- */
.tb-enq-success {
    text-align: center;
    padding: 36px 20px;
}

.tb-enq-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #5c9735;
    color: #ffffff;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    animation: tbEnqPop .4s ease;
}

@keyframes tbEnqPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.tb-enq-success h4 {
    font-family: "Unna", serif;
    font-size: 20px;
    font-weight: 700;
    color: #141a0f;
    margin: 0 0 18px;
}

.tb-enq-done-btn {
    padding: 10px 28px;
    border: 1px solid #eaeaea;
    border-radius: 0;
    background: #ffffff;
    color: #4d4f48;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}

.tb-enq-done-btn:hover {
    border-color: #5c9735;
    color: #5c9735;
}

/* ---------- 单品页询盘按钮 ---------- */
.tb-enq-product-action {
    margin: 16px 0 0;
}

.tb-enq-single-btn {
    display: inline-block;
    padding: 15px 40px;
    border: none;
    border-radius: 0;
    background: #5c9735;
    color: #ffffff;
    font-family: "DM Sans", sans-serif;
    font-size: 15px;
    font-weight: 500;
    text-transform: capitalize;
    cursor: pointer;
    transition: background-color .2s;
    line-height: 1em;
}

.tb-enq-single-btn:hover {
    background: #4d4f48;
    color: #ffffff;
    text-decoration: none;
}

.tb-enq-single-btn:active {
    background: #4d4f48;
}

.tb-enq-hint {
    font-size: 13px;
    color: #768471;
    margin: 12px 0 0;
}

/* ---------- 列表页询盘按钮 ---------- */
.tb-enq-btn-loop {
    display: block !important;
    width: 100% !important;
    min-height: 50px !important;
    box-sizing: border-box !important;
    padding: 15px 24px !important;
    border-radius: 0 !important;
    background: #5c9735 !important;
    color: #ffffff !important;
    font-family: "DM Sans", sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    text-transform: capitalize !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color .2s !important;
    border: none !important;
    line-height: 1.2 !important;
    text-align: center !important;
}

.tb-enq-btn-loop:hover {
    background: #4d4f48 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* 双模式商品列表：将主题的购物袋入口改为询盘按钮下方的购买按钮。 */
.products li.product .tb-enq-purchase-loop,
.wc-block-grid__product .tb-enq-purchase-loop {
    position: static !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 50px !important;
    box-sizing: border-box !important;
    margin: 10px 0 0 !important;
    padding: 15px 24px !important;
    border-radius: 0 !important;
    background: #4d4f48 !important;
    color: #ffffff !important;
    font-family: "DM Sans", sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    text-indent: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
}

.products li.product .tb-enq-purchase-loop:hover,
.wc-block-grid__product .tb-enq-purchase-loop:hover {
    background: #5c9735 !important;
    color: #ffffff !important;
}

.tb-enq-purchase-loop::before,
.tb-enq-purchase-loop::after,
.tb-enq-purchase-loop .ast-icon,
.tb-enq-purchase-loop svg {
    display: none !important;
    content: none !important;
}

/* Ensure enquiry buttons remain visible with Astra card hover effects. */
.tb-enq-btn-loop {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* ---------- 隐藏第三方询盘插件的重复入口 ---------- */
/* Get a Quote / Product Enquiry 等插件输出的灰色 ENQUIRY! 按钮 */
.gmwqp_inq,
.gmwqp_inq.button,
a.gmwqp_inq {
    display: none !important;
    visibility: hidden !important;
}

/* ---------- 响应式 ---------- */
@media (max-width: 544px) {
    .tb-enq-modal-header,
    .tb-enq-modal-body {
        padding-left: 20px;
        padding-right: 20px;
    }

    .tb-enq-modal-header h3 {
        font-size: 20px;
    }

    .tb-enq-single-btn {
        width: 100%;
        text-align: center;
    }
}
/* Remove the theme's legacy “+ Free Shipping” generated after product prices.
   This affects only the visual label; WooCommerce shipping rates are unchanged. */
.woocommerce div.product p.price::after,
.woocommerce div.product span.price::after,
.woocommerce ul.products li.product .price::after,
.woocommerce-page div.product p.price::after,
.woocommerce-page div.product span.price::after,
.woocommerce-page ul.products li.product .price::after,
.wc-block-grid__product-price::after,
.product-price::after {
    content: none !important;
    display: none !important;
}

.tb-hide-generated-free-shipping::before,
.tb-hide-generated-free-shipping::after {
    content: none !important;
    display: none !important;
}
