/* Professional COD Checkout - Version 4.0 */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

* {
    box-sizing: border-box;
}

.cod-checkout-container {
    max-width: 480px;
    margin: 30px auto;
    font-family: 'Cairo', sans-serif;
}

/* Hide WooCommerce default elements */
.single-product div.product form.cart,
.single-product .single_add_to_cart_button,
.single-product .quantity,
body.single-product .cart {
    display: none !important;
}

.cod-checkout-container {
    display: block !important;
    visibility: visible !important;
}

/* Price Banner */
.cod-price-banner {
    background: #111827;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
}

.cod-price-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cod-offer-badge {
    background: #10b981;
    padding: 4px 14px;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.cod-price-wrapper {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.cod-current-price {
    font-size: 36px;
    font-weight: 800;
    color: white;
}

.cod-regular-price {
    font-size: 18px;
    color: #9ca3af;
    text-decoration: line-through;
}

.cod-savings {
    color: #10b981;
    background: white;
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
}

/* Form Wrapper */
.cod-form-wrapper {
    background: white;
    border-radius: 10px;
    padding: 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.cod-form-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f3f4f6;
}

.cod-form-title {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 6px 0;
}

.cod-form-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    font-weight: 500;
}

/* Form Layout - Stacked */
.cod-form-row {
    display: block;
    margin-bottom: 0;
}

.cod-form-group {
    width: 100%;
    margin-bottom: 18px;
}

/* Labels */
.cod-form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: #111827;
    font-weight: 700;
    font-size: 13px;
}

.cod-label-icon {
    font-size: 14px;
}

/* Input Fields - Professional Style */
.cod-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    transition: all 0.2s;
    background: #fafafa;
    direction: rtl;
    font-family: 'Cairo', sans-serif;
}

.cod-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.cod-input:hover {
    background: white;
    border-color: #9ca3af;
}

.cod-input:focus {
    outline: none;
    border-color: #10b981;
    background: white;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Quantity Section */
.cod-quantity-section {
    margin: 20px 0;
}

.cod-section-label {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 12px;
}

.cod-quantity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.cod-quantity-card {
    position: relative;
    cursor: pointer;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    padding: 16px 10px;
    text-align: center;
    transition: all 0.2s;
    background: #fafafa;
}

.cod-quantity-card:hover {
    border-color: #10b981;
    background: white;
}

.cod-quantity-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.cod-quantity-card.selected {
    border-color: #10b981;
    background: #ecfdf5;
}

.cod-card-content {
    position: relative;
}

.cod-quantity-card.cod-popular {
    border-color: #10b981;
}

.cod-popular-badge {
    position: absolute;
    top: -8px;
    right: 50%;
    transform: translateX(50%);
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

.cod-card-quantity {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.cod-card-price {
    font-size: 18px;
    font-weight: 800;
    color: #10b981;
    margin-bottom: 2px;
}

.cod-card-save {
    font-size: 10px;
    font-weight: 700;
    color: #059669;
}

/* Summary */
.cod-summary {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    border: 1px solid #e5e7eb;
}

.cod-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
}

.cod-summary-total {
    font-size: 24px;
    font-weight: 800;
    color: #10b981;
}

/* Submit Button */
.cod-submit-btn {
    width: 100%;
    padding: 16px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    font-family: 'Cairo', sans-serif;
}

.cod-submit-btn:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.cod-submit-btn:active {
    transform: scale(0.99);
}

.cod-submit-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
}

.cod-btn-icon {
    font-size: 18px;
}

/* Trust Badges */
.cod-trust-badges {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.cod-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
}

.cod-badge-icon {
    width: 28px;
    height: 28px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
}

/* Messages */
.cod-message {
    padding: 14px;
    border-radius: 8px;
    margin-top: 16px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
}

.cod-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1.5px solid #10b981;
}

.cod-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1.5px solid #ef4444;
}

/* Loading State */
.cod-loading {
    opacity: 0.6;
    pointer-events: none;
}

.cod-submit-btn.loading {
    background: #d1d5db;
}

.cod-submit-btn.loading .cod-btn-text::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .cod-checkout-container {
        margin: 20px 16px;
    }
    
    .cod-form-wrapper {
        padding: 24px 20px;
    }
    
    .cod-quantity-grid {
        grid-template-columns: 1fr;
    }
    
    .cod-quantity-card {
        padding: 14px;
    }
    
    .cod-trust-badges {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .cod-badge {
        flex: 0 0 45%;
        flex-direction: row;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .cod-checkout-container {
        margin: 16px 12px;
    }
    
    .cod-price-banner {
        padding: 16px;
    }
    
    .cod-current-price {
        font-size: 32px;
    }
    
    .cod-form-wrapper {
        padding: 20px 16px;
    }
    
    .cod-form-title {
        font-size: 20px;
    }
}
