/**
 * Quote Form Styles
 * 
 * Modal and form styling with responsive design
 * 
 * @package Custom_Product_Options
 */

/* ===================================
   Modal Styles
   =================================== */

.cpo-quote-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cpo-quote-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.cpo-quote-modal-content {
    position: relative;
    background-color: #ffffff;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    z-index: 1;
}

.cpo-quote-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    color: #333;
    transition: all 0.2s ease;
    z-index: 10;
}

.cpo-quote-modal-close:hover {
    background-color: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.cpo-quote-modal-header {
    padding: 30px 40px;
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    color: #ffffff;
    border-radius: 12px 12px 0 0;
}

.cpo-quote-modal-header h2 {
    margin: 0 0 8px 0;
    font-size: 26px;
    font-weight: 600;
    color: #ffffff;
}

.cpo-quote-subtitle {
    margin: 0;
    font-size: 15px;
    color: #e5e7eb;
    font-weight: 400;
}

.cpo-quote-modal-body {
    padding: 30px 40px 40px;
}

/* ===================================
   Quote Summary (WooCommerce Style)
   =================================== */

.cpo-quote-summary {
    background: #ffffff;
    border-radius: 0;
    padding: 0;
    margin-bottom: 30px;
    border: 1px solid #ddd;
}

.cpo-quote-summary h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    padding: 20px;
    background: #f8f8f8;
    border-bottom: 1px solid #ddd;
}

.cpo-quote-summary-content {
    padding: 20px;
}

.cpo-quote-summary-content .cpo-loading {
    color: #999;
    font-style: italic;
}

.cpo-order-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cpo-order-item:first-child {
    padding-top: 0;
}

.cpo-order-product {
    flex: 1;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

.cpo-order-product strong {
    font-size: 15px;
    color: #000;
}

.cpo-order-price {
    font-size: 15px;
    font-weight: 600;
    color: #000;
    white-space: nowrap;
    margin-left: 20px;
}

.cpo-order-price-add {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    margin-left: 20px;
}

.cpo-order-option-group {
    margin: 15px 0;
}

.cpo-option-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

.cpo-bullet {
    color: #2c6ecf;
    font-size: 10px;
    margin-right: 8px;
    display: inline-block;
}

.cpo-order-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 0 0;
    margin-top: 15px;
    border-top: 2px solid #ddd;
}

.cpo-subtotal-label {
    font-size: 16px;
    font-weight: 600;
    color: #000;
}

.cpo-subtotal-price {
    font-size: 18px;
    font-weight: 700;
    color: #000;
}

/* ===================================
   Form Styles
   =================================== */

.cpo-quote-form {
    margin: 0;
}

.cpo-form-section {
    margin-bottom: 25px;
}

.cpo-form-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e6ed;
}

.cpo-form-row {
    margin-bottom: 20px;
}

.cpo-form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.cpo-form-field {
    position: relative;
}

.cpo-form-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.cpo-form-field .required {
    color: #e74c3c;
    margin-left: 3px;
}

.cpo-form-field .optional {
    font-weight: 400;
    color: #999;
    font-size: 13px;
}

.cpo-form-field input[type="text"],
.cpo-form-field input[type="email"],
.cpo-form-field input[type="tel"],
.cpo-form-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e6ed;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.cpo-form-field input:focus,
.cpo-form-field textarea:focus {
    outline: none;
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.cpo-form-field input.error,
.cpo-form-field textarea.error {
    border-color: #e74c3c;
}

.cpo-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===================================
   GDPR Section
   =================================== */

.cpo-gdpr-section {
    background: #f7f9fc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
}

.cpo-checkbox-field {
    margin-bottom: 15px;
}

.cpo-checkbox-field:last-child {
    margin-bottom: 0;
}

.cpo-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.cpo-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 4px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.cpo-checkbox-label a {
    color: #0073aa;
    text-decoration: underline;
}

.cpo-checkbox-label a:hover {
    color: #005177;
}

.cpo-checkbox-field.error {
    background: #fff5f5;
    border: 1px solid #e74c3c;
    padding: 10px;
    border-radius: 6px;
}

/* ===================================
   Response Info Box
   =================================== */

.cpo-response-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f3f4f6;
    border-left: 4px solid #111827;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

.cpo-response-info svg {
    flex-shrink: 0;
    color: #111827;
    margin-top: 2px;
}

.cpo-response-info p {
    margin: 0;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

/* ===================================
   Form Messages
   =================================== */

.cpo-form-messages {
    margin: 20px 0;
}

.cpo-form-message {
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
}

.cpo-form-message.success {
    background: #f3f4f6;
    border-left: 4px solid #111827;
    color: #374151;
}

.cpo-form-message.error {
    background: #fff5f5;
    border-left: 4px solid #e74c3c;
    color: #c0392b;
}

/* ===================================
   Submit Button
   =================================== */

.cpo-form-actions {
    margin-top: 25px;
    text-align: center;
}

.cpo-quote-submit-btn {
    width: 100%;
    padding: 16px 30px;
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.12);
}

.cpo-quote-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(17, 24, 39, 0.14);
}

.cpo-quote-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

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

.cpo-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ===================================
   Quote Button on Options Page
   =================================== */

.cpo-request-quote-btn {
    display: inline-block;
    padding: 14px 28px;
    background-color: transparent;
    color: #111827;
    border: 2px solid #111827;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.cpo-request-quote-btn:hover {
    background-color: #111827;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.12);
}

.cpo-buttons-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.cpo-buttons-wrapper .button,
.cpo-buttons-wrapper .cpo-request-quote-btn {
    width: 100%;
}

.cpo-button-separator {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin: 0;
}

/* ===================================
   Animations
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
    .cpo-quote-modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .cpo-quote-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
    }
    
    .cpo-quote-modal-header {
        padding: 25px 20px;
    }
    
    .cpo-quote-modal-header h2 {
        font-size: 22px;
    }
    
    .cpo-quote-modal-body {
        padding: 20px;
    }
    
    .cpo-form-row-half {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cpo-quote-summary {
        padding: 15px;
    }
    
    .cpo-summary-total-price {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .cpo-quote-modal-header h2 {
        font-size: 20px;
    }
    
    .cpo-quote-subtitle {
        font-size: 14px;
    }
    
    .cpo-summary-item,
    .cpo-summary-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .cpo-summary-price {
        font-size: 14px;
    }
}


/* v7: neutrale offerte-modal zonder groene accenten. */
.cpo-quote-modal,
.cpo-quote-modal * {
    box-sizing: border-box;
}

.cpo-quote-modal .cpo-quote-header,
.cpo-quote-modal .quote-header,
.cpo-quote-modal .modal-header {
    background: #111827 !important;
}

.cpo-quote-modal button[type="submit"],
.cpo-quote-modal .cpo-submit-quote,
.cpo-quote-modal .submit-quote,
.cpo-quote-modal .quote-submit-btn {
    background: #111827 !important;
    border-color: #111827 !important;
    color: #ffffff !important;
}

.cpo-quote-modal input:focus,
.cpo-quote-modal textarea:focus,
.cpo-quote-modal select:focus {
    border-color: #6b7280 !important;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, .08) !important;
}

.cpo-quote-modal a,
.cpo-quote-modal .price,
.cpo-quote-modal .highlight,
.cpo-quote-modal .selected-options-total {
    color: #111827 !important;
}
