/**
 * Kronixon OPC — Leasing Badges (Product Page)
 * Colors: TBI=#f57c00 (orange), DSK=#1a6b37 (green), Unicredit=#c8102e (red)
 */

/* ── Container ── */
.kronixon-leasing-badges {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 6px;
    width: 100%;
}

/* ── Badge (shared) ── */
.kronixon-leasing-badge {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.leasing-badge-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.leasing-badge-brand {
    flex-shrink: 0;
    display: inline-block;
    min-width: 100px;
    text-align: center;
    padding: 3px 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    box-sizing: border-box;
}

.leasing-badge-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 14px;
    color: #333;
}

.leasing-badge-line1 {
    display: block;
    line-height: 1.3;
}

.leasing-badge-label {
    color: #111;
    font-weight: 700;
    font-size: 14px;
}

.leasing-badge-line2 {
    display: block;
    font-size: 13px;
    color: #555;
    line-height: 1.3;
}

.leasing-badge-sep {
    margin: 0 3px;
    color: #aaa;
}

.leasing-badge-bgn {
    color: #888;
    font-size: 13px;
}

.leasing-badge-link {
    flex-shrink: 0;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.2s;
}

.leasing-badge-link:hover {
    text-decoration: underline;
}

/* ── TBI (orange) ── */
.leasing-badge-tbi { background: #fff8f0; border-color: #f5d5a8; }
.leasing-badge-tbi:hover { border-color: #f57c00; }
.leasing-brand-tbi { background: #f57c00; }
.leasing-accent-tbi { color: #e65100; }
.leasing-link-tbi { color: #f57c00; }
.leasing-link-tbi:hover { color: #e65100; }

/* ── DSK (green) ── */
.leasing-badge-dsk { background: #f7fbf7; border-color: #d0e0d0; }
.leasing-badge-dsk:hover { border-color: #1a6b37; }
.leasing-brand-dsk { background: #1a6b37; }
.leasing-accent-dsk { color: #1a6b37; }
.leasing-link-dsk { color: #1a6b37; }
.leasing-link-dsk:hover { color: #145028; }

/* ── Unicredit (red) ── */
.leasing-badge-unicredit { background: #fef8f8; border-color: #f0c8c8; }
.leasing-badge-unicredit:hover { border-color: #c8102e; }
.leasing-brand-unicredit { background: #c8102e; }
.leasing-accent-unicredit { color: #c8102e; }
.leasing-link-unicredit { color: #c8102e; }
.leasing-link-unicredit:hover { color: #a00d24; }

/* ── Modal Overlay ── */
.kronixon-leasing-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* ── Modal ── */
.kronixon-leasing-modal {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    font-family: inherit;
    animation: leasingModalIn 0.2s ease-out;
}

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

.leasing-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

/* Modal header colors per provider */
.leasing-modal-header.modal-header-tbi { background: linear-gradient(135deg, #f57c00, #ff9800); }
.leasing-modal-header.modal-header-dsk { background: linear-gradient(135deg, #1a6b37, #218838); }
.leasing-modal-header.modal-header-unicredit { background: linear-gradient(135deg, #c8102e, #e01e37); }

.leasing-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.leasing-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.leasing-modal-close:hover { opacity: 1; }

.leasing-modal-body { padding: 18px; }

/* Loading */
.leasing-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 0;
    color: #666;
    font-size: 14px;
}

.leasing-spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid #e0e0e0;
    border-top-color: #1a6b37;
    border-radius: 50%;
    animation: leasingSpin 0.6s linear infinite;
}

/* Spinner accent colors */
.leasing-spinner.spinner-tbi { border-top-color: #f57c00; }
.leasing-spinner.spinner-dsk { border-top-color: #1a6b37; }
.leasing-spinner.spinner-unicredit { border-top-color: #c8102e; }

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

/* Price row */
.leasing-modal-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #333;
}

.leasing-modal-price-row strong { font-size: 16px; }

/* Result accent colors per provider */
.leasing-modal-result.result-tbi .leasing-modal-result-main strong { color: #e65100; }
.leasing-modal-result.result-dsk .leasing-modal-result-main strong { color: #1a6b37; }
.leasing-modal-result.result-unicredit .leasing-modal-result-main strong { color: #c8102e; }

.leasing-modal-result.result-tbi { background: #fff8f0; border-color: #f5d5a8; }
.leasing-modal-result.result-dsk { background: #f5faf5; border-color: #d0e8d0; }
.leasing-modal-result.result-unicredit { background: #fef5f5; border-color: #f0c0c0; }

/* Fields */
.leasing-modal-field { margin-bottom: 14px; }

.leasing-modal-field label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
    font-weight: 600;
}

.leasing-modal-field select,
.leasing-modal-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.leasing-modal-field select:focus,
.leasing-modal-field input:focus { outline: none; border-color: #555; }

.leasing-modal-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.leasing-modal-input-group input {
    width: 110px;
    flex-shrink: 0;
    text-align: right;
}

.leasing-modal-input-suffix { font-size: 14px; color: #666; flex-shrink: 0; }
.leasing-modal-initial-hint { font-size: 12px; color: #888; white-space: nowrap; }

/* Results */
.leasing-modal-result {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 14px;
    margin-top: 4px;
}

.leasing-modal-result-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    color: #333;
}

.leasing-modal-result-main strong { font-size: 18px; }

.leasing-modal-result-bgn {
    display: flex;
    justify-content: flex-end;
    font-size: 13px;
    color: #888;
    margin-top: 2px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ddd;
    margin-bottom: 10px;
}

.leasing-modal-result-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.leasing-modal-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #555;
}

/* Disclaimer */
.leasing-modal-disclaimer {
    margin-top: 14px;
    padding: 10px 12px;
    background: #f0f7ff;
    border-radius: 5px;
    font-size: 12px;
    color: #4a6785;
    line-height: 1.4;
}

/* Error */
.leasing-modal-error {
    padding: 12px 14px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    color: #856404;
    font-size: 13px;
}

/* ── Mobile ── */
@media (max-width: 767px) {
    .kronixon-leasing-badges { gap: 4px; margin: 8px 0 4px; }
    .kronixon-leasing-badge { padding: 8px 12px; }

    .leasing-badge-row { flex-wrap: wrap; gap: 6px; }
    .leasing-badge-brand { font-size: 12px; padding: 2px 8px; min-width: 85px; }
    .leasing-badge-text { flex: 1 1 auto; }
    .leasing-badge-label { font-size: 13px; }
    .leasing-badge-line2 { font-size: 12px; }
    .leasing-badge-link {
        width: 100%;
        text-align: right;
        margin-top: 2px;
        font-size: 13px;
    }

    .kronixon-leasing-modal-overlay { align-items: flex-end; padding: 0; }
    .kronixon-leasing-modal {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        max-height: 85vh;
        overflow-y: auto;
    }
    .leasing-modal-header { padding: 12px 16px; font-size: 14px; }
    .leasing-modal-body { padding: 14px; }
    .leasing-modal-input-group { flex-wrap: wrap; }
    .leasing-modal-input-group input { width: 100%; }
}
