/* WooPay Payment Form Styles */
.kitpayment-container {
    max-width: 100%;
    margin: 0;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Checkout Left-Right Layout */
.kitpayment-checkout-layout {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.kitpayment-checkout-left {
    flex: 1;
    min-width: 0;
}

.kitpayment-checkout-right {
    flex: 1;
    min-width: 0;
}

.kitpayment-address-section {
    margin-bottom: 12px;
    padding: 12px;
    background: #f7f9fc;
    border-radius: 6px;
}

.kitpayment-payment-section {
    padding: 12px;
    background: #f7f9fc;
    border-radius: 6px;
    position: sticky;
    top: 15px;
}

.kitpayment-section-title {
    margin: 0 0 10px 0;
    font-size: 15px;
    font-weight: 600;
    color: #32325d;
    padding-bottom: 6px;
    border-bottom: 2px solid #e0e6ed;
}

.kitpayment-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.kitpayment-form-group {
    flex: 1;
    margin-bottom: 8px;
}

.kitpayment-form-group label {
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
    font-weight: 500;
    color: #32325d;
    line-height: 1.2;
}

/* Inline Label Styles (label and input on the same line) */
.kitpayment-form-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kitpayment-form-inline label {
    display: inline-block;
    margin-bottom: 0;
    min-width: 50px;
    flex-shrink: 0;
    font-size: 13px;
}

.kitpayment-form-inline .kitpayment-input {
    flex: 1;
    min-width: 0;
}

.kitpayment-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e0e6ed;
    border-radius: 4px;
    font-size: 13px;
    color: #32325d;
    background: #ffffff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    line-height: 1.4;
    height: 32px;
}

.kitpayment-input:focus {
    outline: none;
    border-color: #6772e5;
    box-shadow: 0 0 0 2px rgba(103, 114, 229, 0.1);
}

.kitpayment-form-group input[type="checkbox"] {
    margin-right: 6px;
    margin-top: 0;
    vertical-align: middle;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Checkbox Label Styles */
.kitpayment-form-group > label:has(input[type="checkbox"]),
.kitpayment-form-group label[for="same_as_billing"],
.kitpayment-address-section .kitpayment-form-group > label {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 8px !important;
    font-size: 13px !important;
    cursor: pointer;
    padding: 4px 0;
    line-height: 1.4;
}

/* Ensure checkbox in shipping address section is visible */
#same_as_billing {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@media (max-width: 968px) {
    .kitpayment-checkout-layout {
        flex-direction: column;
    }
    
    .kitpayment-payment-section {
        position: static;
    }
    
    .kitpayment-checkout-content {
        max-width: 95% !important;
    }
}

.kitpayment-form-wrapper {
    width: 100%;
}

.kitpayment-title {
    margin: 0 0 15px 0;
    font-size: 22px;
    font-weight: 600;
    color: #32325d;
    text-align: center;
}

.kitpayment-amount {
    text-align: center;
    margin-bottom: 15px;
    padding: 15px;
    background: #f7f9fc;
    border-radius: 6px;
}

.kitpayment-currency {
    font-size: 18px;
    color: #8898aa;
    margin-right: 5px;
}

.kitpayment-price {
    font-size: 36px;
    font-weight: 700;
    color: #32325d;
}

/* Stripe Elements Container */
#kitpayment-card-element,
.kitpayment-card-element {
    padding: 15px;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    background: #ffffff;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
    min-height: 40px;
}

#kitpayment-card-element:focus-within,
.kitpayment-card-element:focus-within {
    border-color: #6772e5;
    box-shadow: 0 0 0 3px rgba(103, 114, 229, 0.1);
}

/* Error Messages */
#kitpayment-card-errors,
.kitpayment-card-errors {
    color: #fa755a;
    font-size: 14px;
    margin-bottom: 15px;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#kitpayment-card-errors.kitpayment-error-visible,
.kitpayment-card-errors.kitpayment-error-visible {
    opacity: 1;
}

.kitpayment-error {
    color: #fa755a;
    padding: 15px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* Checkout 按钮样式 */
.cart_button {
    margin-top: 15px;
}

.cart_button a {
    width: 100%;
    padding: 12px 20px;
    background: #6772e5;
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: block;
    position: relative;
    min-height: 50px;
    line-height: 1.5;
}

.cart_button a:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(103, 114, 229, 0.4);
}

.cart_button a:active {
    transform: translateY(0);
}

.cart_button a i {
    margin-right: 8px;
}

/* 提交按钮 - 与 Checkout 按钮样式一致 */
.kitpayment-submit-btn {
    width: 100%;
    padding: 12px 20px;
    background: #6772e5;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 50px;
    line-height: 1.5;
    text-align: center;
    display: block;
}

.kitpayment-submit-btn:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(103, 114, 229, 0.4);
}

.kitpayment-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.kitpayment-submit-btn:disabled {
    background: #aab7c4;
    cursor: not-allowed;
    opacity: 0.7;
}

.kitpayment-button-text {
    display: inline-block;
}

.kitpayment-button-text i {
    margin-right: 8px;
}

.kitpayment-button-spinner {
    display: inline-block;
    margin-left: 10px;
}

/* 成功消息 */
#kitpayment-success-message,
.kitpayment-success-message {
    text-align: center;
    padding: 30px;
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 8px;
    margin-top: 20px;
}

.kitpayment-success-content h4 {
    color: #16a34a;
    font-size: 24px;
    margin: 0 0 15px 0;
}

.kitpayment-success-content p {
    color: #166534;
    margin: 10px 0;
    font-size: 16px;
}

#kitpayment-payment-id {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #059669;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 10px;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .kitpayment-container {
        margin: 10px;
        padding: 20px;
    }
    
    .kitpayment-title {
        font-size: 20px;
    }
    
    .kitpayment-price {
        font-size: 28px;
    }
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.kitpayment-button-spinner::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
}

