/* Credit plugin styles */
.credit-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.credit-info h3 {
    color: #28a745;
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.credit-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
}

.credit-amount {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.credit-monthly {
    font-size: 16px;
    color: #28a745;
    font-weight: 600;
}

.credit-term {
    font-size: 14px;
    color: #666;
}

.credit-calculator {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.credit-calculator input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 5px;
}

.credit-calculator button {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}

.credit-calculator button:hover {
    background: #218838;
}

.credit-disabled {
    color: #666;
    font-style: italic;
}

/* Credit Calculator Modal Styles */
.credit-calculator-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200002 !important;
    display: none;
}

.credit-calculator-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.credit-calculator-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1179px;
    max-height: 90vh;
    background: #F5F5F5;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 4px;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
}

/* Main Content Container */
.credit-main-content {
    display: flex;
    gap: 8px;
}

.credit-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Left Column */
.credit-left-column {
    flex: 2;
}

/* Right Column */
.credit-right-column {
    flex: 0 0 569px;
    min-width: 300px;
}

/* Header */
.credit-calculator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.credit-calculator-title {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.credit-calculator-close {
    border: none !important;
    cursor: pointer;
    color: #000;
    transition: all 0.2s;
}

.credit-calculator-close:hover {
    transform: rotate(180deg);
}

.credit-block {
    display: flex;
    border-radius: 4px;
    background: #fff;
    gap: 8px;
    padding: 16px;
}

/* Product Information */
.credit-product-info {
    flex-wrap: wrap;
}

.credit-product-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.credit-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.credit-product-image .no-image {
    color: #9ca3af;
    font-size: 14px;
    text-align: center;
}

.credit-product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Warranty Section */
.popover-link img {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

/* Bank Options */
.bank-options-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 20px 0;
}

.bank-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bank-option {
    display: flex;
    gap: 8px;
    padding: 16px;
    border: 1px solid #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    flex-direction: column;
}

.bank-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bank-option:hover {
    border-color: #015780;
    cursor: pointer;
}

.bank-option.selected {
    border-color: #015780;
    background: #E6F7FF;
}

.bank-logo {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bank-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bank-info {
    flex: 1;
}

.bank-name {
    font-size: 16px;
    line-height: 26px;
    font-weight: 500;
    color: #111827;
}

.credit-text-muted {
    color: #818181;
    font-size: 15px;
    font-weight: 500;
}

.bank-description {
    font-size: 14px;
    color: #6b7280;
}

.bank-terms {
    font-size: 14px;
    color: #818181;
}

.bank-monthly {
    font-size: 16px;
    color: #000;
    font-weight: 500;
    line-height: 18px;
}

.bank-monthly-value {
    font-weight: 700;
}

/* Payment Periods */
.payment-period-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.period-btn {
    border: 1px solid #015780;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #015780;
    transition: all 0.2s;
    width: 54px;
    height: 32px;
    line-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.period-btn.active,
.period-btn:hover {
    background: #015780;
    color: #ffffff;
}

/* Contact Form */
.credit-contact-form {
    flex-direction: column;
}

.contact-form-title {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin-bottom: 8px;
}

.contact-form-fields {
    display: flex;
    gap: 8px;
    flex-direction: column;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important;
}

.form-input {
    padding: 7px 16px;
    border: 1px solid #c3c3c3;
    border-radius: 4px;
    font-size: 16px;
    line-height: 26px;
    color: #000;
    height: 40px;
}

.form-input:focus {
    outline: none;
    border-color: #015780;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Ccircle cx='12' cy='16' r='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
    padding-right: 44px;
}

/* Summary */
.summary-item {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    flex: 1;
}

.summary-label {
    color: #818181;
    font-size: 15px;
    font-weight: 500;
    line-height: 25.5px;
}

.summary-value {
    color: #000000;
    font-size: 18px;
    font-weight: 700;
    line-height: 18px;
}

.summary-monthly-value {
    font-size: 16px;
    font-weight: 500;
    line-height: 18px;
}

/* Action Buttons */
.credit-actions {
    display: flex;
}

.btn-secondary,
.btn-primary {
    flex: 1;
    padding: 0 24px;
    height: 50px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    position: relative;
}

.btn-secondary {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-primary {
    background: #015780;
    color: #ffffff;
}

.btn-primary:hover {
    background: #016893;
}

/* Disabled button state with loader */
.btn-primary:disabled {
    background: #015780;
    color: #ffffff;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.5;
    position: relative;
}

/* Loader image positioning */
.btn-primary:disabled img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 40px;
    width: auto;
}

/* Credit Button */
.credit-button-wrapper {
    margin: 16px 0;
}

.credit-button {
    background: #ffffff;
    border: 2px solid #3b82f6;
    color: #3b82f6;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.credit-button:hover {
    background: #3b82f6;
    color: #ffffff;
}

.credit-amount {
    font-weight: 700;
}

/* Disabled State */
.credit-disabled {
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
    color: #6b7280;
}

.credit-disabled p {
    margin: 0;
    font-size: 14px;
}

.credit-m-show {
    display: none;
}

.field-hidden {
    display: none !important;
}

.credit-service-error {
    display: none;
    color: #dc2626;
}

.credit-service-error-services {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .submit-application {
        width: 100%;
    }

    .credit-go-back {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
        color: #015780;
        font-size: 16px;
        line-height: 26px;
    }

    .credit-summary {
        flex-direction: column;
    }

    .summary-item {
        flex-direction: row;
        justify-content: space-between;
    }

    .summary-value {
        font-size: 16px;
    }

    .summary-monthly-value {
        font-size: 14px;
    }

    #summary-total {
        font-size: 20px;
    }

    .credit-m-hide {
        display: none;
    }

    .credit-m-show {
        display: block;
    }

    /* Ensure submit button is always accessible on mobile */
    .submit-application {
        position: relative;
        z-index: 10;
    }

    /* Make sure the button is always clickable */
    .submit-application {
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
        /* Improve touch response */
    }

    /* Ensure proper spacing for mobile navigation */
    .credit-summary {
        margin-bottom: 0;
    }

    .credit-calculator-title {
        font-size: 18px;
    }

    .credit-calculator-container {
        width: 100%;
        max-height: calc(100vh - 80px);
        top: 80px;
        transform: translate(-50%, 0);
        padding: 8px;
    }

    .credit-block {
        padding: 8px;
    }

    .credit-main-content {
        flex-wrap: wrap;
        padding: 0;
    }

    .credit-right-column {
        flex: 0 0 100%;
    }

    .credit-calculator-overlay {
        background: none;
    }

    .credit-left-column,
    .credit-right-column {
        min-width: auto;
    }

    /* Ensure the contact column goes below on mobile */
    .credit-left-column {
        order: 1;
    }

    .credit-right-column {
        order: 2;
    }

    .contact-form-fields {
        grid-template-columns: 1fr;
    }

    .form-group:nth-child(3),
    .form-group:nth-child(4),
    .form-group:nth-child(5) {
        grid-column: span 1;
    }

    .bank-option {
        display: flex;
        flex: wrap;
        gap: 8px;
    }

    .main-info__bottom-price-new {
        font-size: 16px;
    }

    .main-info__bottom-price-old {
        font-size: 14px;
    }

    .product-presentation__right_recomendations-title {
        font-size: 14px
    }

    .bank-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .bank-logo {
        order: 1;
    }

    .bank-info {
        order: 2;
        flex: 1;
    }

    .bank-monthly {
        order: 3;
        flex-basis: 100%;
    }
}
