/**
 * Meander Ferry Coupons - Checkout Styles
 * v1.5 - Inline notification (input altında)
 */

/* === KUPON WRAPPER === */
.mfc-coupon-wrapper {
    padding: 16px 0;
    margin: 0;
}

/* === KUPON GİRİŞ FORMU === */
.mfc-coupon-form {
    width: 100%;
}

.mfc-coupon-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 8px 12px;
    transition: all 0.25s ease;
}

.mfc-coupon-input-wrapper:focus-within {
    border-color: #0073aa;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.mfc-coupon-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.mfc-coupon-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    font-size: 15px;
    padding: 8px 4px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 0;
    outline: none !important;
    box-shadow: none !important;
}

.mfc-coupon-input::placeholder {
    text-transform: none;
    color: #868e96;
    letter-spacing: 0;
}

.mfc-coupon-button {
    flex-shrink: 0;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #fff !important;
    border: none !important;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.mfc-coupon-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004466 100%);
    transform: translateY(-1px);
}

.mfc-coupon-button:active {
    transform: translateY(0);
}

.mfc-coupon-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.mfc-coupon-button.mfc-loading {
    position: relative;
    color: transparent !important;
}

.mfc-coupon-button.mfc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mfc-spin 0.6s linear infinite;
}

@keyframes mfc-spin {
    to { transform: rotate(360deg); }
}

/* === INLINE NOTIFICATION (input altında slide-down) === */
.mfc-coupon-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.35;
    border-radius: 10px;
    border: 1px solid transparent;
    /* gizliyken */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 14px;
    margin-top: 0;
    transition:
        max-height 0.3s ease,
        opacity 0.25s ease,
        padding 0.3s ease,
        margin-top 0.3s ease;
}

.mfc-coupon-notice.mfc-notice-show {
    max-height: 200px;
    opacity: 1;
    padding: 12px 14px;
    margin-top: 10px;
}

.mfc-coupon-notice-success {
    background: #e8f5ee;
    color: #155724;
    border-color: #b7e1c4;
}

.mfc-coupon-notice-error {
    background: #fdecee;
    color: #721c24;
    border-color: #f5c2c7;
}

.mfc-coupon-notice-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.mfc-coupon-notice-success .mfc-coupon-notice-icon {
    background: #28a745;
}

.mfc-coupon-notice-error .mfc-coupon-notice-icon {
    background: #dc3545;
}

.mfc-coupon-notice-message {
    flex: 1;
}

.mfc-coupon-notice-close {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    color: inherit !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.mfc-coupon-notice-close:hover {
    opacity: 1;
}

.mfc-coupon-notice-close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.5;
}

/* Eski inline mesaj alanı artık kullanılmıyor */
.mfc-coupon-message {
    display: none !important;
}

/* === UYGULANAN KUPON === */
.mfc-coupon-applied {
    width: 100%;
}

.mfc-coupon-success {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1);
}

.mfc-coupon-success .mfc-coupon-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.mfc-coupon-info {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mfc-coupon-code {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: #155724;
    letter-spacing: 0.5px;
    text-align: left;
}

.mfc-coupon-text {
    display: block;
    font-size: 13px;
    color: #1e7e34;
    text-align: left;
    line-height: 1.3;
}

.mfc-coupon-amount {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 17px;
    color: #155724;
    white-space: nowrap;
    margin-right: 4px;
}

/* === KALDIR BUTONU === */
.mfc-coupon-remove {
    flex-shrink: 0;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 1.5px solid rgba(21, 87, 36, 0.25) !important;
    border-radius: 50% !important;
    color: #155724 !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.mfc-coupon-remove:hover,
.mfc-coupon-remove:focus {
    background: #dc3545 !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
    transform: rotate(90deg);
}

.mfc-coupon-remove:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.mfc-coupon-remove svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.5;
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
    .mfc-coupon-input-wrapper {
        flex-wrap: wrap;
    }
    
    .mfc-coupon-input {
        flex: 1 1 100%;
        order: 1;
    }
    
    .mfc-coupon-icon {
        order: 0;
    }
    
    .mfc-coupon-button {
        order: 2;
        flex: 1;
        margin-top: 8px;
    }
    
    .mfc-coupon-success {
        gap: 10px;
        padding: 12px 14px;
    }
    
    .mfc-coupon-code {
        font-size: 14px;
    }
    
    .mfc-coupon-text {
        font-size: 12px;
    }
    
    .mfc-coupon-amount {
        font-size: 15px;
    }
    
    .mfc-coupon-notice {
        font-size: 13px;
    }
}

/* === WooCommerce Table Entegrasyonu === */
.woocommerce-checkout-review-order-table .mfc-coupon-row td {
    padding: 0;
    border: none;
    background: transparent;
}

.woocommerce-checkout-review-order-table .fee .amount {
    color: #28a745;
    font-weight: 600;
}