/**
 * 前端样式
 */

.whitegoods-product-info {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.whitegoods-product-info h3 {
    margin: 0 0 15px 0;
    padding: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.whitegoods-product-info p {
    margin: 10px 0;
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.5;
}

.whitegoods-product-info strong {
    color: #0073aa;
    font-weight: 600;
    margin-right: 8px;
}

/* 半成品购买按钮样式 - 默认隐藏 */
.whitegoods-semi-finished-button,
.whitegoods-semi-finished-section,
.design-button {
    display: none !important;
}

/* 当按钮应该显示时，使用类覆盖默认隐藏 */
.whitegoods-semi-finished-button.wc-whitegoods-visible,
.whitegoods-semi-finished-section.wc-whitegoods-visible,
.design-button.wc-whitegoods-visible {
    display: block !important;
}

/* 购物车 White Goods 按钮样式 - 确保显示在 PRODUCT 列最后 - 最高优先级 */
.woocommerce-cart-form .cart_item td.product-name .wc-whitegoods-cart-button-wrapper,
.woocommerce-cart-form .cart_item .product-name .wc-whitegoods-cart-button-wrapper,
.cart_item td.product-name .wc-whitegoods-cart-button-wrapper,
.cart_item .product-name .wc-whitegoods-cart-button-wrapper,
td.product-name .wc-whitegoods-cart-button-wrapper,
.product-name .wc-whitegoods-cart-button-wrapper,
table.shop_table.cart .cart_item td.product-name .wc-whitegoods-cart-button-wrapper,
table.shop_table.cart .cart_item .product-name .wc-whitegoods-cart-button-wrapper,
.woocommerce table.shop_table.cart .cart_item td.product-name .wc-whitegoods-cart-button-wrapper,
.woocommerce table.shop_table.cart .cart_item .product-name .wc-whitegoods-cart-button-wrapper,
td.c-cart__shop-td--product-name .wc-whitegoods-cart-button-wrapper,
.c-cart__shop-td--product-name .wc-whitegoods-cart-button-wrapper,
.cart_item td.c-cart__shop-td--product-name .wc-whitegoods-cart-button-wrapper,
.cart_item .c-cart__shop-td--product-name .wc-whitegoods-cart-button-wrapper,
table.shop_table.cart .cart_item td.c-cart__shop-td--product-name .wc-whitegoods-cart-button-wrapper,
table.shop_table.cart .cart_item .c-cart__shop-td--product-name .wc-whitegoods-cart-button-wrapper,
.woocommerce table.shop_table.cart .cart_item td.c-cart__shop-td--product-name .wc-whitegoods-cart-button-wrapper,
.woocommerce table.shop_table.cart .cart_item .c-cart__shop-td--product-name .wc-whitegoods-cart-button-wrapper,
.woocommerce-cart-form .cart_item td.c-cart__shop-td--product-name .wc-whitegoods-cart-button-wrapper,
.woocommerce-cart-form .cart_item .c-cart__shop-td--product-name .wc-whitegoods-cart-button-wrapper {
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    display: block !important;
    clear: both !important;
    width: 100% !important;
    float: none !important;
    position: relative !important;
    z-index: 999 !important;
    order: 999 !important;
}

.wc-whitegoods-cart-button-wrapper {
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    display: block !important;
    clear: both !important;
    width: 100% !important;
    float: none !important;
    position: relative !important;
    z-index: 999 !important;
}

/* 确保隐藏类优先级 */
.whitegoods-semi-finished-button.wc-whitegoods-hidden,
.whitegoods-semi-finished-section.wc-whitegoods-hidden,
.design-button.wc-whitegoods-hidden {
    display: none !important;
}

.whitegoods-semi-finished-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.buy-semi-finished {
    margin-top: 10px;
}

.buy-semi-finished .elementor-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease !important;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.buy-semi-finished .elementor-button:hover {
    background-color: #005a87;
    color: white;
    text-decoration: none;
}

.buy-semi-finished .elementor-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

.buy-semi-finished .elementor-button:active {
    background-color: #004a6b;
}

.buy-semi-finished .elementor-button-loading {
    opacity: 0.8 !important;
    cursor: wait !important;
    pointer-events: none !important;
}

.buy-semi-finished .elementor-button-loading .elementor-button-text {
    position: relative;
}

.buy-semi-finished .elementor-button-loading .elementor-button-text:after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: elementor-button-spin 1s linear infinite;
}

@keyframes elementor-button-spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.buy-semi-finished .elementor-button-success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

.buy-semi-finished .elementor-button-success:hover {
    background-color: #218838 !important;
    border-color: #218838 !important;
    color: white !important;
}

.buy-semi-finished .elementor-button-disabled {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.buy-semi-finished .elementor-button-disabled:hover {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
    transform: none !important;
    box-shadow: none !important;
}

/* POD Designer Modal Styles */
#pod-designer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background: rgba(0, 0, 0, 0);
    display: none;
}

.pod-designer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(2px);
}

.pod-designer-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pod-designer-header {
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.pod-designer-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.pod-designer-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.pod-designer-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.pod-designer-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

#pod-designer-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Save & Close Button Styles - Hidden (functionality moved to save product button) */
#pod-designer-save-close {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

/* Save & Close button hover/active/focus styles removed - button is hidden */

/* 响应式设计 */
@media (max-width: 768px) {
    .pod-designer-container {
        width: 100%;
        height: 100%;
    }
    
    .pod-designer-title {
        font-size: 14px;
    }
    .whitegoods-product-info {
        margin: 15px 0;
        padding: 15px;
    }
    
    .whitegoods-product-info h3 {
        font-size: 16px;
    }
    
    .whitegoods-product-info p {
        font-size: 13px;
    }
    
    .semi-finished-link {
        padding: 10px 20px;
        font-size: 13px;
    }
}
