/*
 Theme Name:   CongPa Shop Child
 Theme URI:    https://www.commercegurus.com/
 Description:  CongPa Shop 子主题 - 国内搜索引擎 SEO 优化，含订单页商品缩略图增强
 Author:       cong
 Version:      1.1.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Template:     congpashop
 Text Domain:  shoptimizer-child
*/

/* ==========================================================================
   顶部 WooCommerce 产品搜索框宽度
   父主题 header-desktop 在 993–1060px 将 .site-search 设为 100px；header-5 在部分宽度为 50px。
   搜索区勿设过大 flex-basis / min-width，否则会挤压同一 flex 行内的 .sh-user-area（葱派用户区）。
   ========================================================================== */
@media (min-width: 993px) {
    /* 右侧：用户区 + 购物车固定占位，不被搜索框 flex 挤偏 */
    .site-header .col-full .sh-user-area,
    .site-header .col-full .site-header-cart,
    .site-header .col-full .shoptimizer-cart {
        flex: 0 0 auto;
    }

    /* 电脑端：用户区紧贴购物车一侧，整体靠右（左侧留白由 margin-left:auto 吃进） */
    .site-header .main-header.col-full .sh-user-area {
        margin-left: auto;
    }

    body:not(.header-4):not(.header-5) .site-header .site-search {
        width: auto !important;
        min-width: 0;
        max-width: 440px;
        flex: 1 1 auto;
    }

    .site-header .site-search form.woocommerce-product-search {
        width: 100%;
        max-width: 100%;
    }

    .site-header .site-search input[type="search"].search-field,
    .site-header .site-search .woocommerce-product-search .search-field {
        width: 100%;
        max-width: none;
        min-width: 200px;
    }

    /* Header 2/3：在居中布局下保持与父主题 25% 上限协调 */
    .header-2 .site-header .site-search,
    .header-3 .site-header .site-search {
        max-width: min(25%, 440px);
        min-width: 0;
    }

    .header-2 .site-header .site-search .search-field,
    .header-3 .site-header .site-search .search-field {
        min-width: 160px;
    }
}

@media (min-width: 993px) and (max-width: 1155px) {
    .header-5 .site-header .site-search {
        width: auto !important;
        min-width: 200px;
        max-width: 380px;
    }
}

/* ==========================================================================
   我的订单页 - 信息行 + 商品明细行 + 查看按钮
   ========================================================================== */

/* --- 表格整体 --- */
.cg-orders-table {
    border-collapse: collapse !important;
    width: 100%;
}

.cg-orders-table thead th.cg-orders-th {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
    background: transparent;
    white-space: nowrap;
}

.cg-orders-table thead th.cg-orders-th--total,
.cg-orders-table .cg-orders-td-total {
    text-align: right;
}

/* --- 订单信息行 --- */
.cg-orders-table .woocommerce-orders-table__row.order > td {
    padding: 14px 16px;
    border-bottom: none;
    vertical-align: middle;
    font-size: 14px;
}

.cg-orders-table .woocommerce-orders-table__cell-order-number a {
    font-weight: 600;
    color: #7c3aed;
    text-decoration: none;
}

.cg-orders-table .woocommerce-orders-table__cell-order-number a:hover {
    text-decoration: underline;
}

