/* === ПЛАВАЮЩИЙ КАЛЬКУЛЯТОР В ПРАВОМ ВЕРХНЕМ УГЛУ === */

/* Контейнер калькулятора */
.compact-calculator {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 100;
    padding: 20px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-left: 20px;
    margin-bottom: 20px;
}

/* Заголовок калькулятора */
.calc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.calc-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1a73e8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calc-header h3 i {
    color: #34a853;
}

/* Кнопка сворачивания */
.calc-toggle {
    background: none;
    border: none;
    color: #5f6368;
    cursor: pointer;
    font-size: 20px;
    padding: 5px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calc-toggle:hover {
    background: #f8f9fa;
    color: #1a73e8;
}

/* Свернутый калькулятор */
.compact-calculator.minimized {
    width: 60px;
    height: 60px;
    padding: 0;
    overflow: hidden;
    border-radius: 30px;
}

.compact-calculator.minimized .calc-content {
    display: none;
}

.compact-calculator.minimized .calc-header {
    padding: 0;
    border: none;
    margin: 0;
    height: 100%;
    justify-content: center;
}

.compact-calculator.minimized .calc-toggle {
    transform: rotate(180deg);
}

/* Содержимое калькулятора */
.calc-content {
    transition: all 0.3s ease;
}

/* Поле ввода */
.calc-input-group {
    margin-bottom: 15px;
}

.calc-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #202124;
    font-size: 14px;
}

.calc-counter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.calc-counter-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: white;
    color: #5f6368;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calc-counter-btn:hover {
    border-color: #1a73e8;
    color: #1a73e8;
    background: #f0f7ff;
}

.calc-counter-input {
    flex: 1;
    text-align: center;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.calc-counter-input:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* Слайдер */
.calc-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 15px;
}

.calc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1a73e8;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.calc-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1a73e8;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Результат */
.calc-result {
    background: linear-gradient(135deg, #f0f7ff, #e3f2fd);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(26, 115, 232, 0.2);
}

.calc-result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.calc-result-label {
    color: #5f6368;
    font-size: 14px;
}

.calc-result-value {
    font-weight: 600;
    color: #202124;
}

.calc-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 2px dashed rgba(26, 115, 232, 0.3);
    margin-top: 10px;
}

.calc-total-label {
    font-weight: 600;
    color: #202124;
    font-size: 16px;
}

.calc-total-price {
    font-size: 24px;
    font-weight: 700;
    color: #1a73e8;
    background: white;
    padding: 5px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.15);
}

/* Кнопки */
.calc-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calc-btn {
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.calc-btn-primary {
    background: linear-gradient(135deg, #1a73e8, #0d62d9);
    color: white;
}

.calc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(26, 115, 232, 0.3);
}

.calc-btn-secondary {
    background: white;
    color: #1a73e8;
    border: 2px solid #1a73e8;
}

.calc-btn-secondary:hover {
    background: #f0f7ff;
    transform: translateY(-2px);
}

/* Индикатор загрузки */
.calc-loading {
    display: none;
    text-align: center;
    padding: 10px;
    color: #5f6368;
}

.calc-loading.active {
    display: block;
}

.calc-loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 100% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* Адаптивность */
@media (max-width: 768px) {
    .compact-calculator {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        max-width: 400px;
        margin: 20px auto;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .hero-content {
        padding-right: 0 !important;
    }
}
