/* ======================== ОСНОВНАЯ СТРУКТУРА КАЛЬКУЛЯТОРА2 ======================== */
.window-calculator {
    padding: 40px 40px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    font-family: Arial, sans-serif;
}

.window-calculator .page-type-product h1 {
    font-size: 2rem !important;
    line-height: 2rem;
    font-weight: 800;
    color: #182978;
}

#userDataForm, #sucsesful {
    display: none; 
}

/* ======================== СТИЛИ ВЫБОРА ПРОФИЛЯ/ФОРМАТА ======================== */
.format-options .unit label {
    opacity: 0;
    height: 0;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
}

.profile-selection .profile-option label:before,
.door-type-selection-wrapper .door-type-option label:before{
    content: '';
    display: block;
    position: absolute;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #eeeeee;
    background: transparent;
    box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.1);
}

.profile-selection .profile-option.active label:before ,
.door-type-selection-wrapper .door-type-option.active label:before{
    background-color: rgba(255, 217, 0, 0.8);
    -webkit-animation: cd-bounce 0.3s;
    -moz-animation: cd-bounce 0.3s;
    animation: cd-bounce 0.3s;
    text-align: left !important;
}
.profile-selection .profile-option label,
.door-type-selection-wrapper .door-type-option label {
    position: relative;
    padding-left: 30px;
    margin-left: 0;
    padding-right: 20px;
    display: block;
    cursor: pointer;
    text-align: left;
    margin: 0 auto 0 0;
    white-space: nowrap;
}

.door-type-selection-wrapper,
.profile-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 1vw;
    justify-content: flex-start;
    margin-bottom: 20px;
}

.door-type-option,
.profile-option {
    flex: 0 0 calc((100% - 2vw ) / 3);
    margin: 0 !important;
    min-width: 220px;
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px 15px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}
.button {
    border-radius: 60px;
}
.door-type-option input[type="radio"],
.profile-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    cursor: pointer;
}

.door-type-option.active,
.profile-option.active,
.format-selection .unit.active{
    border-radius: 4px;
    border: 1px solid rgba(255, 217, 0, 0.8);
    box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.1);
    background: #ffffff;
}

/* ======================== СТИЛИ ВЫБОРА ФОРМАТА (Изображения) ======================== */

.format-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.format-selection .unit {
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1;
    margin-bottom: 0;
    position: relative;
    cursor: pointer;
}

.format-selection .unit__image {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.2s;
    margin-bottom: 0px;
}

.format-selection .unit img {
    max-width: 120px; 
    height: auto;
    display: block;
}
.format-selection .unit input[type="radio"] {
    display: none !important;
}
.title-h3 {
    font-size: 1.3em;
    font-weight: 600;
    margin-top: 25px;
    margin-bottom: 15px;
    color: #182978;
}

/* ======================== 4. ДВУХКОЛОНОЧНЫЙ МАКЕТ (70% : 30%) - АДАПТИВНЫЙ FLEXBOX ======================== */

.calc-layout-wrapper {
    display: flex; 
    gap: 15px;
    align-items: flex-start;
}

/* ЛЕВАЯ КОЛОНКА (Визуализация) - 70%. Не растет, не сжимается, гарантированно занимает 70%. */
.visualization-block {
    flex: 0 0 70%; 
    max-width: 70%;
    width: 70%; 
    
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ПРАВАЯ КОЛОНКА (Опции) - 30%. Занимает остаток, не сжимается. */
.optionssize {
    flex-grow: 1; 
    flex-shrink: 0; 
    min-width: 250px; 
    
    display: flex;
    flex-direction: column;
    gap: 10px;
}


/* ======================== БЛОК ВИЗУАЛИЗАЦИИ (ЛЕВАЯ КОЛОНКА) ======================== */

.calcimages {
    background: rgba(0, 40, 190, 0.05);
    padding: 0;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%
}

.window-image {
    max-width: 100%;
    width: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}
.window-image img {
    margin: 20px;
    max-width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ======================== ДИНАМИЧЕСКИЕ ЯЧЕЙКИ (СЖАТИЕ И ВПЛОТНУЮ) ======================== */

#windowOptions {
    margin-top: 15px;
    display: flex; 
    flex-wrap: wrap; 
    
    overflow-x: unset; 
    
    /* 🔥 КЛЮЧИ: Убираем gap и центрируем */
    gap: 0; 
    justify-content: center; 
    
    width: 100%;
    padding: 10px 0;
    box-sizing: border-box;
}

.window-option-cell {
    flex: 0 1 100px;
    max-width: 150px;
    min-width: 50px; 
    min-width: 0; /* Важно для сжатия во Flexbox */
    
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cell-image-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
    box-sizing: border-box;
}

.window-option-cell img.cell-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

.window-option-cell .window-option-select {
    width: 100%;
    padding: 5px 2px;
    font-size: 0.8em;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ======================== БЛОК ОПЦИЙ (ПРАВАЯ КОЛОНКА) ======================== */

.optionssize label {
    display: flex;
    flex-direction: column;
    font-size: 0.9em;
    font-weight: 500;
    color: #555;
    margin-bottom: 10px;
}

.dimensions-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.dimensions-row > div {
    flex: 1;
}

.optionssize input[type="number"],
.optionssize select {
    color: #666666;
    font-family: 'Arial', sans-serif;
    font-weight: normal;
    font-style: normal;
    font-size: 14px;
    line-height: 1.25;
    border-radius: 4px;
    border: 1px solid #eeeeee;
    box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    padding: 10px 10px;
    transition: all 0.2s linear 0s;
    width: 100%;
    font-size: 1em;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.total {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    width: 100%;
}

#continueButton,
#backButton,
#submitRequest {
    padding: 1vw 2vw;
    margin-top: 20px;
    height: auto;
    font-size: 1.4em;
    font-weight: bold;
    cursor: pointer;
    border-radius: 60px;
    text-decoration: none;
}

.button-form {
    gap: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}


/* ======================== АДАПТИВНОСТЬ (Мобильные устройства) ======================== */

@media (max-width: 992px) {
    .calc-layout-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    /* На мобильных экранах обе колонки занимают 100% ширины */
    .visualization-block {
        flex: 1 1 100% !important; 
        width: 100% !important;
        flex-shrink: 1 !important;
        order: -1; 
    }
    
    .optionssize {
        flex: 1 1 100% !important; 
        min-width: 100% !important;
    }

}