/* 购物车图标 */
.kitpayment-cart-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #6772e5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(103, 114, 229, 0.4);
    z-index: 9998;
    transition: all 0.3s ease;
}

.kitpayment-cart-icon:hover {
    background: #5568d3;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(103, 114, 229, 0.5);
}

.kitpayment-cart-icon-svg {
    font-size: 28px;
    color: #ffffff;
}

.kitpayment-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #fa755a;
    color: #ffffff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid #ffffff;
}

/* 购物车弹窗 */
.kitpayment-cart-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.kitpayment-cart-popup.kitpayment-cart-popup-open {
    display: block;
}

.kitpayment-cart-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.kitpayment-cart-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kitpayment-checkout-content {
    max-width: 1200px !important;
    width: 95% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.kitpayment-checkout-content {
    max-width: 1200px !important;
    width: 95% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.kitpayment-cart-popup-header {
    padding: 20px;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kitpayment-cart-popup-header h3 {
    margin: 0;
    font-size: 24px;
    color: #32325d;
}

.kitpayment-cart-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #8898aa;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
    transition: color 0.3s ease;
}

.kitpayment-cart-close:hover {
    color: #32325d;
}

.kitpayment-cart-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.kitpayment-cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.kitpayment-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f7f9fc;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
}

.kitpayment-cart-item-info {
    flex: 1;
}

.kitpayment-cart-item-name {
    font-weight: 600;
    color: #32325d;
    margin-bottom: 5px;
}

.kitpayment-cart-item-price {
    font-size: 14px;
    color: #8898aa;
}

.kitpayment-cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kitpayment-cart-item-quantity {
    width: 60px;
    padding: 5px;
    border: 1px solid #e0e6ed;
    border-radius: 4px;
    text-align: center;
}

.kitpayment-cart-item-remove {
    padding: 6px 12px;
    background: #fa755a;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.kitpayment-cart-item-remove:hover {
    background: #e63946;
}

.kitpayment-cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #8898aa;
}

.kitpayment-cart-popup-footer {
    padding: 20px;
    border-top: 1px solid #e0e6ed;
    background: #f7f9fc;
}

.kitpayment-cart-total {
    margin-bottom: 15px;
    font-size: 20px;
    color: #32325d;
    text-align: center;
}

.kitpayment-cart-checkout-btn {
    width: 100%;
    padding: 15px;
    background: #6772e5;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.kitpayment-cart-checkout-btn:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(103, 114, 229, 0.4);
}

.kitpayment-cart-checkout-btn:disabled {
    background: #aab7c4;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 结账页面 */
.kitpayment-checkout-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
}

.kitpayment-checkout-wrapper {
    background: #ffffff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.kitpayment-checkout-wrapper h2 {
    margin: 0 0 30px 0;
    font-size: 28px;
    color: #32325d;
    text-align: center;
}

/* 购物车通知 */
.kitpayment-cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #16a34a;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.kitpayment-cart-notification.kitpayment-cart-notification-show {
    opacity: 1;
    transform: translateX(0);
}

/* 响应式设计 - 购物车 */
@media (max-width: 600px) {
    .kitpayment-cart-icon {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .kitpayment-cart-icon-svg {
        font-size: 24px;
    }
    
    .kitpayment-cart-popup-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .kitpayment-cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .kitpayment-cart-item-controls {
        width: 100%;
        justify-content: space-between;
    }
}

/* ============================================
   WooCommerce Mini Cart 集成样式
   ============================================ */

/* 购物车数量徽章 */
.kitpayment-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #fa755a;
    color: #ffffff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    border: 2px solid #ffffff;
    line-height: 1;
}

