/*  design fixing  */
.custom-chekout-desgn .checkout.woocommerce-checkout input[type='radio'] {
    height: auto;
}

.woocommerce-thankyou-order-received {
    font-size: 25px;
}

body .woocommerce-table--finance-details td {
    color: #000;
    font-weight: 600;
}

.woocommerce-js ul.order_details {
    padding-left: 0 !important;
}

body .woocommerce-order-finance-button {
    padding: 37px 20px;
}

/*  ./design fixing  */



/* ========================================
   JDEAL FINANCE CALCULATOR STYLES
======================================== */

/* Calculator Container */
.jdeal-calculator-widget {
    background: #FAF8F6;
    padding: 25px;
    border-radius: 10px;
    /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); */
    margin: 20px 0;
}

.i4f-calculator-logo {
    margin-bottom: 15px;
    max-width: 136px;
}

.i4f-calculator-logo img {
    box-shadow: none !important;
}

/* ========================================
   RATE BUTTONS (TOP BAR)
======================================== */

.jdeal-calculator-header {
    margin-bottom: 25px;
}

.jdeal-rate-buttons {
    display: flex !important;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    visibility: visible !important;
    opacity: 1 !important;
}

.jdeal-rate-button {
    display: inline-block !important;
    margin: 0 !important;
    cursor: pointer;
    position: relative;
    visibility: visible !important;
    opacity: 1 !important;
}

.jdeal-rate-button input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.jdeal-rate-label {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid #182649;
    border-radius: 30px;
    background: transparent;
    color: #182649;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
    user-select: none;
    line-height: 1.4;
}

.jdeal-rate-button:hover .jdeal-rate-label {
    /* transform: translateY(-2px); */
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.0);
    /* background: #f8fff9; */
}

.jdeal-rate-button input[type="radio"]:checked+.jdeal-rate-label {
    background: #182649;
    color: #fff;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.0);
}

.jdeal-rate-button input[type="radio"]:focus+.jdeal-rate-label {
    outline: 2px solid #182649;
    outline-offset: 2px;
}

/* Finance Type Display */
.jdeal-finance-type {
    font-size: 14px;
    color: #666;
    padding: 10px 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 10px;
}

.jdeal-finance-type span {
    font-weight: 500;
}

.jdeal-finance-type strong {
    color: #182649;
    margin-left: 5px;
}

/* ========================================
   INPUT FIELDS
======================================== */

.jdeal-calculator-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.jdeal-input-group {
    display: flex;
    flex-direction: column;
}

.jdeal-input-group label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.jdeal-input-group input[type="text"],
.jdeal-input-group select {
    width: 100%;
    padding: 9px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #000;
    background: transparent;
    transition: all 0.3s ease;
    font-family: inherit;
}

.jdeal-input-group input[type="text"]:focus,
.jdeal-input-group select:focus {
    outline: none;
    border-color: #182649;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.0);
}

.jdeal-input-group input[type="text"]:read-only {
    background: #f5f5f5;
    cursor: not-allowed;
}

.jdeal-input-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.jdeal-input-group select:hover {
    border-color: #182649;
}

/* ========================================
   RESULTS DISPLAY
======================================== */

.jdeal-calculator-results {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    /* box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); */
}

.jdeal-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.jdeal-result-item:last-child {
    border-bottom: none;
}

.jdeal-result-item span {
    font-size: 14px;
    color: #000;
    font-weight: 500;
}

.jdeal-result-item strong {
    font-size: 16px;
    color: #182649;
    font-weight: 700;
}

/* ========================================
   DISCLAIMER
======================================== */

.jdeal-calculator-disclaimer {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #ffc107;
    border-radius: 6px;
    padding: 20px;
    font-size: 13px;
    line-height: 1.8;
    color: #333;
}

.jdeal-calculator-disclaimer p {
    margin: 0;
}

.jdeal-calculator-disclaimer strong {
    color: #000;
    font-weight: 600;
}

.jdeal-company-name {
    color: #182649 !important;
    font-weight: 700 !important;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */

@media (max-width: 768px) {
    .jdeal-calculator-widget {
        padding: 20px 15px;
    }

    .jdeal-rate-buttons {
        gap: 8px;
    }

    .jdeal-rate-label {
        padding: 10px 16px;
        font-size: 13px;
    }

    .jdeal-calculator-inputs {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .jdeal-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .jdeal-result-item strong {
        font-size: 18px;
    }

    .jdeal-calculator-disclaimer {
        font-size: 12px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .jdeal-rate-buttons {
        flex-direction: column;
    }

    .jdeal-rate-button {
        width: 100%;
    }

    .jdeal-rate-label {
        display: block;
        text-align: center;
        width: 100%;
    }

    .i4f-calculator-logo {
        max-width: 100px;
    }
}

/* ========================================
   LOADING STATE
======================================== */

.jdeal-calculator-widget.loading {
    opacity: 0.6;
    pointer-events: none;
}

.jdeal-calculator-widget.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #182649;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ========================================
   PRINT STYLES
======================================== */

@media print {
    .jdeal-calculator-widget {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .jdeal-rate-button input[type="radio"]:checked+.jdeal-rate-label {
        background: #fff;
        border: 2px solid #000;
        color: #000;
    }
}

/* ========================================
   ACCESSIBILITY
======================================== */

.jdeal-rate-button:focus-within .jdeal-rate-label {
    outline: 2px solid #182649;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .jdeal-rate-label {
        border-width: 3px;
    }

    .jdeal-calculator-results {
        border: 2px solid #333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .jdeal-rate-label,
    .jdeal-rate-button {
        transition: none;
    }

    .jdeal-rate-button:hover .jdeal-rate-label {
        transform: none;
    }
}

/* ========================================
   WOOCOMMERCE CHECKOUT SPECIFIC
======================================== */

.woocommerce-checkout .jdeal-calculator-widget {
    margin-top: 0;
}

.payment_method_ideal4finance .jdeal-calculator-widget {
    background: transparent;
    padding: 15px 0;
}

.woocommerce-checkout .jdeal-input-group:first-child {
    grid-column-start: 1;
    grid-column-end: 3;
}
.woocommerce-checkout .jdeal-input-group #jdeal-price-input {
    font-size: 20px;
    color: #000;
}

.woocommerce-checkout .jdeal-input-group label {
    font-size: 16px;
    color: #000;
}
.woocommerce-checkout .i4f-calculator-logo {
    max-width: 106px;
}
.woocommerce-checkout .jdeal-finance-type {
    font-size: 16px;
}

.woocommerce-checkout  .jdeal-result-item span {
    font-size: 16px;
}
/* ========================================
   DARK MODE SUPPORT (OPTIONAL)
======================================== */

@media (prefers-color-scheme: dark) {
    .jdeal-calculator-widget {
        background: #2a2a2a;
        color: #e0e0e0;
    }

    .jdeal-rate-label {
        background: #3a3a3a;
        border-color: #182649;
        color: #182649;
    }

    .jdeal-rate-button input[type="radio"]:checked+.jdeal-rate-label {
        background: #182649;
        color: #fff;
    }

    .jdeal-calculator-results {
        background: #333;
    }

    .jdeal-input-group input,
    .jdeal-input-group select {
        background: #3a3a3a;
        border-color: #555;
        color: #e0e0e0;
    }

    .jdeal-calculator-disclaimer {
        background: #3a3000;
        border-color: #ffc107;
        color: #e0e0e0;
    }
}