:root {
    --color-yellow: #ffea00;
    --color-yellow-light: #fff8cc;
    --color-yellow-dark: #e6d300;
    --color-success: #10b981;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    --color-black: #000000;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 4px;
    --radius: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

.credit-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--color-yellow);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    user-select: none;
    border: none;
    font-family: inherit;
}

.credit-trigger:hover {
    background: var(--color-yellow-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.credit-trigger__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-black);
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.credit-trigger__icon .svg-icon {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.credit-trigger__text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-black);
    white-space: nowrap;
}

.credit-trigger__text span {
    font-weight: 500;
}

.credit-trigger__text strong {
    font-weight: 700;
    font-size: 15px;
}

.credit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.credit-modal.is-open {
    display: block;
}

.credit-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

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

.credit-modal__container {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 1200px;
    height: 100%;
    background: white;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    overflow: hidden;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.credit-sidebar {
    width: 360px;
    flex-shrink: 0;
    background: var(--color-gray-50);
    border-right: 1px solid var(--color-gray-200);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.credit-sidebar__header {
    padding: 24px;
    background: white;
    border-bottom: 1px solid var(--color-gray-200);
}

.credit-sidebar__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.credit-sidebar__product {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-gray-800);
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.credit-sidebar__price {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-gray-900);
}

.credit-sidebar__nav {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.credit-sidebar__nav-title {
    padding: 16px 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--color-gray-100);
    border-bottom: 1px solid var(--color-gray-200);
}

.credit-sidebar__list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.credit-sidebar__item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    width: 100%;
    background: transparent;
    border: none;
    border-left: 4px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
}

.credit-sidebar__item:hover {
    background: var(--color-gray-100);
}

.credit-sidebar__item.is-active {
    background: white;
    border-left-color: var(--color-yellow);
    box-shadow: inset 0 1px 0 var(--color-gray-200), 
                inset 0 -1px 0 var(--color-gray-200);
}

.credit-sidebar__logo {
    width: 48px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.credit-sidebar__logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.credit-sidebar__info {
    flex: 1;
    min-width: 0;
}

.credit-sidebar__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-gray-800);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.credit-sidebar__details {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.credit-sidebar__payment {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-gray-900);
}

.credit-sidebar__term {
    font-size: 13px;
    color: var(--color-gray-500);
}

.credit-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.credit-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 32px;
    background: white;
    border-bottom: 1px solid var(--color-gray-200);
    flex-shrink: 0;
}

.credit-header__main {
    flex: 1;
    min-width: 0;
}

.credit-header__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-gray-900);
    margin-bottom: 12px;
    line-height: 1.2;
}

.credit-header__payment {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.credit-header__label {
    font-size: 14px;
    color: var(--color-gray-600);
}

.credit-header__amount {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-gray-900);
    line-height: 1;
}

.credit-close {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gray-100);
    border: none;
    border-radius: var(--radius);
    color: var(--color-gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 16px;
}

.credit-close:hover {
    background: var(--color-gray-200);
    color: var(--color-gray-800);
}

.credit-mobile-nav {
    display: none;
    padding: 16px 0;
    background: white;
    border-bottom: 1px solid var(--color-gray-200);
    flex-shrink: 0;
    position: relative;
}

.credit-mobile-nav__scroll {
    display: flex;
    gap: 12px;
    padding: 0 24px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.credit-mobile-nav__scroll:active {
    cursor: grabbing;
}

.credit-mobile-nav__scroll::-webkit-scrollbar {
    display: none;
}

.credit-mobile-nav__item {
    flex-shrink: 0;
    width: 280px;
    padding: 20px;
    background: var(--color-gray-50);
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 16px;
}

.credit-mobile-nav__item:hover {
    border-color: var(--color-yellow);
    background: white;
}

.credit-mobile-nav__item.is-active {
    border-color: var(--color-yellow);
    background: white;
    box-shadow: var(--shadow-md);
}

.credit-mobile-nav__logo {
    width: 48px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.credit-mobile-nav__logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.credit-mobile-nav__info {
    flex: 1;
    min-width: 0;
}

.credit-mobile-nav__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-gray-800);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.credit-mobile-nav__payment {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-gray-900);
}