.shopping_cart .kitpayment-cart-count,
.cart-icon .kitpayment-cart-count,
.woocommerce-cart-link .kitpayment-cart-count {
    position: relative;
    top: auto;
    right: auto;
    margin-left: 5px;
    display: inline-block;
    vertical-align: middle;
}

/* Mini Cart 显示/隐藏 */
.mini_cart:not(.active),
.widget_shopping_cart:not(.active),
.woocommerce-mini-cart:not(.active) {
    display: none !important;
}

.mini_cart.active,
.widget_shopping_cart.active,
.woocommerce-mini-cart.active {
    display: block !important;
}

/* Mini Cart 商品项样式增强 */
.mini_cart .woocommerce-mini-cart-item,
.widget_shopping_cart .woocommerce-mini-cart-item,
.woocommerce-mini-cart .woocommerce-mini-cart-item {
    position: relative;
    padding: 15px 0;
    border-bottom: 1px solid #e0e6ed;
}

.mini_cart .woocommerce-mini-cart-item:last-child,
.widget_shopping_cart .woocommerce-mini-cart-item:last-child,
.woocommerce-mini-cart .woocommerce-mini-cart-item:last-child {
    border-bottom: none;
}

/* 购物车商品控制按钮 */
.kitpayment-cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.kitpayment-qty-minus,
.kitpayment-qty-plus,
.cart_qty_minus,
.cart_qty_plus {
    width: 28px;
    height: 28px;
    padding: 0;
    background: #f7f9fc;
    border: 1px solid #e0e6ed;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #32325d;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.kitpayment-qty-minus:hover,
.kitpayment-qty-plus:hover,
.cart_qty_minus:hover,
.cart_qty_plus:hover {
    background: #6772e5;
    border-color: #6772e5;
    color: #ffffff;
}

/* 购物车数量控制区域 */
.cart_quantity_controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.cart_qty_display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: #32325d;
    font-size: 14px;
}

.cart_item_total {
    margin-top: 5px;
    font-size: 13px;
    color: #6772e5;
    font-weight: 600;
}

.kitpayment-qty-input {
    width: 50px;
    padding: 5px;
    border: 1px solid #e0e6ed;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.kitpayment-qty-input:focus {
    outline: none;
    border-color: #6772e5;
    box-shadow: 0 0 0 2px rgba(103, 114, 229, 0.1);
}

/* 移除按钮样式 */
.mini_cart .remove_from_cart_button,
.widget_shopping_cart .remove_from_cart_button,
.woocommerce-mini-cart .remove_from_cart_button {
    position: absolute;
    top: 15px;
    right: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    background: #fa755a;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini_cart .remove_from_cart_button:hover,
.widget_shopping_cart .remove_from_cart_button:hover,
.woocommerce-mini-cart .remove_from_cart_button:hover {
    background: #e63946;
    transform: scale(1.1);
}

/* 购物车空状态 */
.woocommerce-mini-cart__empty-message {
    text-align: center;
    padding: 40px 20px;
    color: #8898aa;
    font-size: 16px;
}

/* 购物车总价样式 */
.mini_cart .woocommerce-mini-cart__total,
.widget_shopping_cart .woocommerce-mini-cart__total,
.woocommerce-mini-cart .woocommerce-mini-cart__total {
    padding: 15px 0;
    border-top: 2px solid #e0e6ed;
    margin-top: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #32325d;
}

/* 购物车按钮样式 */
.mini_cart .woocommerce-mini-cart__buttons,
.widget_shopping_cart .woocommerce-mini-cart__buttons,
.woocommerce-mini-cart .woocommerce-mini-cart__buttons {
    margin-top: 15px;
}

.mini_cart .woocommerce-mini-cart__buttons .button,
.widget_shopping_cart .woocommerce-mini-cart__buttons .button,
.woocommerce-mini-cart .woocommerce-mini-cart__buttons .button {
    width: 100%;
    padding: 12px 20px;
    background: #6772e5;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: block;
}

.mini_cart .woocommerce-mini-cart__buttons .button:hover,
.widget_shopping_cart .woocommerce-mini-cart__buttons .button:hover,
.woocommerce-mini-cart .woocommerce-mini-cart__buttons .button:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(103, 114, 229, 0.4);
}

/* 购物车图标点击区域 */
.shopping_cart,
.cart-icon,
.woocommerce-cart-link {
    cursor: pointer;
    position: relative;
    display: inline-block;
}

/* 响应式 - Mini Cart */
@media (max-width: 768px) {
    .kitpayment-cart-item-controls {
        flex-wrap: wrap;
    }
    
    .kitpayment-qty-input {
        width: 60px;
    }
    
    .mini_cart .woocommerce-mini-cart-item,
    .widget_shopping_cart .woocommerce-mini-cart-item,
    .woocommerce-mini-cart .woocommerce-mini-cart-item {
        padding: 12px 0;
    }
}

