/**
 * EC Devis - Front-office Styles
 */

/* ── Quotation button (header / nav) ── */
.ecdevis-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #232323;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    margin-bottom: 35px;
}
.ecdevis-nav-btn:hover {
    background-color: #f0f0f0;
    color: #000;
    text-decoration: none;
}
.ecdevis-nav-btn .ecdevis-icon {
    width: 18px;
    height: 18px;
}

/* ── Modal overlay ── */
.ecdevis-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.5);
}
.ecdevis-modal-overlay.active {
    display: block;
}

/* ── Simple form modal ── */
.ecdevis-modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 0;
}
.ecdevis-modal.active {
    display: block;
}
.ecdevis-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e5e5;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}
.ecdevis-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}
.ecdevis-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
}
.ecdevis-modal-close:hover {
    color: #000;
}
.ecdevis-modal-body {
    padding: 24px;
}
.ecdevis-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e5e5;
    text-align: right;
}

/* ── Form elements ── */
.ecdevis-form-group {
    margin-bottom: 16px;
}
.ecdevis-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    color: #333;
}
.ecdevis-form-group label .required {
    color: #dc3545;
}
.ecdevis-form-group input[type="text"],
.ecdevis-form-group input[type="email"],
.ecdevis-form-group input[type="tel"],
.ecdevis-form-group textarea,
.ecdevis-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.ecdevis-form-group input:focus,
.ecdevis-form-group textarea:focus,
.ecdevis-form-group select:focus {
    border-color: #2fb5d2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 181, 210, 0.15);
}
.ecdevis-form-group textarea {
    min-height: 80px;
    resize: vertical;
}
.ecdevis-form-group .form-error {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* ── Buttons ── */
.ecdevis-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
}
.ecdevis-btn:active {
    transform: scale(0.98);
}
.ecdevis-btn-primary {
    background-color: #2fb5d2;
    color: #fff;
}
.ecdevis-btn-primary:hover {
    background-color: #259ab3;
    color: #fff;
}
.ecdevis-btn-secondary {
    background-color: #6c757d;
    color: #fff;
}
.ecdevis-btn-secondary:hover {
    background-color: #565e64;
}
.ecdevis-btn-success {
    background-color: #28a745;
    color: #fff;
}
.ecdevis-btn-success:hover {
    background-color: #218838;
}
.ecdevis-btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}
.ecdevis-btn-block {
    display: flex;
    justify-content: center;
    width: 100%;
}
.ecdevis-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ── Cart footer (request quote button) ── */
.ecdevis-cart-footer {
    margin-top: 16px;
    padding: 16px;
    border: 1px dashed #2fb5d2;
    border-radius: 6px;
    background: #f0fbfd;
    text-align: center;
}
.ecdevis-cart-footer p {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: #333;
}

/* ── Quotation list (customer account) ── */
.ecdevis-list-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
.ecdevis-list-table th,
.ecdevis-list-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
    font-size: 0.875rem;
}
.ecdevis-list-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
.ecdevis-list-table tr:hover td {
    background: #f8f9fa;
}
.ecdevis-list-table .ecdevis-no-results {
    text-align: center;
    padding: 32px;
    color: #999;
    font-style: italic;
}

/* ── Status badges ── */
.ecdevis-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.ecdevis-status-pending    { background: #fff3cd; color: #856404; }
.ecdevis-status-validated  { background: #d4edda; color: #155724; }
.ecdevis-status-ordered    { background: #d1ecf1; color: #0c5460; }
.ecdevis-status-expired    { background: #e2e3e5; color: #383d41; }
.ecdevis-status-declined   { background: #f8d7da; color: #721c24; }

/* ── Quotation detail (showquotation) ── */
.ecdevis-detail {
    max-width: 900px;
    margin: 0 auto;
}
.ecdevis-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e5e5;
}
.ecdevis-detail-header h1 {
    margin: 0;
    font-size: 1.3rem;
}
.ecdevis-detail-header .ecdevis-detail-meta {
    text-align: right;
    color: #666;
    font-size: 0.85rem;
}
.ecdevis-detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.ecdevis-detail-message {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.5;
}
.ecdevis-detail-products {
    margin-bottom: 24px;
}
.ecdevis-detail-products table {
    width: 100%;
    border-collapse: collapse;
}
.ecdevis-detail-products th,
.ecdevis-detail-products td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-size: 0.875rem;
}
.ecdevis-detail-products th {
    background: #f8f9fa;
    font-weight: 600;
}
.ecdevis-detail-totals {
    margin-left: auto;
    width: 280px;
}
.ecdevis-detail-totals table {
    width: 100%;
}
.ecdevis-detail-totals td {
    padding: 6px 0;
    font-size: 0.9rem;
}
.ecdevis-detail-totals .total-row {
    font-weight: 700;
    font-size: 1.05rem;
    border-top: 2px solid #333;
    padding-top: 10px;
}

/* ── Frozen cart warning ── */
.ecdevis-frozen-alert {
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
}
.ecdevis-frozen-alert .ecdevis-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.ecdevis-frozen-alert a {
    font-weight: 600;
    color: #856404;
}

/* ── File upload area ── */
.ecdevis-upload-zone {
    border: 2px dashed #ccc;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    color: #999;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.ecdevis-upload-zone:hover,
.ecdevis-upload-zone.dragover {
    border-color: #2fb5d2;
    background: #f0fbfd;
}
.ecdevis-upload-zone input[type="file"] {
    display: none;
}

/* ── Alerts ── */
.ecdevis-alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.875rem;
}
.ecdevis-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.ecdevis-alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.ecdevis-alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ── Customer account link ── */
.ecdevis-account-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: #232323;
    text-decoration: none;
    border-bottom: 1px solid #e5e5e5;
    transition: background 0.15s;
}
.ecdevis-account-link:hover {
    background: #f8f9fa;
}
.ecdevis-account-link i {
    font-size: 1.1rem;
    color: #2fb5d2;
}

#ecdevisUnlockModal .modal-header {
    display: flex;
    align-items: center;
}

#ecdevisUnlockModal .modal-header .close {
    margin-left: auto;
}

body.ecdevis-cartlocked .cart-items .bootstrap-touchspin {
    position: relative;
}

body.ecdevis-cartlocked .cart-items .bootstrap-touchspin input,
body.ecdevis-cartlocked .cart-items .bootstrap-touchspin .btn-touchspin {
    pointer-events: none;
}

.ecdevis-block-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: not-allowed;
    background: transparent;
}

/* ── reCAPTCHA notice ── */
.ecdevis-recaptcha-notice {
    font-size: 0.75rem;
    color: #999;
    margin-top: 8px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .ecdevis-modal {
        width: 95%;
        max-height: 90vh;
    }
    .ecdevis-detail-header {
        flex-direction: column;
        gap: 10px;
    }
    .ecdevis-detail-header .ecdevis-detail-meta {
        text-align: left;
    }
    .ecdevis-detail-totals {
        width: 100%;
    }
    .ecdevis-list-table {
        font-size: 0.8rem;
    }
    .ecdevis-list-table th,
    .ecdevis-list-table td {
        padding: 8px 6px;
    }
}
