/* --- 0. Override Parent Wrapper Margins --- */
.wcc-exchange-shortcode-wrapper {
    margin: 0 !important;
    padding: 0 !important;
}

/* Override common WP/WC wrapper classes */
.entry-summary .wcc-exchange-box,
.woocommerce-product-details__short-description .wcc-exchange-box,
.woo-product-section .wcc-exchange-box {
    margin: 8px 0 !important;
}

/* --- 1. Exchange Form Container (Modern Design) --- */
.wcc-exchange-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    margin: 8px 0 !important;
}

.wcc-exchange-box h4 {
    color: #2d3748;
    font-size: 1.3em;
    font-weight: 700;
    margin: 0;
    padding: 12px 16px 4px;
    text-align: center;
}

.wcc-exchange-box > p {
    color: #666;
    font-size: 0.95em;
    margin: 0;
    padding: 0 16px 12px;
    text-align: center;
    line-height: 1.4;
}

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

/* --- 2. Form Container --- */
.wcc-exchange-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%; 
    box-sizing: border-box;
    padding: 0 16px 12px;
    align-items: center;
}

/* --- 3. Form Groups (Centered) --- */
.wcc-exchange-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    max-width: 500px;
}

.wcc-exchange-group label {
    font-weight: 600;
    font-size: 0.93em;
    color: #2d3748;
    text-align: center;
    display: block;
}

/* Input styling for exchange form fields */
.wcc-exchange-group input,
.wcc-exchange-group select {
    width: 100%;
    max-width: 100%;
    font-size: 0.95em;
    padding: 8px 12px;
    border: 1px solid #d9e2ef;
    border-radius: 6px;
    background: #fff;
    color: #2d3748;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.wcc-exchange-group input:focus,
.wcc-exchange-group select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.wcc-exchange-group input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #888;
}

/* --- 4. Exchange Form Numberplate Overrides --- */
/* Base styles now in wcc-core.css (.wcc-numberplate-frame, .wcc-kenteken-input) */
/* Only exchange-form specific overrides here */
.wcc-exchange-box .wcc-numberplate-frame {
}

.wcc-exchange-box .wcc-kenteken-section {
    padding: 0;
}

.wcc-exchange-box .wcc-kenteken-centered {
}

/* --- 5. Numberplate Input Specific ID Override --- */
/* Inherits from .wcc-kenteken-input in core, only specifics here */
#wcc_numberplate_input {
    text-align: center;
}

/* --- 6. RDW Status Message --- */
#wcc_rdw_status_message {
    font-size: 0.9em;
    margin-bottom: 10px;
    text-align: center;
    color: #0ea5e9;
}

/* --- 7. Car Details Section (Hidden by default) --- */
.wcc-car-details-section {
    display: none !important;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 500px;
    padding: 16px;
    background: #f8fbff;
    border: 1px solid #dbe7ff;
    border-radius: 10px;
    border-left: 4px solid #0ea5e9;
}

.wcc-car-details-section .wcc-exchange-group {
    gap: 3px;
}

.wcc-car-details-section label {
    font-size: 0.88em;
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 2px;
}

.wcc-car-details-section input {
    font-size: 0.93em;
    padding: 6px 10px;
    border: 1px solid #d9e2ef;
    border-radius: 6px;
    background: #fff;
    color: #2d3748;
}

.wcc-car-details-section input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #888;
}

/* --- 8. WhatsApp Field (Modern Blue) --- */
.wcc-whatsapp-field {
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
}

/* Email field - same width as WhatsApp for consistency */
#wcc_customer_email {
    max-width: 300px !important;
}

/* WhatsApp form group - centered container with left-aligned content */
.wcc-exchange-group:has(.wcc-whatsapp-field) {
    align-items: center;
}

.wcc-exchange-group:has(.wcc-whatsapp-field) label {
    text-align: center;
}

.wcc-phone-input-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid #d9e2ef;
    border-radius: 6px;
    background-color: #fff;
    transition: all 0.2s ease;
    height: 38px;
    box-sizing: border-box;
}

.wcc-phone-input-wrapper:focus-within {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.wcc-phone-icon {
    font-size: 1.1em;
    padding: 0 10px;
    color: #0ea5e9;
    border-right: 1px solid #eef2f7;
}

/* --- 9. The WhatsApp Input --- */
#wcc_whatsapp_input {
    flex: 1;
    border: none;
    outline: none;
    height: 100%;
    padding: 0 12px;
    font-size: 0.95em;
    color: #2d3748;
    font-family: Arial, sans-serif;
    background: transparent;
    text-align: left;
}

#wcc_whatsapp_input::placeholder {
    color: #999;
    text-align: left;
}

/* --- 10. Phone Validation Messages --- */
.wcc-phone-validation {
    margin-top: 8px;
    font-size: 0.85em;
    text-align: center;
}

.wcc-validation-success {
    color: #16a085;
    background-color: #d5f4e6;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
    border-left: 3px solid #16a085;
}

