/* Base styles */
@import 'base/variables.css';
@import 'base/reset.css';
@import 'base/typography.css';
@import 'base/utilities.css';

/* Components */
@import 'components/buttons.css';
@import 'components/forms.css';
@import 'components/modal.css';
@import 'components/feature-card.css';

/* Layout */
@import 'layout/header.css';
@import 'layout/footer.css';
@import 'layout/hero.css';
@import 'layout/features.css';
@import 'layout/grid.css';

/* Currency Rate Section */
.currency-rate {
    background-color: #f8f9fa;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.currency-rate__wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.currency-rate__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.currency-rate__label {
    font-size: 14px;
    color: #6c757d;
}

.currency-rate__value {
    font-size: 18px;
    font-weight: 500;
    color: #212529;
}

.currency-rate__time {
    font-size: 14px;
    color: #6c757d;
}

/* Responsive styles for currency rate */
@media (max-width: 768px) {
    .currency-rate__wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .currency-rate__value {
        font-size: 16px;
    }
}

/* Calculator styles */
.calculator {
    max-width: 1200px;
    margin: 0 auto;
    /* padding: 20px; */
}

.calc-form__row {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.price-input {
    position: relative;
    display: inline-block;
    width: auto;
}

.price-input input[type="number"] {
    padding-right: 32px;
}

.price-input input[type="text"] {
    padding-right: 32px;
}

.price-input::after {
    content: "₩";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 16px;
    padding-left: 5px;
}

.calc-form__row label {
    width: 180px;
    font-size: 18px;
    color: #000;
    font-weight: 400;
}

/* Input styles */
.calc-form__row input[type="number"] {
    background: #f5f5f5;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 18px;
    width: 240px;
    margin-right: 12px;
}

/* Segmented btn-group (sliding pill) */
.btn-group {
    display: inline-flex;
    position: relative;
    background: #edeef0;
    border-radius: 12px;
    padding: 4px;
    gap: 0;
}

.btn-group__track {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    background: #0072FB;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(0, 114, 251, 0.35);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    will-change: transform, width;
}

.btn-group button {
    position: relative;
    z-index: 1;
    background: transparent;
    border: none;
    border-radius: 9px;
    padding: 10px 20px;
    font-size: 15px;
    cursor: pointer;
    color: #888;
    white-space: nowrap;
    transition: color 0.22s ease;
    font-weight: 400;
    -webkit-tap-highlight-color: transparent;
}

.btn-group button:hover {
    color: #555;
}

.btn-group button.active {
    color: #fff;
    font-weight: 500;
}

/* Currency display */
.currency-display {
    background: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 18px;
    color: #666;
    margin-left: 12px;
}

/* Checkbox style */
.calc-form__row--checkbox {
    margin-top: 4px;
}

.calc-form__row--checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.calc-form__row--checkbox label {
    width: auto;
    display: flex;
    align-items: center;
}

/* Info text */
.info-text {
    color: #666;
    font-size: 14px;
    margin-top: 8px;
    margin-left: 180px;
}

.info-text a {
    color: #0066cc;
    text-decoration: none;
}

.unit-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 14px;
    transition: border-color 0.2s ease;
}

.unit-field:focus-within {
    border-color: var(--color-primary);
}

.unit-field input {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 80px !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    height: auto !important;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
    box-shadow: none !important;
}

.unit-field input[type="number"]::-webkit-outer-spin-button,
.unit-field input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.unit-label {
    font-size: 13px;
    color: #aaa;
    white-space: nowrap;
    user-select: none;
}

.calc-form__row--nowrap {
    flex-wrap: nowrap;
}

.use-select {
    display: flex;
    gap: 8px;
}

.use-btn {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    line-height: 1.4;
}

.use-btn:hover {
    border-color: var(--color-primary);
    background: #f8f9fa;
}

.use-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.engine-hint {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    line-height: 1.4;
    max-width: 340px;
}

.power-separator {
    font-size: 13px;
    color: #bbb;
    user-select: none;
    flex-shrink: 0;
}