/* 状态标签 */
.cg-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.cg-status--completed { background: #ecfdf5; color: #059669; }
.cg-status--processing { background: #eff6ff; color: #2563eb; }
.cg-status--on-hold { background: #fff7ed; color: #d97706; }
.cg-status--pending { background: #fefce8; color: #ca8a04; }
.cg-status--cancelled,
.cg-status--refunded,
.cg-status--failed { background: #fef2f2; color: #dc2626; }

/* --- 商品明细行 --- */
.cg-orders-table .woocommerce-orders-table__row-items {
    border-bottom: 1px solid #e5e5e5 !important;
}

.cg-orders-table .woocommerce-orders-table__row-items > td {
    padding: 0;
    vertical-align: top;
}

.cg-items-cell {
    padding: 0 0 0 16px !important;
}

/* --- 嵌套商品表格 --- */
.cg-items-table {
    width: 100%;
    border-collapse: collapse;
}

.cg-items-table tr {
    border-top: 1px solid #f0f0f0;
}

.cg-items-table tr:first-child {
    border-top: none;
}

.cg-items-table td {
    padding: 12px 10px;
    vertical-align: middle;
}

/* 缩略图 */
.cg-item-td-img {
    width: 100px;
    padding-left: 0 !important;
}

.cg-item-td-img a {
    display: block;
}

.cg-item-td-img img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
    display: block;
}

/* 商品标题 */
.cg-item-td-title {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.cg-item-td-title a {
    color: #7c3aed;
    text-decoration: none;
}

.cg-item-td-title a:hover {
    text-decoration: underline;
}

.cg-item-meta {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.cg-item-meta-block {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    line-height: 1.45;
}

.cg-item-meta-block .cg-item-meta,
.cg-item-meta-block .cg-flip-order-ref--inline {
    display: inline;
    font-size: inherit;
}

/* 订单详情 / 邮件：返单号（随商品行，见 inc/congpa-order-flip-number.php） */
.cg-flip-order-ref {
    display: block;
    font-size: 12px;
    color: #7c3aed;
    margin-top: 6px;
    line-height: 1.4;
}
.cg-flip-order-ref__label {
    font-weight: 600;
    color: #555;
}
.cg-flip-order-ref a.cg-flip-order-ref__link {
    color: #7c3aed;
    text-decoration: none;
}
.cg-flip-order-ref a.cg-flip-order-ref__link:hover {
    text-decoration: underline;
}

.cg-flip-order-ref--inline {
    display: inline;
    margin-top: 0;
}

/* 数量 */
.cg-item-td-qty {
    white-space: nowrap;
    font-size: 14px;
    color: #555;
    text-align: center;
    width: 80px;
}

/* 小计 */
.cg-item-td-total {
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-align: right;
    width: 100px;
}

/* --- 操作列（查看按钮） --- */
.cg-action-cell {
    vertical-align: middle !important;
    text-align: center;
    padding: 12px 16px !important;
    width: 120px;
}

.cg-order-subactions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 10px;
}

.cg-order-subactions--list {
    justify-content: center;
}

.woocommerce-order-details .cg-order-actions-cell {
    text-align: right;
    vertical-align: middle;
}

.woocommerce-order-details .cg-order-subactions--detail {
    margin-top: 0;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}

.cg-subaction-link {
    font-size: 13px;
    line-height: 1.4;
    color: #374151;
    text-decoration: none;
}

.cg-subaction-link:hover {
    text-decoration: underline;
    color: #111827;
}

.cg-order-subactions--list .cg-subaction-link--danger,
.cg-subaction-link.cg-order-delete {
    color: #b91c1c;
}

.cg-order-subactions--list .cg-subaction-link--danger:hover,
.cg-subaction-link.cg-order-delete:hover {
    color: #991b1b;
}

.woocommerce-order-details .cg-order-subactions--detail .cg-subaction-link.cg-order-delete {
    color: #b91c1c;
}

.woocommerce-order-details .cg-order-subactions--detail .cg-subaction-link.cg-order-delete:hover {
    color: #991b1b;
}

.woocommerce-order-details .cg-order-subactions--detail .cg-subaction-link--danger {
    color: #b91c1c;
}

.woocommerce-order-details .cg-order-subactions--detail .cg-subaction-link--danger:hover {
    color: #991b1b;
}

/* 覆盖 WCOM 插件把删除链成「红按钮」的样式，列表/详情仅保留红色文字 */
a.cg-subaction-link.wcom-btn-delete {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #b91c1c !important;
    margin-left: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

a.cg-subaction-link.wcom-btn-delete:hover {
    background: transparent !important;
    color: #991b1b !important;
}

.cg-o-link-danger {
    display: inline-block;
    font-size: 12px;
    line-height: 1.3;
    color: #b91c1c;
    text-decoration: none;
    padding: 6px 2px;
    background: transparent !important;
    border: none !important;
}

.cg-o-link-danger:hover {
    text-decoration: underline;
    color: #991b1b;
}

.cg-o-link-danger.wcom-btn-delete {
    color: #b91c1c !important;
}

.cg-view-btn {
    display: inline-block;
    padding: 8px 24px;
    background: #7c3aed;
    color: #fff !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.2s;
}

.cg-view-btn:hover {
    background: #6d28d9;
}

/* 订单列表分页（页码 + 上一页/下一页），覆盖父主题 Pagination 的 flex 两端对齐 */
.woocommerce-account .woocommerce-MyAccount-content nav.cg-orders-pagination.woocommerce-pagination {
    float: none;
    display: block;
    width: 100%;
    margin-top: 1.25rem;
    text-align: center;
    clear: both;
}

.woocommerce-account .woocommerce-MyAccount-content nav.cg-orders-pagination ul.page-numbers {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-account .woocommerce-MyAccount-content nav.cg-orders-pagination ul.page-numbers li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.woocommerce-account .woocommerce-MyAccount-content nav.cg-orders-pagination .page-numbers {
    display: inline-block;
    padding: 0.55em 0.75em;
    min-width: 2.25em;
    box-sizing: border-box;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    color: #111;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
}

.woocommerce-account .woocommerce-MyAccount-content nav.cg-orders-pagination a.page-numbers:hover {
    border-color: #ccc;
}

.woocommerce-account .woocommerce-MyAccount-content nav.cg-orders-pagination span.page-numbers.current {
    color: #fff;
    background: #7c3aed;
    border-color: #7c3aed;
}

.woocommerce-account .woocommerce-MyAccount-content nav.cg-orders-pagination span.page-numbers.dots {
    min-width: auto;
    padding-left: 0.35em;
    padding-right: 0.35em;
    border: none;
    background: transparent;
    color: #666;
}

/* ==========================================================================
   订单列表 - 平板/移动端
   父主题在 max-width:992px 会强制 My Account 内 table 为 block + td:before(data-label)，
   与 data-title 及本表双行布局冲突；此处用 992px 覆盖并关闭伪元素标签。
   ========================================================================== */

@media (max-width: 992px) {
    .woocommerce-account .woocommerce-MyAccount-content table.cg-orders-table td:before,
    .woocommerce-account .woocommerce-MyAccount-content table.cg-orders-table th:before {
        content: none !important;
        display: none !important;
    }

    .cg-orders-table thead {
        display: none;
    }

    .cg-orders-table,
    .cg-orders-table tbody {
        display: block;
        width: 100%;
    }

    .cg-orders-table tr {
        display: block;
    }

    .cg-orders-table .woocommerce-orders-table__row.order {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 14px;
        padding: 14px 16px 8px;
        align-items: center;
    }

    .cg-orders-table .woocommerce-orders-table__row.order > td {
        padding: 0;
        border: none;
        display: inline;
    }

    .cg-orders-table .woocommerce-orders-table__cell-order-total {
        margin-left: auto;
        font-weight: 600;
    }

    .cg-orders-table .woocommerce-orders-table__row.order > td:last-child {
        display: none;
    }

    .cg-orders-table .woocommerce-orders-table__row-items {
        display: block;
    }

    .cg-orders-table .woocommerce-orders-table__row-items > td {
        display: block;
    }

    .cg-items-cell {
        padding: 0 12px !important;
    }

    .cg-items-table td {
        padding: 10px 6px;
    }

    .cg-item-td-img {
        width: 72px;
    }

    .cg-item-td-img img {
        width: 72px;
        height: 72px;
        border-radius: 6px;
    }

    .cg-item-td-title {
        font-size: 13px;
    }

    .cg-item-td-qty,
    .cg-item-td-total {
        font-size: 13px;
        width: auto;
    }

    .cg-action-cell {
        display: block;
        text-align: right;
        padding: 8px 16px 16px !important;
    }

    .cg-view-btn {
        display: block;
        text-align: center;
        padding: 10px 0;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .cg-items-table tr {
        display: grid;
        grid-template-columns: 60px 1fr auto;
        gap: 0 10px;
        padding: 10px 0;
        align-items: center;
    }

    .cg-item-td-img {
        grid-row: 1 / 3;
        width: 60px;
        padding: 0 !important;
    }

    .cg-item-td-img img {
        width: 60px;
        height: 60px;
    }

    .cg-item-td-title {
        grid-column: 2 / 4;
        padding: 0 !important;
    }

    .cg-item-td-qty {
        grid-column: 2;
        text-align: left;
        padding: 4px 0 0 !important;
        font-size: 12px;
        color: #888;
    }

    .cg-item-td-total {
        grid-column: 3;
        padding: 4px 0 0 !important;
        font-size: 12px;
    }
}

/* ==========================================================================
   国内SEO相关样式
   ========================================================================== */

.seo-breadcrumb-wrapper {
    font-size: 13px;
    color: #666;
    padding: 8px 0;
}

.seo-breadcrumb-wrapper a {
    color: #555;
    text-decoration: none;
}

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

.seo-breadcrumb-wrapper .separator {
    margin: 0 6px;
    color: #ccc;
}

/* ==========================================================================
   WPCOM Member + WooCommerce 集成样式
   ========================================================================== */

/* --- 登录/注册 Tab 切换 --- */
.wpmx-wc-auth-wrapper {
    max-width: 480px;
    margin: 0 auto;
    padding: 0;
}

.wpmx-wc-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 24px;
}

.wpmx-wc-tab {
    flex: 1;
    padding: 12px 0;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: #999;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
    outline: none;
}

.wpmx-wc-tab:hover {
    color: #555;
}

.wpmx-wc-tab.active {
    color: #333;
}

.wpmx-wc-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: #333;
    border-radius: 1px;
}

/* --- 登录/注册面板 --- */
.wpmx-wc-panel {
    display: none;
}

.wpmx-wc-panel.active {
    display: block;
}

/* 适配 WPCOM Member 表单在 WooCommerce 环境中的样式 */
.wpmx-wc-form-inner .member-form {
    max-width: 100%;
    margin: 0;
}

.wpmx-wc-form-inner .member-form .form-group {
    margin-bottom: 16px;
}

.wpmx-wc-form-inner .member-form .form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.wpmx-wc-form-inner .member-form .form-input:focus {
    border-color: #333;
    outline: none;
}

.wpmx-wc-form-inner .member-form .wpcom-btn {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
}

/* --- 社交登录分割线 --- */
.wpmx-wc-social-section {
    margin-top: 28px;
    padding-top: 0;
}

.wpmx-wc-divider {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
}

.wpmx-wc-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #eee;
}

.wpmx-wc-divider span {
    position: relative;
    display: inline-block;
    padding: 0 16px;
    background: #fff;
    color: #999;
    font-size: 13px;
}

/* --- 社交登录按钮列表 --- */
.wpmx-wc-social-buttons .member-social-list {
    display: flex;
    justify-content: center;
    gap: 16px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.wpmx-wc-social-buttons .social-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #666;
    transition: all 0.25s;
    text-decoration: none;
}

.wpmx-wc-social-buttons .social-item a:hover {
    background: #e8e8e8;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.wpmx-wc-social-buttons .social-item a svg,
.wpmx-wc-social-buttons .social-item a .wpcom-icon {
    width: 22px;
    height: 22px;
}

/* 社交平台品牌色悬浮效果 */
.wpmx-wc-social-buttons .social-wechat a:hover { background: #07c160; color: #fff; }
.wpmx-wc-social-buttons .social-wechat2 a:hover { background: #07c160; color: #fff; }
.wpmx-wc-social-buttons .social-qq a:hover { background: #12b7f5; color: #fff; }
.wpmx-wc-social-buttons .social-weibo a:hover { background: #e6162d; color: #fff; }
.wpmx-wc-social-buttons .social-github a:hover { background: #24292f; color: #fff; }
.wpmx-wc-social-buttons .social-google a:hover { background: #4285f4; color: #fff; }
.wpmx-wc-social-buttons .social-facebook a:hover { background: #1877f2; color: #fff; }
.wpmx-wc-social-buttons .social-twitter a:hover { background: #000; color: #fff; }

/* ==========================================================================
   WooCommerce 我的账户 - 社交绑定管理页
   ========================================================================== */

.wpmx-social-bindintg {
    max-width: 600px;
}

.wpmx-bindintg-desc {
    color: #777;
    font-size: 14px;
    margin-bottom: 20px;
}

.wpmx-bindintg-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wpmx-bindintg-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.wpmx-bindintg-item:last-child {
    border-bottom: none;
}

.wpmx-bindintg-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 18px;
}

.wpmx-bindintg-icon svg,
.wpmx-bindintg-icon .wpcom-icon {
    width: 20px;
    height: 20px;
}

.wpmx-bindintg-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wpmx-bindintg-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.wpmx-bindintg-status {
    font-size: 13px;
}

.wpmx-bindintg-status.bound {
    color: #07c160;
}

.wpmx-bindintg-status.unbound {
    color: #bbb;
}

.wpmx-bindintg-action {
    flex-shrink: 0;
}

.wpmx-btn-bind {
    display: inline-block;
    padding: 6px 16px;
    font-size: 13px;
    color: #fff;
    background: #333;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}

.wpmx-btn-bind:hover {
    background: #555;
    color: #fff;
}

.wpmx-btn-unbind {
    display: inline-block;
    padding: 6px 16px;
    font-size: 13px;
    color: #666;
    background: #f5f5f5;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}

.wpmx-btn-unbind:hover {
    background: #e8e8e8;
    color: #333;
}

/* --- 手机号绑定区块 --- */
.wpmx-phone-bindintg {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.wpmx-phone-bindintg h3 {
    font-size: 15px;
    font-weight: 500;
    margin: 0 0 12px;
}

.wpmx-phone-icon {
    font-style: normal;
    font-size: 18px;
}

/* ==========================================================================
   WPCOM Member 集成 - 移动端
   ========================================================================== */

@media (max-width: 768px) {
    .wpmx-wc-auth-wrapper {
        max-width: 100%;
        padding: 0 4px;
    }

    .wpmx-wc-tab {
        font-size: 15px;
    }

    .wpmx-wc-social-buttons .social-item a {
        width: 42px;
        height: 42px;
    }

    .wpmx-bindintg-item {
        gap: 10px;
        padding: 12px 0;
    }

    .wpmx-bindintg-icon {
        width: 36px;
        height: 36px;
    }
}

/* ==========================================================================
   五、配送地址簿（多地址管理）
   ========================================================================== */

/* --- 页面头部 --- */
.sa-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.sa-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.sa-btn-export {
    background: #fff;
    color: #444;
    border: 1px solid #ddd;
}

.sa-btn-export:hover:not(:disabled) {
    border-color: #333;
    color: #111;
}

.sa-btn-export:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sa-card-country {
    font-size: 12px;
    color: #888;
}

.sa-desc {
    color: #777;
    font-size: 14px;
    margin: 0 0 4px;
}

.sa-count {
    font-size: 13px;
    color: #999;
    margin: 0;
}

/* --- 按钮通用 --- */
.sa-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.sa-btn-primary {
    background: #333;
    color: #fff;
    border-color: #333;
}

.sa-btn-primary:hover {
    background: #555;
    border-color: #555;
}

.sa-btn-primary:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

.sa-btn-cancel {
    background: #f5f5f5;
    color: #666;
    border-color: #ddd;
}

.sa-btn-cancel:hover {
    background: #eee;
}

/* --- 空状态 --- */
.sa-empty {
    text-align: center;
    padding: 48px 16px;
    color: #999;
    font-size: 14px;
    background: #fafafa;
    border-radius: 12px;
    border: 1px dashed #ddd;
}

.sa-empty p {
    margin: 4px 0;
}

/* --- 地址卡片列表 --- */
.sa-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* --- 单个地址卡片 --- */
.sa-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 0;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.sa-card:hover {
    border-color: #ddd;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.sa-card.is-default {
    border-color: #333;
    border-width: 2px;
}

/* 卡片顶部：标签 + 操作 */
.sa-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 0;
    gap: 8px;
}

.sa-card-label-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sa-card-label {
    display: inline-block;
    padding: 3px 10px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
}

.sa-card.is-default .sa-card-label {
    background: #333;
    color: #fff;
}

.sa-card-badge {
    font-size: 11px;
    color: #fff;
    background: #07c160;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

/* 操作按钮 */
.sa-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.sa-card:hover .sa-card-actions {
    opacity: 1;
}

.sa-action-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}

.sa-action-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.sa-action-danger:hover {
    background: #fff1f0;
    color: #e24b4a;
}

/* 卡片内容 */
.sa-card-body {
    padding: 12px 16px 16px;
}

.sa-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin-bottom: 6px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.sa-card-phone {
    font-weight: 400;
    font-size: 13px;
    color: #888;
}

.sa-card-addr {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 4px;
}

.sa-card-extra {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
}

/* ==========================================================================
   弹窗 / 表单
   ========================================================================== */

.sa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.sa-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.sa-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
}

.sa-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.sa-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.sa-modal-close:hover {
    color: #333;
}

/* --- 表单 --- */
.sa-form {
    padding: 20px 24px 24px;
}

.sa-form-row {
    margin-bottom: 16px;
}

.sa-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sa-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin-bottom: 6px;
}

.sa-required {
    color: #e24b4a;
}

.sa-optional {
    font-weight: 400;
    color: #bbb;
    font-size: 12px;
}

.sa-field input,
.sa-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: #fff;
}

.sa-field input:focus,
.sa-field select:focus {
    border-color: #333;
    outline: none;
}

/* 标签快捷选择 */
.sa-label-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.sa-tag {
    padding: 5px 12px;
    border: 1px solid #eee;
    border-radius: 20px;
    font-size: 13px;
    background: #fafafa;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
}

.sa-tag:hover {
    border-color: #ccc;
    background: #f0f0f0;
}

.sa-tag.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* 粘贴整段地址智能识别 */
.sa-paste-box {
    margin-bottom: 8px;
}

.sa-paste-textarea {
    width: 100%;
    min-height: 72px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

.sa-paste-textarea:focus {
    border-color: #333;
    outline: none;
}

.sa-paste-actions {
    margin-top: 8px;
}

.sa-btn-paste {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sa-btn-paste:hover {
    background: #333;
    color: #fff;
}

/* 表单底部操作 */
.sa-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* 结账内嵌：粘贴识别 */
.sa-co-paste-box {
    margin-bottom: 4px;
}

.sa-co-paste-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin-bottom: 6px;
}

.sa-co-paste-textarea {
    width: 100%;
    min-height: 64px;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

.sa-co-paste-textarea:focus {
    border-color: #333;
    outline: none;
}

.sa-co-paste-actions {
    margin-top: 8px;
}

.sa-co-btn-paste {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #fff;
    color: #333;
    cursor: pointer;
}

.sa-co-btn-paste:hover {
    background: #333;
    color: #fff;
}

/* ==========================================================================
   结账页：地址选择器 + 内嵌添加表单（美化版）
   ========================================================================== */

/* --- 外层容器 --- */
.sa-co-wrapper {
    margin-bottom: 24px;
}

/* --- 选择器头部 --- */
.sa-co-picker {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 16px 18px;
}

.sa-co-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sa-co-head label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.sa-co-count {
    font-size: 12px;
    color: #aaa;
    background: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid #eee;
}

.sa-co-picker select {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.sa-co-picker select:focus {
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
    outline: none;
}

/* ==========================================================================
   内嵌添加地址表单
   ========================================================================== */

.sa-co-add {
    margin-top: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* --- 表单头 --- */
.sa-co-add-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.sa-co-add-head h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.sa-co-add-close {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.sa-co-add-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* --- 表单内容 --- */
.sa-co-add-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* --- 标签选择 --- */
.sa-co-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2px;
}

.sa-co-tag {
    padding: 7px 14px;
    border: 1px solid #e8e8e8;
    border-radius: 24px;
    font-size: 13px;
    background: #fafafa;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.sa-co-tag:hover {
    border-color: #bbb;
    background: #f0f0f0;
}

.sa-co-tag.active {
    background: #333;
    color: #fff;
    border-color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* --- 分隔线 --- */
.sa-co-sep {
    height: 1px;
    background: #f0f0f0;
    margin: 4px 0;
}

/* --- 字段 --- */
.sa-co-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sa-co-field label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.sa-co-req {
    color: #e24b4a;
}

.sa-co-opt {
    font-weight: 400;
    color: #bbb;
    font-size: 12px;
}

.sa-co-inp {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sa-co-inp:focus {
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
    outline: none;
}

.sa-co-inp::placeholder {
    color: #ccc;
}

/* 两列网格 */
.sa-co-g2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* --- 表单底部操作 --- */
.sa-co-add-foot {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.sa-co-btn-cancel,
.sa-co-btn-save {
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.2s;
}

.sa-co-btn-cancel {
    background: #fff;
    color: #666;
    border-color: #ddd;
}

.sa-co-btn-cancel:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.sa-co-btn-save {
    background: #333;
    color: #fff;
    border-color: #333;
}

.sa-co-btn-save:hover {
    background: #444;
}

.sa-co-btn-save:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

/* ==========================================================================
   结账页内嵌表单 - 移动端
   ========================================================================== */

@media (max-width: 768px) {
    .sa-co-picker {
        padding: 14px;
        border-radius: 10px;
    }

    .sa-co-head label {
        font-size: 14px;
    }

    .sa-co-add {
        border-radius: 12px;
        margin-top: 12px;
    }

    .sa-co-add-body {
        padding: 16px;
        gap: 12px;
    }

    .sa-co-g2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sa-co-tags {
        gap: 6px;
    }

    .sa-co-tag {
        padding: 6px 12px;
        font-size: 12px;
    }

    .sa-co-add-foot {
        flex-direction: column-reverse;
        padding: 14px 16px;
        gap: 10px;
    }

    .sa-co-btn-cancel,
    .sa-co-btn-save {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .sa-co-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .sa-co-add-head {
        padding: 14px 16px;
    }

    .sa-co-add-head h4 {
        font-size: 14px;
    }

    .sa-co-inp {
        padding: 9px 12px;
        font-size: 13px;
    }
}

/* ==========================================================================
   配送地址 - 移动端
   ========================================================================== */

@media (max-width: 768px) {
    .sa-header {
        flex-direction: column;
        gap: 12px;
    }

    .sa-btn {
        width: 100%;
        justify-content: center;
    }

    .sa-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sa-card-actions {
        opacity: 1;
    }

    .sa-modal {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
    }

    .sa-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .sa-row-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sa-form {
        padding: 16px 20px 20px;
    }

    .sa-form-actions {
        flex-direction: column-reverse;
    }

    .sa-form-actions .sa-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .sa-label-tags {
        gap: 6px;
    }

    .sa-tag {
        padding: 4px 10px;
        font-size: 12px;
    }
}

/* ==========================================================================
   六、页眉用户区 — 登录/注册 + 头像下拉
   ========================================================================== */

.sh-user-area {
    display: flex;
    align-items: center;
    position: relative;
    white-space: nowrap;
}

/* --- 未登录：登录 | 注册 --- */
.sh-user-guest {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 14px;
}

.sh-login-link,
.sh-register-link {
    padding: 6px 12px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.2s;
    border-radius: 6px;
}

.sh-login-link:hover,
.sh-register-link:hover {
    color: #7c3aed;
}

.sh-register-link {
    background: #333;
    color: #fff;
    margin-left: 4px;
    padding: 6px 16px;
}

.sh-register-link:hover {
    background: #555;
    color: #fff;
}

.sh-sep {
    color: #ddd;
    margin: 0 2px;
    font-weight: 300;
    user-select: none;
}

/* 未登录时二次导航触发按钮 */
.sh-guest-nav-wrap {
    position: relative;
    margin-left: 10px;
}

.sh-guest-nav-trigger {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #666;
    transition: all 0.15s;
}

.sh-guest-nav-trigger:hover {
    border-color: #bbb;
    color: #333;
}

.sh-guest-nav-wrap:hover .sh-guest-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- 已登录：头像 + 昵称 + 下拉 --- */
.sh-user-logged {
    position: relative;
}

.sh-user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 30px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
    cursor: pointer;
}

.sh-user-trigger:hover {
    background: #f5f5f5;
}

.sh-user-avatar {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    object-fit: cover;
    border: 2px solid #eee;
}

.sh-user-name {
    font-size: 14px;
    font-weight: 500;
    max-width: 12em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.sh-user-arrow {
    color: #999;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.sh-user-logged:hover .sh-user-arrow {
    transform: rotate(180deg);
}

/* --- 下拉面板（通用） --- */
.sh-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 200px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
    padding: 6px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s ease;
    z-index: 9999;
}

.sh-user-logged:hover .sh-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 二次导航菜单在下拉里 */
.sh-dropdown-nav {
    padding: 4px 0;
}

.sh-dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sh-dropdown-menu li {
    margin: 0;
}

.sh-dropdown-menu li a {
    display: block;
    padding: 9px 20px;
    font-size: 14px;
    color: #444;
    text-decoration: none;
    transition: all 0.12s;
}

.sh-dropdown-menu li a:hover {
    background: #f7f7f7;
    color: #222;
}

/* 额外链接项 */
.sh-dropdown-extra {
    border-top: 1px solid #f0f0f0;
    padding: 4px 0;
}

.sh-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    font-size: 14px;
    color: #444;
    text-decoration: none;
    transition: all 0.12s;
}

.sh-dropdown-item:hover {
    background: #f7f7f7;
    color: #222;
}

.sh-dropdown-item svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.sh-dropdown-item:hover svg {
    opacity: 0.8;
}

.sh-dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 4px 0;
}

.sh-item-logout {
    color: #999;
}

.sh-item-logout:hover {
    color: #e24b4a;
}

/* ==========================================================================
   页眉用户区 - 移动端
   ========================================================================== */

@media (max-width: 992px) {
    .sh-user-area {
        position: absolute;
        top: 0;
        right: 60px;
        height: 70px;
        display: flex;
        align-items: center;
        z-index: 3;
    }

    .sh-user-logged {
        position: static;
    }

    .sh-user-name {
        display: none;
    }

    .sh-user-arrow {
        display: none;
    }

    .sh-user-trigger {
        padding: 2px;
        border-radius: 50%;
    }

    .sh-user-avatar {
        width: 28px !important;
        height: 28px !important;
        border-width: 1px;
    }

    .sh-sep {
        display: none;
    }

    .sh-login-link {
        padding: 5px 8px;
        font-size: 13px;
    }

    .sh-register-link {
        padding: 5px 12px;
        font-size: 13px;
    }

    .sh-user-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        margin-top: 0;
        border-radius: 16px 16px 0 0;
        min-width: 100%;
        padding: 8px 0 16px;
        transform: translateY(100%);
        box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
    }

    .sh-user-logged:hover .sh-user-dropdown,
    .sh-guest-nav-wrap:hover .sh-guest-dropdown {
        transform: translateY(0);
    }

    .sh-dropdown-menu li a,
    .sh-dropdown-item {
        padding: 12px 24px;
        font-size: 15px;
    }

    .sh-guest-nav-trigger {
        padding: 4px 6px;
    }

    .sh-guest-nav-wrap {
        position: static;
    }

    /* 有我的账户图标时，让位 */
    .shoptimizer-myaccount + .sh-user-area,
    .sh-user-area + .shoptimizer-myaccount {
        display: none;
    }
}

/* ==========================================================================
   插件兼容加强：Cong WC Dynamic Options + Cong WC Custom Order Manager
   + Cong Woo Advanced Reviews（与 Shoptimizer / CongPa Shop 商品页、选项卡）
   ========================================================================== */

/* —— 商品页：动态选项区块与定制上传区块的衔接 —— */
.single-product form.cart .wcdo-options-wrapper + #wcom-uw {
    margin-top: 12px;
}

.single-product form.cart .wcdo-options-wrapper,
.single-product form.cart #wcom-uw {
    box-sizing: border-box;
}

/* 窄屏下避免 WCDO 三列尺寸控件挤出容器 */
@media (max-width: 600px) {
    .single-product .wcdo-option.wcdo-size-inline {
        width: 100% !important;
        margin-right: 0 !important;
    }
}

/* —— 评论 Tab：高级评论区域铺满内容宽、与选项卡留白 —— */
.woocommerce .woocommerce-tabs #tab-reviews,
.woocommerce .woocommerce-Tabs-panel--reviews {
    padding-top: 1.25rem;
    padding-bottom: 0.5rem;
}

.woocommerce .woocommerce-tabs #tab-reviews .awrp-reviews-wrap,
.woocommerce .woocommerce-Tabs-panel--reviews .awrp-reviews-wrap {
    max-width: none;
    width: 100%;
}

/* 评论卡片内长文本/链接换行，避免撑破布局 */
.woocommerce .awrp-reviews-wrap .awrp-review-content,
.woocommerce .awrp-reviews-wrap .awrp-merchant-reply {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* 评论图片网格在 Tab 内不溢出 */
.woocommerce .awrp-reviews-wrap .awrp-image-grid,
.woocommerce .awrp-reviews-wrap .awrp-preview-grid {
    max-width: 100%;
}

/* —— 头部/抽屉内搜索框：为何有时需要单独写 box-sizing ——
   父主题已对 * 使用 border-box，并对 input[type="search"] 设了 width、height、padding-left:43px（放大镜占位）。
   若其它插件或后加载样式在局部把表单控件改回 content-box，或 WebKit 对 search 的 appearance 与宽度组合异常，
   会出现「搜索框比容器宽 / 溢出」。下面用与头部组件一致的选择器收紧盒模型，一般不必 !important。 */
.site-search input[type="search"],
.site-header .site-search input[type="search"],
.widget_product_search input[type="search"],
.widget_search input[type="search"],
form.search-form input[type="search"],
.wp-block-search .wp-block-search__input {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* ==========================================================================
   wpcom-member 账号页（/general 等）与 Shoptimizer
   —— 原因说明 + 布局修复 ——
   1) 插件 .member-account-wrap 为 display:flex；侧栏固定宽、主区 width:100% 在部分宽度下会
      与 flex 计算冲突，桌面用 flex:1 + min-width:0 纠正。
   2) 若在编辑器里用「粗体」包住短代码，wpautop 会在短代码外包一层 <strong>，甚至出现
      <div class="member-account-wrap"><strong>…两列 div…</strong></strong> 这类无效嵌套。
      此时 flex 的直接子节点只剩一个 <strong>，侧栏与主栏无法并排——DevTools 里会看到错位
      从紧跟在 member-account-wrap 后的 <strong> 开始。
      用 display:contents 让该 strong 在布局上「透明」，两列仍作为 .member-account-wrap 的子项参与 flex。
   3) 后台仍建议：账号中心页面只放短代码，不要加粗、不要多空行。
   ========================================================================== */

/* 核心：抵消「粗体包短代码」产生的包裹层（见上说明第 2 点） */
body.woocommerce-account .entry-content .member-account-wrap > strong {
    display: contents;
    font-weight: inherit;
}

@media (min-width: 768px) {
    body.woocommerce-account .entry-content .member-account-wrap {
        display: flex;
        align-items: flex-start;
        flex-wrap: nowrap;
        max-width: 100%;
    }

    body.woocommerce-account .entry-content .member-account-nav {
        flex-shrink: 0;
    }

    body.woocommerce-account .entry-content .member-account-content {
        flex: 1 1 0%;
        min-width: 0;
        width: auto !important;
        max-width: none;
    }
}

/* 文首空段落 <p><strong></strong></p>、文尾多余空 strong / 空 p */
body.woocommerce-account .entry-content > p:first-child:has(> strong:empty) {
    display: none;
}

body.woocommerce-account .entry-content .member-account-wrap ~ strong:empty,
body.woocommerce-account .entry-content .member-account-wrap ~ p:empty {
    display: none;
}

/* ==========================================================================
   我的订单：状态 Tab + 搜索 + 手机卡片（参考 mobile_order_nav / mobile_order_list_v3）
   ========================================================================== */

.cg-account-orders-page {
    --cg-o-purple: #534ab7;
    --cg-o-border: rgba(0, 0, 0, 0.08);
    --cg-o-muted: #6b7280;
}

.cg-orders-masthead__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px 12px;
}

.cg-orders-masthead__title {
    font-size: 17px;
    font-weight: 500;
    color: #111827;
}

.cg-orders-masthead__count {
    font-size: 12px;
    color: var(--cg-o-muted);
}

.cg-orders-toolbar {
    background: #fff;
    border: 1px solid var(--cg-o-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
}

.cg-orders-search {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--cg-o-border);
    background: #fff;
}

.cg-orders-search__icon {
    color: var(--cg-o-muted);
    flex-shrink: 0;
    display: flex;
}

.cg-orders-search__input {
    border: none;
    background: transparent;
    font-size: 13px;
    color: #111827;
    outline: none;
    flex: 1;
    min-width: 0;
}

.cg-order-tabs__scroll {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 4px;
}

.cg-order-tabs__scroll::-webkit-scrollbar {
    display: none;
}

a.cg-order-tab {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px 12px;
    font-size: 13px;
    color: var(--cg-o-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

a.cg-order-tab.is-active {
    color: var(--cg-o-purple);
    border-bottom-color: var(--cg-o-purple);
    font-weight: 500;
}

.cg-order-tab__badge {
    background: #e24b4a;
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* 桌面：表格显示；手机：卡片显示 */
.cg-orders-cards--mobile {
    display: none;
}

@media (max-width: 768px) {
    .cg-orders-table--desktop {
        display: none !important;
    }
    .cg-orders-cards--mobile {
        display: block;
    }
    .cg-orders-masthead__title-row {
        padding-bottom: 10px;
    }
}

@media (min-width: 769px) {
    .cg-orders-toolbar {
        display: flex;
        align-items: stretch;
        flex-wrap: nowrap;
    }
    .cg-orders-search {
        border-bottom: none;
        border-right: 1px solid var(--cg-o-border);
        flex: 0 0 220px;
    }
    .cg-order-tabs {
        flex: 1;
        min-width: 0;
    }
    .cg-order-tabs__scroll {
        padding: 0 8px;
    }
    a.cg-order-tab {
        padding: 12px 16px 13px;
    }
}

/* 手机订单卡片 */
.cg-o-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--cg-o-border);
    margin-bottom: 10px;
    overflow: hidden;
}

.cg-o-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 13px;
    border-bottom: 1px solid var(--cg-o-border);
}

.cg-o-head-left {
    display: flex;
    align-items: center;
    gap: 7px;
}

a.cg-o-head-num {
    font-size: 13px;
    font-weight: 500;
    color: var(--cg-o-purple);
    text-decoration: none;
}

.cg-o-head-date {
    font-size: 11px;
    color: var(--cg-o-muted);
}

.cg-o-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: 20px;
}

.cg-o-tag--hold {
    background: #fff3e0;
    color: #bf360c;
}

.cg-o-tag--done {
    background: #e8f5e9;
    color: #1b5e20;
}

.cg-o-tag--unpaid {
    background: #fef3c7;
    color: #92400e;
}

.cg-o-tag--proc {
    background: #e0e7ff;
    color: #3730a3;
}

.cg-o-tag--misc {
    background: #f3f4f6;
    color: #4b5563;
}

.cg-o-item {
    display: flex;
    gap: 10px;
    padding: 11px 13px;
}

.cg-o-sep {
    border: none;
    border-top: 1px dashed var(--cg-o-border);
    margin: 0 13px;
}

.cg-o-thumb {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid var(--cg-o-border);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cg-o-thumb img,
.cg-o-thumb .woocommerce-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cg-o-body {
    flex: 1;
    min-width: 0;
}

.cg-o-title {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--cg-o-purple);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.cg-o-meta {
    font-size: 11px;
    color: var(--cg-o-muted);
    line-height: 1.6;
    margin: 3px 0 0;
}

.cg-o-meta--flip .cg-flip-order-ref__link {
    color: var(--cg-o-purple);
}

.cg-o-qtyrow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--cg-o-border);
}

.cg-o-qtylabel {
    font-size: 12px;
    color: var(--cg-o-muted);
}

.cg-o-price {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.cg-o-foot {
    padding: 10px 13px 12px;
    border-top: 1px solid var(--cg-o-border);
}

.cg-o-totalrow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cg-o-totallabel {
    font-size: 12px;
    color: var(--cg-o-muted);
}

.cg-o-totalval {
    font-size: 15px;
    font-weight: 500;
    color: #111827;
}

.cg-o-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.cg-o-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    line-height: 1.2;
}

.cg-o-btn--primary {
    background: var(--cg-o-purple);
    color: #fff;
    border-color: var(--cg-o-purple);
}

.cg-o-btn--secondary {
    background: #fff;
    color: var(--cg-o-purple);
    border-color: var(--cg-o-purple);
}

.cg-o-btn--ghost {
    background: transparent;
    color: var(--cg-o-muted);
    border-color: #d1d5db;
}

.cg-o-btn--danger {
    background: transparent;
    color: #a32d2d;
    border-color: #f09595;
}

/* 订单详情 — 收货信息与改址（复用结账页 .sa-co-* 样式） */
.cgpa-sa-co-scope.sa-co-wrapper,
.cgpa-sa-co-scope .sa-co-wrapper {
    margin: 0 0 14px;
}

/* 订单详情 — 收货信息与改址 */
.cgpa-customer-details {
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.cgpa-receiving-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.cgpa-receiving-card {
    padding: 14px 16px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.cgpa-line {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}

.cgpa-line--addr .cgpa-value {
    display: block;
    margin-top: 4px;
}

.cgpa-line--muted {
    font-size: 13px;
    color: #6b7280;
}

.cgpa-label {
    font-weight: 600;
    color: #111827;
    margin-right: 6px;
}

.cgpa-subblock {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.cgpa-subblock--original {
    background: #f9fafb;
    border-left: 4px solid #9ca3af;
}

.cgpa-subblock--pending {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
}

.cgpa-subtitle {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.cgpa-hint {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.5;
}

.cgpa-hint--notice {
    color: #92400e;
}

.cgpa-hint--error {
    color: #b91c1c;
}

.cgpa-hint--ok {
    color: #166534;
}

.cgpa-change-wrap {
    margin-top: 16px;
}

.cgpa-toggle-change {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    color: #7c3aed;
    text-decoration: underline;
    cursor: pointer;
}

.cgpa-toggle-change:hover {
    color: #5b21b6;
}

.cgpa-change-form {
    margin-top: 12px;
    padding: 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.cgpa-source-fieldset {
    border: none;
    margin: 0 0 12px;
    padding: 0;
}

.cgpa-source-fieldset legend {
    font-weight: 600;
    margin-bottom: 8px;
    padding: 0;
}

.cgpa-radio {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.cgpa-form-row {
    margin-bottom: 10px;
}

.cgpa-form-row label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    color: #374151;
}

.cgpa-form-row .input-text,
.cgpa-select {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
}

.cgpa-form-row-2 {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cgpa-form-row-2 > span {
    flex: 1;
    min-width: 140px;
}

.cgpa-form-actions {
    margin-top: 14px;
    margin-bottom: 0;
}

.cgpa-form-actions .button {
    min-width: 120px;
}

/* 收货地址：标签与内容同一行起排，减少「标签一行、内容另起」；地址段用空格分隔 */
.cgpa-line--addr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15em 0.5em;
    margin: 0 0 8px;
}

.cgpa-line--addr .cgpa-label {
    flex-shrink: 0;
}

.cgpa-line--addr .cgpa-value {
    flex: 1;
    min-width: 12em;
    line-height: 1.55;
}

/* 我的账户：侧栏改为顶部条（头像 + 导航），内容区全宽 */
.woocommerce-account .cg-account-wrap {
    max-width: 100%;
}

.woocommerce-account .cg-account-topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

@media (min-width: 783px) {
    .woocommerce-account .cg-account-topbar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 20px 24px;
    }
}

.cg-account-topbar__user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.cg-account-avatar {
    border-radius: 50%;
    border: 1px solid #e5e7eb;
}

.cg-account-topbar__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
}

.cg-account-topbar__hi {
    font-size: 12px;
    color: #6b7280;
}

.cg-account-topbar__name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.woocommerce-account .cg-account-topbar .woocommerce-MyAccount-navigation {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.woocommerce-account .cg-account-topbar .woocommerce-MyAccount-navigation ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-account .cg-account-topbar .woocommerce-MyAccount-navigation ul li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.woocommerce-account .cg-account-main.woocommerce-MyAccount-content {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* 订单详情页标题与表格 */
.cg-order-details__title {
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.cg-order-details-table .cg-od-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.cg-order-details-table .cg-od-item__thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
    border: 1px solid #eee;
}

.cg-order-details-table .cg-od-item__thumb img,
.cg-order-details-table .cg-od-item__thumb .woocommerce-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cg-order-details-table .cg-od-item__body {
    flex: 1;
    min-width: 0;
}

.cg-order-details-table .cg-od-item__title {
    font-size: 14px;
    line-height: 1.45;
    margin: 0 0 4px;
}

.cg-order-details-table .cg-od-item__title .cg-od-qty-desktop {
    font-weight: 600;
    color: #6b7280;
    margin-left: 6px;
}

.cg-order-details-table .cg-od-item__meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.cg-order-details-table .cg-od-item__qtyprice--mobile {
    display: none;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.cg-order-details-table .cg-od-item__sub--mobile {
    font-weight: 600;
    color: #111827;
}

.cg-order-details-table .cg-od-total-desktop {
    text-align: right;
    font-weight: 500;
}

@media (max-width: 768px) {
    .cg-order-details-table thead {
        display: none;
    }

    .cg-order-details-table .cg-od-cell--total {
        display: none !important;
    }

    .cg-order-details-table .cg-od-qty-desktop {
        display: none !important;
    }

    .cg-order-details-table .cg-od-item__qtyprice--mobile {
        display: flex;
    }

    .cg-order-details-table .cg-od-row td {
        display: block;
        width: 100% !important;
        border: none !important;
        padding: 10px 0 !important;
    }

    .cg-order-details-table tbody tr.cg-od-row {
        display: block;
        border-bottom: 1px solid #e5e7eb;
    }

    .cg-order-details-table tbody tr.cg-od-row:last-child {
        border-bottom: none;
    }
}

/* ==========================================================================
   订单付款链接（订单详情 + order-pay 页）
   ========================================================================== */

.congpa-pay-link-box {
    margin-top: 30px;
    padding: 20px 24px;
    background: #f0f7ff;
    border: 1px solid #c3ddf7;
    border-left: 4px solid #2E75B6;
    border-radius: 6px;
    clear: both;
}

.congpa-pay-link-box--checkout {
    margin-top: 0;
    margin-bottom: 24px;
}

.congpa-pay-link-title {
    font-size: 15px;
    font-weight: 600;
    color: #1F5C99;
    margin: 0 0 8px;
}

.congpa-pay-link-desc {
    font-size: 13px;
    color: #444;
    margin-bottom: 14px;
    line-height: 1.7;
}

.congpa-pay-link-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.congpa-pay-link-input {
    flex: 1;
    padding: 9px 12px;
    font-size: 13px;
    border: 1px solid #c3ddf7;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: text;
    min-width: 0;
}

.congpa-copy-btn {
    padding: 9px 20px;
    background: #2E75B6;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.congpa-copy-btn:hover {
    background: #1F5C99;
}

.congpa-copy-btn.copied {
    background: #27ae60;
}

.congpa-pay-link-tip {
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 12px;
    color: #888;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .congpa-pay-link-row {
        flex-direction: column;
        align-items: stretch;
    }

    .congpa-copy-btn {
        text-align: center;
    }
}
