/**
 * Aura 主题 - WooCommerce 定制样式
 * Apple 风格：干净、简洁、大量留白、系统字体
 */

/* ========== 购物车布局 ========== */
.aura-cart {
    padding: 3rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
}

.aura-cart__title {
    font-size: 2.25rem;
    font-weight: 600;
    text-align: center;
    margin: 0 0 2.5rem;
    color: var(--text-main, #1d1d1f);
}

/* 左右双栏 */
.aura-cart__layout {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}
.aura-cart__main {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
}
.aura-cart__sidebar {
    width: 340px;
    flex-shrink: 0;
}

/* ========== 空购物车 ========== */
.aura-cart__empty {
    text-align: center;
    padding: 4rem 1rem;
}
.aura-cart__empty-text {
    font-size: 1.05rem;
    color: var(--text-muted, #86868b);
    margin-bottom: 1.5rem;
}
.aura-cart__empty-btn {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.7rem 2rem;
    border-radius: 9999px;
    background: var(--primary-color, #0071e3);
    color: #fff;
    text-decoration: none;
    transition: background 0.2s;
}
.aura-cart__empty-btn:hover {
    background: var(--primary-hover, #0077ed);
    color: #fff;
}

/* ========== 商品列表 ========== */
.aura-cart__items {
    display: flex;
    flex-direction: column;
}

.aura-cart-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light, #e5e5ea);
    min-width: 0;
}
.aura-cart-item:first-child {
    padding-top: 0;
}

/* 商品图片 */
.aura-cart-item__image {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-alt, #f5f5f7);
}
.aura-cart-item__image a {
    display: block;
    width: 100%;
    height: 100%;
}
.aura-cart-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 商品信息 */
.aura-cart-item__info {
    flex: 1 1 auto;
    min-width: 0;
}
.aura-cart-item__name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main, #1d1d1f);
    margin-bottom: 0.2rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.aura-cart-item__name a {
    color: var(--text-main, #1d1d1f);
    text-decoration: none;
}
.aura-cart-item__name a:hover {
    color: var(--primary-color, #0071e3);
}
.aura-cart-item__name .variation,
.aura-cart-item__name dl.variation {
    font-size: 0.8rem;
    color: var(--text-muted, #86868b);
    margin: 0.2rem 0 0;
    display: flex;
    gap: 0.25rem;
}
.aura-cart-item__name dl.variation dt {
    font-weight: 400;
    float: none;
    clear: none;
}
.aura-cart-item__name dl.variation dd {
    margin: 0;
    float: none;
}
.aura-cart-item__meta {
    font-size: 0.8rem;
    color: var(--text-muted, #86868b);
}

/* 数量 */
.aura-cart-item__qty {
    flex-shrink: 0;
}
.aura-cart-item__qty .quantity {
    display: flex;
    align-items: center;
}
.aura-cart-item__qty .quantity .qty {
    width: 48px;
    height: 32px;
    padding: 0 0.25rem;
    border: 1px solid var(--border-color, #d2d2d7);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-main, #1d1d1f);
    background: #fff;
    text-align: center;
    -moz-appearance: textfield;
    box-sizing: border-box;
}
.aura-cart-item__qty .quantity .qty::-webkit-inner-spin-button,
.aura-cart-item__qty .quantity .qty::-webkit-outer-spin-button {
    opacity: 1;
    height: 32px;
}

/* 小计 */
.aura-cart-item__subtotal {
    flex-shrink: 0;
    text-align: right;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}
.aura-cart-item__price {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main, #1d1d1f);
    white-space: nowrap;
}
.aura-cart-item__price .amount {
    font-weight: 500;
}

/* 删除按钮 */
.aura-cart-item__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted, #86868b);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}
.aura-cart-item__remove:hover {
    color: #ff3b30;
    background: rgba(255, 59, 48, 0.08);
}

/* ========== 操作栏 ========== */
.aura-cart__actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1.25rem;
    align-items: center;
}

.aura-cart__coupon {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}
.aura-cart__coupon-input {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color, #d2d2d7);
    border-radius: 9999px;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-main, #1d1d1f);
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.aura-cart__coupon-input:focus {
    border-color: var(--primary-color, #0071e3);
    outline: none;
}
.aura-cart__coupon-btn {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    border: 1px solid var(--primary-color, #0071e3);
    border-radius: 9999px;
    background: transparent;
    color: var(--primary-color, #0071e3);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.aura-cart__coupon-btn:hover {
    background: var(--primary-color, #0071e3);
    color: #fff;
}

.aura-cart__update-btn {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    border: 1px solid var(--border-color, #d2d2d7);
    border-radius: 9999px;
    background: transparent;
    color: var(--text-main, #1d1d1f);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.aura-cart__update-btn:hover {
    background: var(--bg-alt, #f5f5f7);
}

/* ========== 右侧订单摘要 ========== */
.aura-cart__summary {
    background: var(--bg-alt, #f5f5f7);
    border-radius: 16px;
    padding: 1.5rem;
    position: sticky;
    top: 1.5rem;
}
.aura-cart__summary-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--text-main, #1d1d1f);
}

.aura-cart__totals {
    margin-bottom: 1.25rem;
}
.aura-cart__total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light, #e5e5ea);
    gap: 0.5rem;
}
.aura-cart__total-row:last-child {
    border-bottom: none;
}
.aura-cart__total-label {
    font-size: 0.85rem;
    color: var(--text-muted, #86868b);
    white-space: nowrap;
}
.aura-cart__total-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main, #1d1d1f);
    text-align: right;
    white-space: nowrap;
}
.aura-cart__total-discount {
    font-size: 0.85rem;
    color: #30b158;
    text-align: right;
}
.aura-cart__total-row--grand {
    border-bottom: none;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border-color, #d2d2d7);
}
.aura-cart__total-row--grand .aura-cart__total-label,
.aura-cart__total-row--grand .aura-cart__total-value {
    font-size: 1rem;
    font-weight: 600;
}

.aura-cart__checkout-btn {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.8rem 2rem;
    border-radius: 9999px;
    background: var(--primary-color, #0071e3);
    color: #fff;
    text-decoration: none;
    transition: background 0.2s;
    box-sizing: border-box;
}
.aura-cart__checkout-btn:hover {
    background: var(--primary-hover, #0077ed);
    color: #fff;
}

/* ========== 通知消息 ========== */
.woocommerce-notices-wrapper {
    margin-bottom: 1.5rem;
}
.woocommerce-message,
.woocommerce-info {
    background: var(--bg-alt, #f5f5f7);
    border: none;
    border-radius: 12px;
    padding: 0.9rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-main, #1d1d1f);
    margin-bottom: 0;
}
.woocommerce-message::before,
.woocommerce-info::before {
    display: none;
}

/* ========== 结账页面 ========== */
.aura-checkout {
    padding: 3rem 2rem;
    max-width: 768px;
    margin: 0 auto;
    box-sizing: border-box;
}
.aura-checkout__title {
    font-size: 2.25rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2.5rem;
}
.aura-checkout__card {
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 2rem;
    box-sizing: border-box;
}
@media (min-width: 768px) {
    .aura-checkout__card {
        padding: 2.5rem 3rem;
    }
}

/* 结账表单 */
.woocommerce-checkout .col2-set {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2 {
    flex: 1 1 260px;
    min-width: 0;
}

.woocommerce-billing-fields h3,
.woocommerce-shipping-fields h3,
#order_review_heading {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--text-main, #1d1d1f);
}

/* 表单 */
.woocommerce form .form-row {
    margin: 0 0 1rem;
    padding: 0;
}
.woocommerce form .form-row label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main, #1d1d1f);
    margin-bottom: 0.35rem;
}
.woocommerce form .form-row label .required {
    color: #ff3b30;
    text-decoration: none;
}
.woocommerce form .form-row .input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea,
.woocommerce .input-text,
.select2-container .select2-selection {
    width: 100%;
    max-width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border-color, #d2d2d7);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main, #1d1d1f);
    background: #fff;
    box-sizing: border-box;
}
.woocommerce form .form-row .input-text:focus,
.woocommerce form .form-row select:focus,
.woocommerce form .form-row textarea:focus {
    border-color: var(--primary-color, #0071e3);
    outline: none;
}
.select2-container .select2-selection {
    height: auto;
    min-height: 42px;
    display: flex;
    align-items: center;
}

/* 订单预览 */
#order_review {
    background: var(--bg-alt, #f5f5f7);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}
.woocommerce-checkout-review-order-table {
    width: 100%;
    border: none;
    border-collapse: collapse;
    background: transparent;
}
.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    border: none;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}
.woocommerce-checkout-review-order-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted, #86868b);
    font-weight: 500;
}
.woocommerce-checkout-review-order-table tfoot th {
    font-weight: 400;
    color: var(--text-muted, #86868b);
}
.woocommerce-checkout-review-order-table tfoot td {
    text-align: right;
    font-weight: 500;
}
.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
    font-weight: 600;
    font-size: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light, #e5e5ea);
}

/* 支付方式 */
#payment {
    background: transparent;
    border: none;
    margin-top: 1rem;
}
#payment ul.payment_methods {
    border: none;
    padding: 0;
    margin: 0;
}
#payment ul.payment_methods li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light, #e5e5ea);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}
#payment ul.payment_methods li:last-child {
    border-bottom: none;
}
#payment ul.payment_methods li input[type="radio"] {
    accent-color: var(--primary-color, #0071e3);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
#payment ul.payment_methods li label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main, #1d1d1f);
    cursor: pointer;
}
#payment div.payment_box {
    background: #fff;
    border-radius: 10px;
    margin: 0.5rem 0 0 1.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted, #86868b);
}
#payment div.payment_box::before {
    display: none;
}
#payment .place-order {
    margin-top: 1.5rem;
    padding: 0;
}
#place_order {
    display: block;
    width: 100%;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.85rem 2rem;
    border-radius: 9999px;
    background: var(--primary-color, #0071e3);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}
#place_order:hover {
    background: var(--primary-hover, #0077ed);
}

/* ========== 隐藏 WC 默认元素 ========== */
.aura-cart .cart-collaterals,
.aura-cart .shop_table {
    display: none !important;
}

/* ========== 响应式 ========== */
@media (max-width: 860px) {
    .aura-cart {
        padding: 2rem 1rem;
    }
    .aura-cart__layout {
        flex-direction: column;
        gap: 1.5rem;
    }
    .aura-cart__sidebar {
        width: 100%;
    }
    .aura-cart-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .aura-cart-item__image {
        width: 60px;
        height: 60px;
    }
    .aura-cart-item__subtotal {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-light, #e5e5ea);
    }
    .aura-cart__actions {
        flex-direction: column;
    }
    .aura-cart__coupon {
        width: 100%;
    }
    .aura-cart__update-btn {
        width: 100%;
    }
}