.wcc-validation-error {
    color: #e74c3c;
    background-color: #fdf2f2;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
    border-left: 3px solid #e74c3c;
}

/* --- 11. File Upload Area (Modern) --- */
.wcc-file-upload-area {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.wcc-upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px dashed #0ea5e9;
    border-radius: 6px;
    background-color: #f8fbff;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 6px;
}

.wcc-upload-button:hover {
    background-color: #eef2f7;
    border-color: #0284c7;
}

.wcc-upload-icon {
    font-size: 1.3em;
}

.wcc-upload-text {
    font-weight: 600;
    color: #0ea5e9;
    font-size: 0.95em;
}

.wcc-upload-info {
    margin-bottom: 8px;
}

.wcc-upload-info small {
    color: #666;
    font-size: 0.85em;
}

/* --- 12. File Preview Styles --- */
.wcc-file-preview {
    margin-top: 8px;
    max-width: 500px;
}

.wcc-preview-header {
    font-size: 0.8em;
    margin-bottom: 4px;
    color: #2d3748;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wcc-clear-files {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 600;
}

.wcc-clear-files:hover {
    background: #c82333;
}

.wcc-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin: 2px 0;
    background-color: #f0f9ff;
    border-radius: 6px;
    border-left: 3px solid #0ea5e9;
    font-size: 0.8em;
    text-align: left;
    word-break: break-word;
}

.wcc-file-item.error {
    background-color: #fdf2f2;
    color: #dc2626;
    border-left-color: #dc2626;
}

.wcc-remove-file {
    background: #6c757d;
    color: white;
    border: none;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.7em;
    cursor: pointer;
    margin-left: 4px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.wcc-remove-file:hover {
    background: #5a6268;
}

/* --- 13. Warning Messages --- */
.wcc-warning {
    color: #f59e0b;
    font-size: 0.75em;
    margin-top: 4px;
    padding: 4px 8px;
    background-color: #fffbeb;
    border-radius: 6px;
    border-left: 3px solid #f59e0b;
}

.wcc-add-more {
    margin-top: 4px;
    text-align: center;
}

.wcc-add-more-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 600;
}

.wcc-add-more-btn:hover {
    background: #218838;
}

/* --- 14. Message Styles (Success/Error) --- */
#wcc_exchange_message {
    margin-top: 8px;
    text-align: center;
}

.wcc-success {
    color: #16a085;
    background-color: #d5f4e6;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 4px solid #16a085;
    font-size: 0.9em;
    font-weight: 500;
}

.wcc-error {
    color: #e74c3c;
    background-color: #fdf2f2;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 4px solid #e74c3c;
    font-size: 0.9em;
    font-weight: 500;
}

/* --- 15. Submit Button (Modern Blue) --- */
#wcc_submit_exchange_request {
    box-sizing: border-box;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff;
    font-family: 'Arial', sans-serif;
    font-size: 0.95em;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    padding: 6px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    letter-spacing: 0.3px;
    min-width: 160px;
}

#wcc_submit_exchange_request:hover:not(:disabled) {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
    transform: translateY(-2px);
}

#wcc_submit_exchange_request:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

#wcc_submit_exchange_request:disabled {
    background: #bdbdbd;
    color: #eee;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

/* --- 16. Responsive Design --- */
@media (max-width: 768px) {
    .wcc-exchange-form {
        padding: 0 12px 8px;
        gap: 4px;
    }

    .wcc-exchange-group {
        max-width: 100%;
        margin-bottom: 1px;
    }

    .wcc-car-details-section {
        max-width: 100%;
        gap: 6px;
    }

    .wcc-whatsapp-field {
        max-width: 100%;
    }

    .wcc-file-upload-area {
        max-width: 100%;
    }

    #wcc_submit_exchange_request {
        width: 100%;
        min-width: auto;
        padding: 6px 16px;
    }

    .wcc-exchange-box h4 {
        font-size: 1.1em;
        padding: 10px 12px 3px;
    }

    .wcc-exchange-box > p {
        padding: 0 12px 8px;
        font-size: 0.9em;
    }

    .wcc-numberplate-frame {
        width: 160px;
        height: 40px;
    }

    #wcc_numberplate_input {
        font-size: 1.1em;
    }
}

/* --- 17. GDPR Consent Checkbox Styles --- */
.wcc-gdpr-consent-group {
    margin: 2px 0;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    max-width: 500px;
    width: 100%;
}

.wcc-gdpr-consent {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    cursor: pointer;
    font-size: 10px;
    line-height: 1.3;
    text-align: left;
}

.wcc-gdpr-consent input[type="checkbox"] {
    margin-top: 2px;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #4CAF50;
}

.wcc-consent-text {
    color: #666;
    font-size: 10px;
}

.wcc-consent-text a {
    color: #4CAF50;
    text-decoration: underline;
}

.wcc-consent-text a:hover {
    color: #388e3c;
}

.wcc-gdpr-consent input[type="checkbox"]:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}