/* ==========================================
   БАЗОВЫЕ СТИЛИ
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2e7d32;
    --primary-hover: #1b5e20;
    --text-dark: #1a1a1a;
    --text-light: #ffffff;
    --text-gray: #666666;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
}

html {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background: linear-gradient(135deg, #f5f9f5 0%, #e8f5e9 100%);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

img,
video,
iframe {
    max-width: 100%;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================
   ШАПКА
   ========================================== */

.header {
    background: linear-gradient(160deg, #f6f9f6 0%, #d5e3d5 50%, #36ad3c 100%);
    box-shadow: var(--shadow-sm);
    padding: 20px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo-image {
    height: 60px;
    width: auto;
}

.page-title {
    font-size: 1.5rem;
    color: var(--text-dark);
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.back-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.back-btn:hover {
    background: var(--primary-hover);
    transform: translateX(-3px);
}

/* ==========================================
   ОСНОВНОЙ КОНТЕНТ
   ========================================== */

.calculator-main {
    padding: 40px 0 80px;
}

.calculator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 32px;
    align-items: start;
}

/* ==========================================
   ФОРМА КАЛЬКУЛЯТОРА
   ========================================== */

.calculator-form {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    min-width: 0; /* позволяет grid-элементу сжиматься, иначе прогресс-бар распирает страницу */
}

/* Прогресс-бар */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-gray);
    transition: all var(--transition-base);
}

.progress-step.active .step-number {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-light);
    transform: scale(1.1);
}

.progress-step.completed .step-number {
    background: var(--success-color);
    border-color: var(--success-color);
    color: var(--text-light);
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    font-weight: 500;
}

.progress-step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* Шаги формы */
.form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-title {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-weight: 600;
}

.step-subtitle {
    color: var(--text-gray);
    margin-bottom: 24px;
}

/* Сетка опций */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.option-card {
    background: var(--bg-light);
    border: 3px solid transparent;
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.option-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.option-card.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-light);
}

.option-card.selected h3,
.option-card.selected p {
    color: var(--text-light);
}

.option-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.option-card h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.option-card p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.option-price {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
    margin-top: 8px;
}

.option-card.selected .option-price {
    color: var(--text-light);
}

/* Цветные опции */
.color-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 4px solid white;
}

/* Выбор размера */
.size-selector {
    margin-bottom: 32px;
}

.size-inputs {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.input-group {
    flex: 1;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.size-select,
.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.size-select:focus,
.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.size-multiply {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    padding-top: 28px;
}

.size-preview {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.preview-box {
    border: 3px dashed var(--primary-color);
    border-radius: var(--radius-md);
    padding: 40px;
    background: var(--bg-white);
}

.preview-text {
    font-size: 1.1rem;
    color: var(--text-gray);
    font-weight: 500;
}

/* Счетчик окон */
.window-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
}

.counter-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    font-size: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.counter-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.counter-btn:active {
    transform: scale(0.95);
}

.counter-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.counter-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.counter-label {
    font-size: 1rem;
    color: var(--text-gray);
    font-weight: 500;
}

.counter-info {
    text-align: center;
    color: var(--text-gray);
}

/* Форма адреса */
.address-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Навигация */
.form-navigation {
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.nav-btn {
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-prev {
    background: var(--bg-light);
    color: var(--text-dark);
}

.btn-prev:hover {
    background: var(--border-color);
}

.btn-next,
.btn-submit {
    background: var(--primary-color);
    color: var(--text-light);
    flex: 1;
}

.btn-next:hover,
.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ==========================================
   ИТОГОВАЯ ЦЕНА
   ========================================== */

.price-summary {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 24px;
}

.summary-title {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 24px;
    font-weight: 600;
}

.summary-section {
    margin-bottom: 24px;
}

.summary-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
}

.item-label {
    color: var(--text-gray);
}

.item-value {
    font-weight: 600;
    color: var(--text-dark);
}

.item-price {
    font-weight: 600;
    color: var(--primary-color);
}

.summary-divider {
    height: 2px;
    background: var(--border-color);
    margin: 24px 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.total-price {
    color: var(--primary-color);
}

.summary-note {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 16px;
}

.summary-note p {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.summary-note ul {
    list-style: none;
    padding: 0;
}

.summary-note li {
    padding: 4px 0 4px 20px;
    position: relative;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.summary-note li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: 600;
}

/* ==========================================
   АДАПТИВНОСТЬ
   ========================================== */

@media (max-width: 1024px) {
    .calculator-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .price-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 1.2rem;
    }

    .calculator-form {
        padding: 24px;
    }

    .progress-bar {
        overflow-x: auto;
        justify-content: flex-start;
        gap: 16px;
        padding-bottom: 8px;
    }

    .progress-step {
        flex-shrink: 0;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .size-inputs {
        flex-direction: column;
    }

    .size-multiply {
        transform: rotate(90deg);
        padding: 0;
    }

    .input-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-wrap: wrap;
    }

    .page-title {
        order: 3;
        width: 100%;
        text-align: left;
        font-size: 1.1rem;
    }
}
