:root {
    --accent: #3366ff;
    --bg: #f5f6fa;
    --text: #1b1b1b;
    --radius: 16px;
    --transition: 0.25s ease;
}

.car-cost-calc {
    border-radius: 20px;
    background: #DADEE4;
    position: relative;
    transition: 0.2s;
    overflow: hidden;
    padding: 40px;
    max-width: 1200px;
    margin: 40px auto;
}

.calc-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    text-align: center;
    margin-bottom: 8px;
    line-height:1em;
}

.calc-subtitle {
    text-align: center;
    opacity: 0.75;
    margin-bottom: 30px;
    font-size: 16px;
}

/* Табы марок */
.calc-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}

.calc-tabs .tab {
    background: #e9ecf2;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.calc-tabs .tab.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(51,102,255,0.3);
}

/* Контейнер услуг */
.calc-services {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.services {
    display: none;
    flex-direction: column;
    gap: 40px;
}

.services.active {
    display: flex;
}

/* Группы услуг */
.group-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 16px;
    border-bottom: 2px solid rgba(51,102,255,0.15);
    padding-bottom: 4px;
}

/* === Карточки услуг === */
.group-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* фиксировано 3 слота */
    gap: 24px;
}

@media (max-width: 1024px) {
    .group-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .group-cards {
        grid-template-columns: 1fr;
    }
}


/* карточка */
.service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #fff;
    border: 2px solid #e3e4e8;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: var(--transition);
}


/* подсветка при наведении */
.service-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 6px 16px rgba(51,102,255,0.15);
}

.service-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(51,102,255,0.25);
}

.service-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.service-card p {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.8;
    margin-bottom: 12px;
    flex-grow: 1; /* растягивает текстовую часть вверх */
}

.service-card .price {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    font-weight: 700;
    font-size: 18px;
    color: var(--accent);
    margin-top: auto; /* прижимает цену вниз */
}

.service-card .price .period {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.55);
    font-weight: 500;
    text-transform: lowercase;
}

.toggle-service {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: 2px solid #ccc;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    line-height: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.service-card.selected .toggle-service {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}


/* Футер калькулятора */
.calc-footer {
    margin-top: 50px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.calc-footer .total {
    font-size: 20px;
    font-weight: 600;
}

/* === Блок расчёта (появление) === */
.calc-footer {
    margin-top: 40px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    opacity: 1;
    transition: all 0.4s ease;
}

.calc-footer.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.calc-footer.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Корзина выбранных услуг === */
.calc-summary {
    background: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    margin-top: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    opacity: 1;
    transition: all 0.4s ease;
}

.calc-summary.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(30px);
}

.calc-summary.visible {
    opacity: 1;
    transform: translateY(0);
    border-radius: 20px;
    background: #DADEE4;
    position: relative;
    transition: 0.2s;
    overflow: hidden;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.summary-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.summary-icon {
    font-size: 22px;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #ddd;
    padding-top: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #3366ff;
}

.price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.price .period {
    font-size: 14px;
    opacity: 0.7;
    font-weight: 500;
    color: #333;
}

/* === Стили для периода цены === */
.service-card .price {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    font-weight: 700;
    font-size: 18px;
    color: var(--accent);
}

.service-card .price .period {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.55);
    font-weight: 500;
    text-transform: lowercase;
}


/* Адаптив */
@media (max-width: 768px) {
    .service-card {
        width: 100%;
    }
}
