/**
 * Kuiba GiftCards - Frontend Styles
 *
 * @package Kuiba_GiftCards
 * @version 1.0.0
 */

/* GiftCard Product Form */
.kv-giftcard-form {
    margin: 20px 0;
}

.kv-giftcard-apply {
    
margin-top: 10px;

}

.kv-giftcard-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
    color: #333;
}

/* Amount Selection */
.kv-giftcard-amount-section {
    margin-bottom: 25px;
}

/* Preset Buttons */
.kv-giftcard-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.kv-giftcard-preset {
    padding: 12px 20px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: center;
}

.kv-giftcard-preset:hover {
    border-color: #999;
    background: #f5f5f5;
}

.kv-giftcard-preset.active {
    /* Inherits from .button class added via JS */
}

/* Stepper Input */
.kv-giftcard-stepper {
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: 200px;
    margin-top: 15px;
}

.kv-giftcard-stepper-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 8px;
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.kv-giftcard-stepper-btn:hover {
    border-color: #999;
    background: #f5f5f5;
}

.kv-giftcard-stepper-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kv-giftcard-stepper-input {
    width: 100px;
    height: 44px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid #ddd;
    border-radius: 8px;
    -moz-appearance: textfield;
}

.kv-giftcard-stepper-input::-webkit-outer-spin-button,
.kv-giftcard-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Recipient Section */
.kv-giftcard-recipient-section {
    margin-bottom: 25px;
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
}

.kv-giftcard-recipient-section .form-row {
    margin-bottom: 15px;
}

.kv-giftcard-recipient-section .form-row:last-child {
    margin-bottom: 0;
}

.kv-giftcard-recipient-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

.kv-giftcard-recipient-section .input-text,
.kv-giftcard-recipient-section textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.kv-giftcard-recipient-section .input-text:focus,
.kv-giftcard-recipient-section textarea:focus {
    border-color: #333;
    outline: none;
}

.kv-giftcard-recipient-section .description {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* Cart GiftCard Input - WooCommerce Coupon Style */
.kv-giftcard-row td {
    padding: 15px !important;
}

.kv-giftcard-coupon {
    margin-bottom: 0;
}

.kv-giftcard-coupon label {
    display: block;
    margin-bottom: 5px;
}

/* Voucher hint tooltip */
.kv-voucher-hint {
    margin: 8px 0 0 0;
    color: #666;
    font-size: 12px;
}

.kv-voucher-hint small {
    font-style: italic;
}

.kv-giftcard-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
}

.kv-giftcard-message.success {
    background: #d4edda;
    color: #155724;
}

.kv-giftcard-message.error {
    background: #f8d7da;
    color: #721c24;
}

.kv-giftcard-message.loading {
    background: #fff3cd;
    color: #856404;
}

/* Applied GiftCard Display */
.kv-giftcard-applied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.kv-giftcard-applied .kv-giftcard-code {
    font-family: monospace;
    font-size: 14px;
    font-weight: 600;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 4px;
}

.kv-giftcard-applied .kv-giftcard-balance {
    color: #27ae60;
    font-weight: 500;
}

.kv-giftcard-applied .kv-giftcard-remove {
    /* Inherits from theme button styling */
    padding: 5px 12px;
    font-size: 12px;
}

/* Cashback Message on Product Page */
.kv-cashback-message {
    margin: 15px 0;
    padding: 15px;
    font-size: 14px;
}

/* Order Details GiftCard Section */
.kv-giftcard-order-details {
    margin: 30px 0;
}

.kv-giftcard-order-details h2 {
    font-size: 18px;
    margin-bottom: 15px;
}

.kv-giftcard-order-details table {
    width: auto;
    min-width: 300px;
}

/* Gift Card Discount Row */
.kv-giftcard-discount-row th {
    font-weight: 500;
}

.kv-giftcard-discount-row td {
    color: #27ae60;
    font-weight: 600;
}

/* Cashback Badge - Ensure parent has relative positioning */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.woocommerce div.product div.images {
    position: relative;
}

/* Remaining Balance Info */
.kv-giftcard-remaining-info {
    margin-top: 10px;
    padding: 8px 12px;
    background: #e8f4fd;
    border-left: 3px solid #2196f3;
    color: #1565c0;
    font-size: 13px;
    border-radius: 0 4px 4px 0;
}

/* Responsive */
@media (max-width: 600px) {
    .kv-giftcard-presets {
        justify-content: center;
    }

    .kv-giftcard-preset {
        flex: 1 1 calc(33.333% - 10px);
        min-width: auto;
    }

    .kv-giftcard-stepper {
        max-width: 100%;
    }

    .kv-giftcard-input-wrapper {
        flex-direction: column;
    }

    .kv-giftcard-input-wrapper input[type="text"] {
        max-width: 100%;
    }

    .kv-giftcard-applied {
        flex-direction: column;
        align-items: flex-start;
    }
}
