/**
 * Frontend CSS for Cobofam Easy Retour
 */

.cer-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.cer-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 24px;
    color: #333;
}

.cer-container p {
    margin-bottom: 20px;
    color: #666;
}

/* Step 1 */
.cer-field {
    margin-bottom: 20px;
}

.cer-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.cer-field input[type="text"],
.cer-field input[type="email"],
.cer-field input[type="number"],
.cer-field select,
.cer-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.cer-field input:focus,
.cer-field select:focus,
.cer-field textarea:focus {
    outline: none;
    border-color: #0073aa;
}

.cer-checkbox label {
    display: flex;
    align-items: center;
    font-weight: normal;
}

.cer-checkbox input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

.cer-checkbox a {
    color: #0073aa;
    text-decoration: underline;
}

/* Buttons */
.cer-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cer-btn-primary {
    background-color: #0073aa;
    color: #fff;
}

.cer-btn-primary:hover {
    background-color: #005a87;
}

.cer-actions {
    margin-top: 20px;
}

.cer-photo-section {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.cer-photo-section h4 {
    margin-top: 0;
}

.cer-photo-hint {
    margin-bottom: 20px;
    color: #666;
}

.cer-photo-field {
    margin-bottom: 20px;
}

.cer-photo-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.cer-photo-field input[type="file"] {
    width: 100%;
}

.cer-photo-field small {
    display: block;
    margin-top: 6px;
    color: #777;
}

.cer-photo-required-indicator {
    color: #d63638;
    display: none;
    margin-left: 4px;
}

.cer-photo-field.is-required .cer-photo-required-indicator {
    display: inline;
}

/* Error messages */
.cer-error {
    padding: 12px;
    margin-bottom: 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
}

/* Loading */
.cer-loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

/* Step 2 - Items table */
.cer-items-table {
    overflow-x: auto;
    margin-bottom: 20px;
}

.cer-items-table table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
}

.cer-items-table th {
    background-color: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.cer-items-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}

.cer-items-table tr:last-child td {
    border-bottom: none;
}

.cer-product {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cer-product img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.cer-product strong {
    display: block;
    margin-bottom: 4px;
}

.cer-product small {
    color: #666;
}

.cer-qty-input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.cer-reason-select,
.cer-reason-text {
    width: 100%;
    max-width: 250px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cer-reason-text {
    margin-top: 8px;
}

.cer-select-all {
    padding: 8px 16px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.cer-select-all:hover {
    background-color: #e9e9e9;
}

/* Calculation */
.cer-calculation {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-top: 30px;
}

.cer-calculation h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.cer-calc-table {
    width: 100%;
    max-width: 500px;
}

.cer-calc-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.cer-calc-table tr:last-child {
    border-bottom: none;
}

.cer-calc-table td {
    padding: 10px 0;
}

.cer-calc-table td:last-child {
    text-align: right;
    font-weight: 600;
}

.cer-calc-return-fee-row.is-waived td:last-child {
    color: #2c662d;
}

.cer-calc-shipping-refund-row {
    color: #2c662d;
}

.cer-calc-total-row td {
    padding-top: 15px;
    font-size: 18px;
}

.cer-info-text {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Submit section */
.cer-submit-section {
    margin-top: 30px;
}

.cer-submit-btn {
    padding: 14px 32px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cer-submit-btn:hover {
    background-color: #005a87;
}

/* Success message */
.cer-success {
    text-align: center;
    padding: 40px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}

.cer-success h3 {
    color: #155724;
    margin-bottom: 15px;
}

.cer-success-message {
    color: #155724;
    font-size: 16px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .cer-container {
        padding: 15px;
    }
    
    .cer-items-table table {
        font-size: 14px;
    }
    
    .cer-items-table th,
    .cer-items-table td {
        padding: 8px;
    }
    
    .cer-product {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cer-product img {
        width: 80px;
        height: 80px;
    }
    
    .cer-reason-select,
    .cer-reason-text {
        max-width: 100%;
    }
    
    .cer-calc-table {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cer-items-table {
        overflow-x: scroll;
    }
    
    .cer-items-table table {
        min-width: 600px;
    }
    
    .cer-btn,
    .cer-submit-btn {
        width: 100%;
    }
}

/* Accessibility */
.cer-field input:focus,
.cer-field select:focus,
.cer-field textarea:focus {
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

.cer-btn:focus,
.cer-submit-btn:focus,
.cer-select-all:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Tooltip icon */
.cer-calculation a {
    text-decoration: none;
    color: #0073aa;
    font-size: 16px;
    margin-left: 5px;
}

.cer-calculation a:hover {
    color: #005a87;
}