.credit-tabs {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.credit-tab {
    display: none;
    padding-bottom: 40px;
}

.credit-tab.is-active {
    display: block;
}

.credit-section {
    padding: 24px 32px;
}

.credit-section--gray {
    background: var(--color-gray-50);
    border-top: 1px solid var(--color-gray-200);
    border-bottom: 1px solid var(--color-gray-200);
}

.credit-section--detail {
    padding-top: 16px;
    padding-bottom: 16px;
    background: var(--color-gray-50);
    border-top: 1px solid var(--color-gray-200);
}

.credit-section__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-gray-900);
    margin-bottom: 20px;
}

.credit-terms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.credit-term {
    padding: 24px 16px;
    background: white;
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    display: block;
    width: 100%;
}

.credit-term:hover {
    border-color: var(--color-yellow);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.credit-term.is-selected {
    border-color: var(--color-yellow);
    background: var(--color-yellow-light);
    transform: none;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.credit-term__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--color-success);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
}

.credit-term__duration {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-gray-900);
    margin-bottom: 8px;
}

.credit-term__rate {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-gray-600);
    margin-bottom: 12px;
}

.credit-term__payment {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-gray-900);
    margin-bottom: 4px;
    line-height: 1;
}

.credit-term__period {
    font-size: 12px;
    color: var(--color-gray-500);
}

.credit-all-terms {
    margin-top: 20px;
    border-top: 1px solid var(--color-gray-200);
    padding-top: 20px;
}

.credit-all-terms__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: var(--color-gray-100);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
}

.credit-all-terms__toggle:hover {
    background: var(--color-gray-200);
    border-color: var(--color-gray-400);
}

.credit-all-terms__toggle svg {
    transition: transform 0.3s ease;
}

.credit-all-terms__toggle.is-open svg {
    transform: rotate(180deg);
}

.credit-all-terms__dropdown {
    margin-top: 16px;
    animation: fadeIn 0.3s ease;
}

.credit-all-terms__list {
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius);
    padding: 8px;
}

.credit-all-terms__list::-webkit-scrollbar {
    width: 6px;
}

.credit-all-terms__list::-webkit-scrollbar-track {
    background: var(--color-gray-100);
    border-radius: 3px;
}

.credit-all-terms__list::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: 3px;
}

.credit-all-terms__list::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
}

.credit-all-terms__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-gray-100);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-size: 14px;
    color: var(--color-gray-700);
}

.credit-all-terms__item:last-child {
    border-bottom: none;
}

.credit-all-terms__item:hover {
    background: var(--color-gray-50);
}

.credit-all-terms__item.is-selected {
    background: var(--color-yellow-light);
    font-weight: 600;
    color: var(--color-gray-900);
}

.credit-all-terms__term {
    flex: 1;
}

.credit-all-terms__payment {
    flex: 1;
    text-align: right;
    font-weight: 600;
    color: var(--color-gray-900);
    margin: 0 12px;
}

.credit-all-terms__badge {
    background: var(--color-success);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}

.credit-downpayment {
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.credit-downpayment__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 15px;
    color: var(--color-gray-700);
}

.credit-downpayment__value {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-gray-900);
    text-align: right;
}

.credit-downpayment__slider {
    margin-bottom: 32px;
}

.credit-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--color-gray-300) 0%, var(--color-gray-300) 0%);
    border-radius: 3px;
    outline: none;
}

.credit-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: white;
    border: 2px solid var(--color-gray-400);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.credit-slider::-webkit-slider-thumb:hover {
    border-color: var(--color-gray-600);
    transform: scale(1.1);
}

.credit-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: white;
    border: 2px solid var(--color-gray-400);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.credit-downpayment__quick {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.credit-downpayment__quick-btn {
    padding: 14px;
    background: white;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
}

.credit-downpayment__quick-btn:hover {
    border-color: var(--color-gray-400);
    background: var(--color-gray-50);
}

.credit-downpayment__quick-btn.is-active {
    background: var(--color-yellow);
    border-color: var(--color-yellow-dark);
    color: var(--color-black);
    font-weight: 700;
}

.credit-info {
    list-style: none;
    margin-bottom: 32px;
}

.credit-info li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-gray-700);
}

.credit-info li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-yellow);
    font-size: 20px;
}

.credit-detail {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-gray-700);
    max-height: 200px;
    overflow-y: auto;
    padding: 16px;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--color-gray-200);
}

.credit-detail::-webkit-scrollbar {
    width: 6px;
}

.credit-detail::-webkit-scrollbar-track {
    background: var(--color-gray-100);
    border-radius: 3px;
}