/* Result block */
.calc-result {
    background: linear-gradient(135deg, #0D1E3B 0%, #1a3a6d 100%);
    border-radius: 24px;
    padding: 32px;
    margin-top: 40px;
    color: #fff;
    box-shadow: 0 20px 40px rgba(13, 30, 59, 0.2);
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.calc-result[style*="display: block"] {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.calc-result__main {
    text-align: center;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.calc-result__title {
    font-size: 20px;
    margin-bottom: 16px;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0.2s;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.calc-result[style*="display: block"] .calc-result__title {
    transform: translateY(0);
    opacity: 1;
}

.calc-result__total {
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 24px;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0.4s;
    text-shadow: 0 2px 4px rgba(0, 114, 251, 0.2);
    background: rgba(0, 114, 251, 0.1);
    padding: 16px 32px;
    border-radius: 16px;
    display: inline-block;
}

.calc-result[style*="display: block"] .calc-result__total {
    transform: translateY(0);
    opacity: 1;
}

.calc-result__details {
    font-size: 16px;
    line-height: 1.6;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0.6s;
    color: rgba(255, 255, 255, 0.9);
}

.calc-result[style*="display: block"] .calc-result__details {
    transform: translateY(0);
    opacity: 1;
}

.calc-result__details > div {
    margin-bottom: 16px;
}

.calc-result__details b {
    color: #fff;
    font-weight: 500;
}

.calc-result__details ul {
    list-style: none;
    padding-left: 20px;
    margin: 12px 0 24px;
}

.calc-result__details li {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    position: relative;
}

.calc-result__details li::before {
    content: "•";
    color: #0072FB;
    position: absolute;
    left: -20px;
    font-size: 20px;
    line-height: 1;
}

@media (max-width: 768px) {
    .calc-result {
        padding: 24px;
        margin-top: 32px;
    }

    .calc-result__total {
        font-size: 28px;
        padding: 12px 24px;
    }

    .calc-result__details {
        font-size: 15px;
    }
}

/* Exchange rate info */
.exchange-rate {
    color: #666;
    font-size: 14px;
    margin-top: 16px;
    text-align: right;
}

/* Calculate button */
.calc-form__row--submit {
    margin-top: 32px;
    justify-content: center;
}

.calculate-button {
    background: #0072FB;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calculate-button:hover {
    background: #0A3687;
    transform: translateY(-1px);
}

.calculate-button:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .calc-form__row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .calc-form__row label {
        margin-bottom: 8px;
    }
    
    .calc-form__row input[type="number"],
    .currency-display {
        width: 100%;
        margin: 8px 0;
    }
    
    .age-select,
    .engine-select {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .info-text {
        margin-left: 0;
    }
}

/* Exchange Rate Info Section */
.exchange-info {
    background-color: #fff;
    /* padding: 40px 0; */
    text-align: left;
}

.exchange-info__title {
    margin-top: 60px;
    scroll-margin-top: 90px;
    font-size: 32px;
    font-weight: 700;
    color: #000;
    margin-bottom: 8px;
}

.exchange-info__update {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

.exchange-info__rates {
    display: flex;
    justify-content: flex-start;
    gap: 32px;
    margin-bottom: 24px;
}

.exchange-info__rate_wona {
    font-size: 24px;
    font-weight: 500;
    color: #0072FB;
}

.exchange-info__rate_rub {
    font-size: 24px;
    font-weight: 500;
    color: #0072FB;
}

.exchange-info__rate_cny {
    font-size: 24px;
    font-weight: 500;
    color: #0072FB;
}

.exchange-info__description {
    font-size: 16px;
    line-height: 1.5;
    color: #666;
    max-width: 1200px;
}

@media (max-width: 768px) {
    .exchange-info {
        padding: 32px 0;
    }

    .exchange-info__title {
        font-size: 24px;
    }

    .exchange-info__rates {
        flex-direction: column;
        gap: 16px;
    }

    .exchange-info__rate {
        font-size: 20px;
    }

    .exchange-info__description br {
        display: none;
    }
}

/* Mobile menu state */
body.menu-open {
    overflow: hidden;
}

@media (max-width: 992px) {
    body.menu-open {
        padding-right: var(--scrollbar-width, 0);
    }
}

/* Contacts section */
.contacts {
    padding: 80px 0;

}

.contacts__wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 40px;
    align-items: center;
}

.contacts__info {
    display: flex;
    flex-direction: column;
    gap: 32px;
    justify-content: center;
}

.contacts__item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.contacts__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 33%);;
}

.contacts__icon img {
    width: 24px;
    height: 24px;
}

.contacts__content {
    flex: 1;
}

.contacts__title {
    font-size: 18px;
    font-weight: 500;
    color: #666;
    margin-bottom: 4px;
}

.contacts__link,
.contacts__text {
    font-size: 20px;
    color: #000;
    text-decoration: none;
}

.contacts__link:hover {
    color: #0072FB;
}

.contacts__social {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.contacts__map {
    width: 100%;
    height: 100%;
    min-height: 450px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.contacts__map iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 992px) {
    .contacts__wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contacts__map {
        min-height: 400px;
    }
}

@media (max-width: 576px) {
    .contacts {
        padding: 60px 0;
    }

    .contacts__link,
    .contacts__text {
        font-size: 18px;
    }

    .contacts__map {
        min-height: 300px;
    }
}

/* Footer */
.footer {
    background-color: #0D1E3B;
    padding: 24px 0;
}

.footer__wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.footer .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.footer .logo__img {
    width: 32px;
    height: 32px;
}

.footer .logo__text {
    color: #fff;
    font-size: 18px;
    text-decoration: none;
    white-space: nowrap;
}

.footer__contacts {
    display: flex;
    align-items: center;
    gap: 32px;
    white-space: nowrap;
}

.footer__social {
    display: flex;
    gap: 16px;
}

.footer__phone {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: color 0.2s;
}

.footer__phone:hover {
    color: #0072FB;
}

.footer__bottom {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer__copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0;
}

@media (max-width: 992px) {
    .footer__wrapper {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .footer .logo {
        margin-right: auto;
    }

    .footer__contacts {
        order: 2;
    }
}

@media (max-width: 576px) {
    .footer {
        padding: 20px 0;
    }

    .footer__wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .footer__contacts {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        width: 100%;
    }

    .footer__social {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Social Links */
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.social-link img {
    width: 24px;
    height: 24px;
} 

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: padding-right 0.3s;
}

body.modal-open .header {
    padding-right: var(--scrollbar-width, 0px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 30, 59, 0.9);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.modal__content {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

.modal.active .modal__content {
    transform: translateY(0);
}

.modal__close {
    position: absolute;
    right: 20px;
    top: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.modal__title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--color-primary);
}

.modal__description {
    font-size: 16px;
    line-height: 1.5;
    color: #666;
    margin-bottom: 24px;
}

.modal__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal__input,
.modal__input[type="text"],
.modal__input[type="tel"] {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #eee;
    border-radius: 12px;
    transition: border-color 0.3s ease;
    background-color: #fff;
    color: #333;
    font-family: inherit;
}

.modal__input:focus {
    border-color: var(--color-primary);
    outline: none;
}

.modal__input::placeholder {
    color: #999;
}

.modal__select-wrapper {
    position: relative;
}

.modal__select-wrapper::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #666;
    pointer-events: none;
}

.modal__select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 44px;
    color: #333;
}

.modal__select option[value=""] {
    color: #999;
}

@media (max-width: 576px) {
    .modal__content {
        padding: 24px;
    }

    .modal__title {
        font-size: 20px;
    }

    .modal__description {
        font-size: 14px;
    }
}

/* Добавляем стили для мобильной навигации */
@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .nav.is-active {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        z-index: 1000;
        padding: 80px 20px 20px;
        overflow-y: auto;
    }

    .nav.is-active .nav__list {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin-bottom: 30px;
    }

    .nav.is-active .nav__link {
        font-size: 18px;
        padding: 10px 20px;
    }

    .mobile-cta {
        display: flex;
        justify-content: center;
        padding: 20px;
        margin-top: 20px;
        width: 100%;
    }

    .nav.is-active .mobile-cta .button {
        width: 100%;
        max-width: 280px;
        padding: 15px 25px;
        font-size: 16px;
        text-align: center;
        background: #0072FB;
        color: #fff;
        border-radius: 12px;
        text-decoration: none;
        transition: all 0.3s ease;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .nav.is-active .mobile-cta .button:hover {
        background: #0A3687;
        transform: translateY(-2px);
    }

    .nav.is-active .mobile-cta .button:active {
        transform: translateY(0);
    }

    /* Скрываем кнопку в хедере на мобильных устройствах */
    .header__contacts .button {
        display: none;
    }

    /* Стили для бургер-меню */
    .burger-menu {
        display: block;
    }

    /* Стили для модального окна в мобильной версии */
    .modal__content {
        width: 90%;
        max-width: 100%;
        margin: 20px auto;
        padding: 20px;
        border-radius: 12px;
    }

    .modal__title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .modal__description {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .modal__input {
        width: 100%;
        padding: 12px;
        margin-bottom: 15px;
        font-size: 16px;
    }

    .modal .button {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }

    .modal__close {
        top: 10px;
        right: 10px;
        font-size: 24px;
    }

    /* Стили для результатов калькулятора в мобильной версии */
    .calc-result {
        padding: 15px;
    }

    .calc-result__main {
        margin-bottom: 20px;
    }

    .calc-result__title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .calc-result__total {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .payment-stage {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 8px;
    }

    .payment-stage h4 {
        font-size: 14px;
        color: #ffffff;
        margin-bottom: 10px;
        font-weight: 500;
    }

    .payment-stage div, 
    .payment-stage li {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .payment-stage ul {
        padding-left: 20px;
        margin: 10px 0;
    }
}

/* Стили для очень маленьких экранов */
@media (max-width: 375px) {
    .modal__content {
        width: 95%;
        padding: 15px;
    }

    .modal__title {
        font-size: 18px;
    }

    .payment-stage h4 {
        font-size: 13px;
    }

    .payment-stage div, 
    .payment-stage li {
        font-size: 13px;
    }
}

/* Mobile CTA button */
.mobile-cta {
    display: none; /* Скрыта на десктопе */
}

/* Header styles */
.header__wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    position: relative;
}

/* Mobile styles */
@media (max-width: 768px) {

    .mobile-cta {
        display: flex;
        margin-right: 15px;
    }

    .mobile-cta .button {
        padding: 8px 15px;
        font-size: 14px;
        background: #0072FB;
        color: #fff;
        border-radius: 8px;
        text-decoration: none;
        transition: all 0.3s ease;
        white-space: nowrap;
    }

    .mobile-cta .button:hover {
        background: #0A3687;
    }

    /* Скрываем десктопную кнопку на мобильных */
    .header__contacts .button {
        display: none;
    }

    /* Настройка порядка элементов в шапке */
    .logo {
        order: 1;
    }

    .mobile-cta {
        order: 2;
    }

    .burger-menu {
        order: 3;
    }

    .nav,
    .header__contacts {
        order: 4;
    }
}

/* Очень маленькие экраны */
@media (max-width: 375px) {
    .mobile-cta .button {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Mobile CTA button */
.mobile-cta {
    display: none; /* Скрыта на десктопе */
}

/* Mobile styles */
@media (max-width: 992px) { /* Увеличиваем брейкпоинт до 992px - стандартный размер для планшетов */
    .nav.is-active .mobile-cta {
        display: flex;
        justify-content: center;
        padding: 20px;
        margin-top: 20px;
        width: 100%;
    }

    .nav.is-active .mobile-cta .button {
        width: 100%;
        max-width: 280px;
        padding: 15px 25px;
        font-size: 16px;
        text-align: center;
        background: #0072FB;
        color: #fff;
        border-radius: 12px;
        text-decoration: none;
        transition: all 0.3s ease;
    }

    .nav.is-active .mobile-cta .button:hover {
        background: #0A3687;
        transform: translateY(-2px);
    }

    .nav.is-active .mobile-cta .button:active {
        transform: translateY(0);
    }

    /* Скрываем десктопную кнопку на мобильных */
    .header__contacts .button {
        display: none;
    }
}

/* Дополнительные стили для маленьких экранов */
@media (max-width: 768px) {
    .nav.is-active .mobile-cta .button {
        font-size: 15px;
        padding: 12px 20px;
    }
}

@media (max-width: 576px) {
    .nav.is-active .mobile-cta .button {
        font-size: 14px;
        padding: 10px 16px;
    }
}

/* Calculator URL styles */
.calculator-title {
    margin-top: 60px;
    font-size: 32px;
    font-weight: 700;
    color: #000;
    margin-bottom: 8px;
}

.calculator-update {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

.calculator-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 1200px;
}

.calc-input-wrapper {
    margin: 24px 0px 24px 0px;
    min-width: 450px;
    box-shadow: 0 2px 6px #252525;
    border-radius: 20px;
}

/* Calculator Tiles Grid */
.calc-tiles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
    max-width: 1200px;
}

/* Ручной калькулятор — 4 плитки 2x2 */
.calc-tiles-grid--manual {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1000px;
    margin: 30px auto 0;
}

.calc-tiles-grid--manual .calc-tile--blue .calc-tile__total,
.calc-tiles-grid--url .calc-tile--blue .calc-tile__total {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
}

/* URL-калькулятор — 6 плиток 3x2 */
.calc-tiles-grid--url {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1200px;
    margin: 30px auto 0;
}

.calc-tile {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    color: #333;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calc-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calc-tile__timeframe {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.3;
}

.calc-tile__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.calc-tile__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calc-tile--blue .calc-tile__content {
    justify-content: center;
    align-items: center;
}

.calc-tile__item {
    font-size: 14px;
    line-height: 1.4;
    color: #555;
    margin-bottom: 5px;
}

.calc-tile__sub-item {
    font-size: 12px;
    color: #555;
    padding-left: 10px;
    line-height: 1.5;
    margin-bottom: 1px;
}

.calc-tile__divider {
    height: 0;
    border: none;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
    margin-bottom: 6px;
}

.calc-tile__item--total b {
    font-size: 15px;
}

.calc-tile__item b {
    color: #333;
    font-weight: 600;
}

.calc-tile__total {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
    margin: auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calc-tile__photo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    border-radius: 12px;
    min-height: 120px;
    color: #666;
    font-style: italic;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Tile Color Variants - все плитки одинаковые, кроме итоговой */
.calc-tile--orange,
.calc-tile--teal,
.calc-tile--yellow,
.calc-tile--purple,
.calc-tile--pink {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

/* Итоговая плитка в primary цветах */
.calc-tile--blue {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border: 1px solid var(--color-primary);
    color: white;
}

.calc-tile--blue .calc-tile__timeframe {
    color: #e0e0e0;
}

.calc-tile--blue .calc-tile__title {
    color: white;
}

.calc-tile--blue .calc-tile__item {
    color: #e0e0e0;
}

.calc-tile--blue .calc-tile__item b {
    color: white;
}

.calc-tile--blue .calc-tile__total {
    color: white;
}

/* Блок курсов валют внутри синей плитки */
.calc-tile__rates-line {
    font-size: 12px;
    color: #e0e0e0;
    margin-top: 12px;
    line-height: 1.3;
}

/* Calculator Sections */
.calculator-section {
    margin-bottom: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.calculator-subtitle {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: left;
}

/* Manual Calculator Form */
.calc-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 700px;
}

.calc-form__row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.calc-form__row label {
    min-width: 200px;
    font-size: 15px;
    color: #555;
    font-weight: 500;
}

#price {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 110px !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    height: auto !important;
    outline: none;
    color: #1a1a1a;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
}

.calc-form__row input[type="number"] {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 15px;
    width: 180px;
    transition: border-color 0.2s ease;
    position: relative;
    -moz-appearance: textfield;
    appearance: textfield;
}

.calc-form__row input[type="number"]::-webkit-outer-spin-button,
.calc-form__row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.calc-form__row input[type="number"]:focus {
    outline: none;
    border-color: var(--color-primary);
}

.currency-display {
    background: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 16px;
    color: #666;
    border: 2px solid #e9ecef;
    min-width: 120px;
    text-align: center;
}

/* use-select and use-btn for compatibility */
.use-btn.is-invalid {
    outline: 2px solid #e74c3c;
}


.calc-form__row--checkbox {
    margin-top: 10px;
}

.calc-form__row--checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    accent-color: var(--color-primary);
}

.calc-form__row--checkbox label {
    display: flex;
    align-items: center;
    min-width: auto;
    cursor: pointer;
}

/* Кнопка расчета для ручного калькулятора */
#calc-manual-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 40px;
    font-size: 15px;
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    border: none;
    border-radius: 10px;
    transition: var(--transition-base);
    color: var(--color-white);
    background-color: var(--color-primary);
    margin-top: 8px;
    align-self: flex-start;
}

#calc-manual-btn:hover {
    color: var(--color-white);
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    text-decoration: none;
}

#calc-manual-btn:active {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: translateY(1px);
}

#calc-manual-btn:disabled {
    opacity: 0.65;
    pointer-events: none;
}

/* Responsive for manual calculator */
@media (max-width: 768px) {
    .calculator-section {
        padding: 20px;
        margin-bottom: 30px;
    }

    .calculator-subtitle {
        font-size: 20px;
    }

    .calc-form__row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .calc-form__row label {
        min-width: auto;
        font-size: 14px;
    }

    /* btn-group не растягивать, разрешить горизонтальный скролл при переполнении */
    .btn-group {
        flex-wrap: nowrap;
        width: fit-content;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    /* Обёртка вокруг btn-group (например, .engine-select) не должна растягивать группу */
    .calc-form__row > div:not([class]),
    .calc-form__row--engine > div {
        width: fit-content;
        max-width: 100%;
    }

    .btn-group::-webkit-scrollbar {
        display: none;
    }

    .btn-group button {
        padding: 9px 12px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Мощность — перенос на строки */
    .calc-form__row--nowrap {
        flex-wrap: wrap;
    }

    .unit-field input[type="number"] {
        width: 60px !important;
    }

    #calc-manual-btn {
        width: 100%;
        max-width: 100%;
    }
}

.calc-url-input {
    display: block;
    width: 100%;
    max-width: 600px;
    padding: calc(var(--input-padding-y) * 1.2) calc(var(--input-padding-x) * 1.2);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-normal);
    line-height: 1.5;
    color: var(--color-gray-900);
    background-color: var(--color-white);
    background-clip: padding-box;
    border: var(--input-border-width) solid var(--input-border-color);
    border-radius: var(--input-border-radius);
    transition: var(--transition-base);
    position: relative;
}

.calc-url-input:focus {
    color: var(--color-gray-900);
    background-color: var(--color-white);
    border-color: var(--input-focus-border-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem var(--input-focus-ring-color);
}

.calc-url-input::placeholder {
    color: var(--color-gray-400);
    opacity: 1;
}

/* URL row — input expands to fill remaining space */
.calc-form__row--url {
    align-items: center;
    flex-wrap: nowrap;
}

.calc-form__row--url .calc-url-input {
    flex: 1;
    max-width: none;
    min-width: 0;
    font-size: 15px;
    padding: 10px 14px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: border-color 0.2s ease;
    background: #fff;
}

.calc-form__row--url .calc-url-input:focus {
    border-color: var(--color-primary);
    box-shadow: none;
    outline: 0;
}

/* Steps strip — outside the form, centered in the section */
.calc-url-steps {
    display: flex;
    align-items: stretch;
    gap: 24px;
    max-width: 680px;
    margin: 36px auto 0;
}

.calc-url-btn-wrap {
    margin-top: 36px;
}

.calc-url-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.calc-url-step__num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.calc-url-step__text {
    font-size: 13px;
    color: #666;
    line-height: 1.55;
}

.calc-url-step__text b {
    color: #333;
    font-weight: 600;
}

.calc-url-step__divider {
    width: 20px;
    flex-shrink: 0;
    height: 1px;
    background: #d8dce2;
    align-self: center;
}

.calc-url-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--button-padding-y) * 1.2) calc(var(--button-padding-x) * 1.5);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    line-height: var(--button-line-height);
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: var(--button-border-radius);
    transition: var(--transition-base);
    color: var(--color-white);
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    margin-top: 0;
    max-width: 600px;
}

.calc-url-link:hover {
    color: var(--color-white);
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    text-decoration: none;
}

.calc-url-link:active {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    transform: translateY(1px);
}

.calc-url-link:disabled {
    opacity: 0.65;
    pointer-events: none;
}

.btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
    margin-right: 8px;
    flex-shrink: 0;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* Responsive calculator URL styles */
@media (max-width: 768px) {
    .calculator-title {
        font-size: 24px;
        margin-top: 32px;
    }
    
    .calculator-update {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .calculator-form {
        max-width: 100%;
        padding: 0 var(--spacing-4);
    }
    
    .calc-input-wrapper {
        min-width: 100%;
        margin-bottom: 12px;
    }
    
    .calc-url-input {
        max-width: 100%;
        font-size: var(--font-size-base);
        padding: var(--input-padding-y) var(--input-padding-x);
    }

    .calc-form__row--url {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .calc-form__row--url .calc-url-input {
        width: 100%;
    }

    .calc-url-link {
        max-width: 100%;
        width: 100%;
        padding: var(--button-padding-y) var(--button-padding-x);
        font-size: var(--font-size-base);
    }

    .calc-url-steps {
        flex-direction: column;
        gap: 10px;
        max-width: 100%;
    }

    .calc-url-step__divider {
        display: none;
    }
    
    .calc-tiles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 20px;
    }
    
    .calc-tiles-grid--manual {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 15px;
        margin-top: 20px;
    }
    
    /* Адаптивные стили для мобильных устройств */
    .calc-tiles-grid--manual .calc-tile--orange .calc-tile__item,
    .calc-tiles-grid--manual .calc-tile--yellow .calc-tile__item {
        margin-bottom: 10px;
        line-height: 1.5;
    }
    
    .calc-tiles-grid--manual .calc-tile--blue .calc-tile__total {
        font-size: 1.8rem;
    }
    
    .calc-tile {
        min-height: 180px;
        padding: 15px;
    }
    
    .calc-tile__title {
        font-size: 16px;
    }
    
    .calc-tile__item {
        font-size: 13px;
    }
    
    .calc-tile__total {
        font-size: 20px;
    }
}

/* --- Анимация ошибки (тряска — отдельный класс) --- */
@keyframes calc-shake {
    0%   { transform: translateX(0); }
    15%  { transform: translateX(-6px); }
    35%  { transform: translateX(5px); }
    55%  { transform: translateX(-4px); }
    75%  { transform: translateX(3px); }
    90%  { transform: translateX(-1px); }
    100% { transform: translateX(0); }
}

@keyframes calc-pulse-border {
    0%   { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.55); }
    60%  { box-shadow: 0 0 0 5px rgba(229, 57, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}

/* Тряска — только анимация, без состояния */
.calc-shake {
    animation: calc-shake 0.4s ease, calc-pulse-border 0.7s ease 0.1s;
}

/* --- Красная рамка — только через is-invalid на инпуте --- */
.unit-field:has(.is-invalid) {
    border: 2px solid #e53935 !important;
    box-shadow: none !important;
}

.calc-url-input.is-invalid {
    border: 2px solid #e53935 !important;
    box-shadow: none !important;
}

/* Кнопки-переключатели */
.age-btn.is-invalid,
.engine-btn.is-invalid,
.country-btn.is-invalid,
.use-btn.is-invalid,
.btn-group button.is-invalid {
    outline: none !important;
    color: #e53935 !important;
}

/* btn-group красная рамка */
.btn-group:has(.is-invalid) {
    border: 2px solid #e53935;
    border-radius: 12px;
    box-shadow: none !important;
}
.calc-hint {
    color: #e53935;
    font-size: 13px;
    margin-top: 4px;
    margin-left: 2px;
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    background: white;
    padding: 2px 4px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}