/* COD Form Frontend Styles */
.cod-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px 20px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: ltr;
    text-align: left;
    margin-top: 30px;
    border: 2px solid #f0f0f0;
}

.cod-form-wrapper.cod-product-form {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
}

.cod-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.cod-form-header h3 {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    padding: 0;
}

.cod-product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.product-name {
    font-weight: 600;
    font-size: 16px;
}

.product-price {
    font-weight: 700;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 5px;
}

.cod-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cod-input-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cod-input-container {
    flex: 1;
    min-width: 250px;
}

.cod-input-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.cod-input-container.full-width {
    flex: 1 1 100%;
}

.cod-input-container input,
.cod-input-container select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    background: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    outline: none;
    direction: ltr;
    text-align: left;
}

.cod-input-container input[type="number"] {
    text-align: center;
    direction: ltr;
}

.cod-input-container input:focus,
.cod-input-container select:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    transform: translateY(-2px);
}

.cod-input-container input::placeholder {
    color: #888;
    font-weight: 400;
}

.cod-input-container select option {
    padding: 10px;
    font-weight: 500;
}

/* Delivery type select animation */
#cod-delivery-type {
    animation: horizontal-shaking 2s infinite;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

@keyframes horizontal-shaking {
    0% { transform: translateX(0) }
    25% { transform: translateX(5px) }
    50% { transform: translateX(-5px) }
    75% { transform: translateX(5px) }
    100% { transform: translateX(0) }
}

.cod-summary {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e8eaed;
    margin-top: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 500;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.total-row {
    border-top: 2px solid #ddd;
    padding-top: 15px;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
}

#cod-delivery-price,
#cod-total-price {
    font-weight: 700;
    color: #e74c3c;
    font-size: 16px;
}

.cod-submit-container {
    margin-top: 20px;
}

.cod-submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}
.cod-whatsapp-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #25d466 0%, #25d466 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.cod-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.cod-submit-btn:active {
    transform: translateY(-1px);
}

.cod-submit-btn.loading {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.cod-submit-btn.loading:hover {
    transform: none;
    box-shadow: none;
}

.btn-loading {
    display: none;
}

.cod-submit-btn.loading .btn-text {
    display: none;
}

.cod-submit-btn.loading .btn-loading {
    display: inline;
}

.cod-footer-message {
    text-align: center;
    margin-top: 20px;
    color: #7f8c8d;
    font-size: 14px;
    font-style: italic;
}

.cod-message {
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.cod-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: 2px solid #27ae60;
}

.cod-error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: 2px solid #c0392b;
}

.message-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.success-icon,
.error-icon {
    font-size: 24px;
    font-weight: bold;
}

.message-text {
    font-size: 16px;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cod-form-wrapper {
        margin: 10px;
        padding: 15px;
        border-radius: 10px;
        margin-top: 20px;
    }
    
    .cod-product-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .cod-input-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .cod-input-container {
        min-width: unset;
        width: 100%;
    }
    
    .cod-input-container input,
    .cod-input-container select {
        padding: 12px;
        font-size: 14px;
    }
    
    .cod-form-header h3 {
        font-size: 20px;
    }
    
    .cod-submit-btn {
        padding: 15px;
        font-size: 16px;
    }
    
    .summary-row {
        font-size: 14px;
    }
    
    .total-row {
        font-size: 16px;
    }
}

/* Hover animations */
.cod-input-container {
    position: relative;
}

.cod-input-container input:hover,
.cod-input-container select:hover {
    border-color: #4a90e2;
    transform: translateY(-1px);
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cod-submit-btn.loading::before,
.cod-whatsapp-btn.loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
	background: #25d466;
}

/* Form validation styles */
.cod-input-container input.error,
.cod-input-container select.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.cod-input-container input.valid,
.cod-input-container select.valid {
    border-color: #27ae60;
}

/* Mobile responsive buttons */
@media (max-width: 768px) {
    .cod-submit-container {
        gap: 12px;
    }
    
    .cod-submit-btn,
    .cod-whatsapp-btn {
        padding: 15px;
        font-size: 16px;
    }
}

/* Enhanced visual feedback */
.cod-summary {
    position: relative;
    overflow: hidden;
}

.cod-summary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.cod-summary:hover::before {
    left: 100%;
}

/* Price update animation */
.price-update {
    animation: priceUpdate 0.6s ease-in-out;
}

/* WooCommerce Integration Styles */
.single-product .cod-form-wrapper {
    margin-top: 30px;
    border-top: 3px solid #667eea;
}

.single-product .cod-form-header::before {
    content: "🛒";
    font-size: 24px;
    margin-left: 10px;
}

/* Quantity input styling */
#cod-quantity {
    max-width: 80px;
    text-align: center !important;
    direction: ltr !important;
}

/* Enhanced product form styling */
.cod-product-form .cod-summary {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #f39c12;
}

.cod-product-form .summary-row {
    font-size: 15px;
}

.cod-product-form .total-row {
    background: rgba(255, 255, 255, 0.3);
    padding: 15px;
    margin: 10px -20px -20px -20px;
    border-radius: 0 0 12px 12px;
}

@keyframes priceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #e74c3c; }
    100% { transform: scale(1); }