/**
 * WC Product Custom Input - 前端樣式
 */

/* 輸入框容器 */
.wcpci-custom-input-wrapper {
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 1px solid #ffc107;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.15);
}

/* 標籤 */
.wcpci-custom-input-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #856404;
    font-size: 14px;
}

.wcpci-custom-input-wrapper label .required {
    color: #dc3545;
    margin-left: 2px;
}

/* 輸入框 */
.wcpci-custom-input-wrapper input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.wcpci-custom-input-wrapper input[type="text"]:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.25);
    outline: none;
}

.wcpci-custom-input-wrapper input[type="text"]::placeholder {
    color: #adb5bd;
}

/* 字符計數 */
.wcpci-char-count {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6c757d;
    text-align: right;
}

/* 錯誤狀態 */
.wcpci-custom-input-wrapper.wcpci-error {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
}

.wcpci-custom-input-wrapper input.wcpci-input-error {
    border-color: #dc3545;
    background: #fff5f5;
}

.wcpci-custom-input-wrapper input.wcpci-input-error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.wcpci-error-message {
    display: block;
    margin-top: 8px;
    padding: 8px 12px;
    background: #dc3545;
    color: #fff;
    font-size: 13px;
    border-radius: 4px;
    animation: wcpci-shake 0.4s ease;
}

/* 錯誤動畫 */
@keyframes wcpci-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* 購物車中的顯示 */
.woocommerce-cart-form .wcpci-cart-item-data,
.woocommerce-checkout .wcpci-cart-item-data {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #856404;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .wcpci-custom-input-wrapper {
        padding: 12px;
    }
    
    .wcpci-custom-input-wrapper input[type="text"] {
        padding: 10px 12px;
        font-size: 16px; /* 防止 iOS 縮放 */
    }
}