.credit-detail::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: 3px;
}

.credit-detail::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
}

.credit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 32px;
    background: var(--color-yellow);
    color: var(--color-black);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    width: 100%;
}

.credit-button:hover {
    background: var(--color-yellow-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.credit-badge {
    background: var(--color-success);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.credit-badge--small {
    font-size: 11px;
    padding: 3px 8px;
}

@media (max-width: 1024px) {
    .credit-modal__container {
        max-width: 100%;
    }
    
    .credit-sidebar {
        width: 320px;
    }
    
    .credit-header {
        padding: 20px 24px;
    }
    
    .credit-header__title {
        font-size: 22px;
    }
    
    .credit-header__amount {
        font-size: 28px;
    }
    
    .credit-section {
        padding: 20px 24px;
    }
    
    .credit-terms {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .credit-modal__container {
        flex-direction: column;
        animation: slideInBottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    @keyframes slideInBottom {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    
    .credit-sidebar {
        display: none;
    }
    
    .credit-header {
        padding: 16px 20px;
    }
    
    .credit-header__title {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .credit-header__amount {
        font-size: 24px;
    }
    
    .credit-close {
        width: 40px;
        height: 40px;
        margin-left: 12px;
    }
    
    .credit-mobile-nav {
        display: block;
    }
    
    .credit-section {
        padding: 20px;
    }
    
    .credit-section__title {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .credit-terms {
        display: flex;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 10px;
        margin: 0 -20px;
        padding: 0 20px 20px 20px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        grid-template-columns: none;
    }
    
    .credit-terms::-webkit-scrollbar {
        display: none;
    }
    
    .credit-term {
        flex: 0 0 auto;
        width: 180px;
        min-width: 180px;
    }
    
    .credit-term.is-selected {
        transform: none;
        box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    }
    
    .credit-terms::after {
        content: '';
        flex: 0 0 20px;
    }
    
    .credit-all-terms {
        display: none;
    }
    
    .credit-downpayment {
        padding: 20px;
    }
    
    .credit-downpayment__quick {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .credit-downpayment__quick-btn {
        padding: 12px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .credit-info li {
        font-size: 14px;
        padding-left: 20px;
    }
    
    .credit-detail {
        font-size: 13px;
        max-height: 150px;
        padding: 12px;
    }
    
    .credit-button {
        padding: 16px 24px;
        font-size: 15px;
    }
    
    .credit-mobile-nav__item {
        width: 260px;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .credit-trigger {
        padding: 8px 14px;
        gap: 8px;
    }
    
    .credit-trigger__icon {
        width: 16px;
        height: 16px;
    }
    
    .credit-trigger__text {
        font-size: 13px;
        gap: 6px;
    }
    
    .credit-trigger__text strong {
        font-size: 14px;
    }
    
    .credit-term {
        width: 160px;
        min-width: 160px;
        padding: 16px 12px;
    }
    
    .credit-term__duration {
        font-size: 18px;
    }
    
    .credit-term__payment {
        font-size: 20px;
    }
    
    .credit-header__title {
        font-size: 18px;
    }
    
    .credit-header__amount {
        font-size: 22px;
    }
    
    .credit-section__title {
        font-size: 16px;
    }
    
    .credit-mobile-nav__item {
        width: 240px;
    }
    
    .credit-mobile-nav__name {
        font-size: 14px;
    }
    
    .credit-mobile-nav__payment {
        font-size: 16px;
    }
    
    .credit-downpayment__quick {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .credit-downpayment__quick-btn {
        padding: 10px 6px;
        font-size: 13px;
        min-height: 40px;
    }
}

@media (min-width: 769px) {
    .credit-sidebar {
        display: flex;
    }
    
    .credit-mobile-nav {
        display: none;
    }
}

.credit-modal-open {
    overflow: hidden;
}

html {
    scroll-behavior: smooth;
}

@media (hover: none) and (pointer: coarse) {
    .credit-trigger:active,
    .credit-term:active,
    .credit-button:active,
    .credit-sidebar__item:active,
    .credit-mobile-nav__item:active,
    .credit-downpayment__quick-btn:active,
    .credit-all-terms__item:active {
        opacity: 0.7;
        transform: scale(0.98);
    }
    
    .credit-slider::-webkit-slider-thumb:active {
        transform: scale(1.2);
    }
}