/* ==========================================================================
   ÎÁÚÅÄÈÍÅÍÍÛÅ ÑÒÈËÈ (CSS) — ÏÎËÍÀß ÂÅÐÑÈß Ñ ÀÄÀÏÒÈÂÍÎÉ ÂÅÐÑÒÊÎÉ ÊÀÐÒÈÍÎÊ
   ========================================================================== */

.sim-calc-scope,
.sim-calc-scope * {
    -moz-box-sizing: border-box !important;
    -webkit-box-sizing: border-box !important;
    box-sizing: border-box !important;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.sim-calc-scope {
    width: 100%;
    margin: 5px auto;
    padding: 0px;
}

.sim-calc-scope .sim-gate-calc {
    background: #ffffff;
    border: 0px solid #e5ebf8;
    border-radius: 12px; 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 4%);
    overflow: hidden;
}

.sim-calc-scope .sim-calc-tab-header {
    display: flex;
    background-color: #f1f5fc;
    border-bottom: 0px solid #e5ebf8;
}

.sim-calc-scope .sim-tab-btn {
    background: none;
    border: none;
    padding: 22px 15px;
    font-size: 15px;
    font-weight: 700;
    color: #001e29;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s ease-in-out;
    border-bottom: 4px solid transparent;
}

.sim-calc-scope .sim-tab-col-left,
.sim-calc-scope .sim-tab-col-right {
    width: 50%;
}
.sim-calc-scope .sim-tab-col-left {
    border-right: 1px solid #e5ebf8;
}

.sim-calc-scope .sim-tab-btn:hover {
    background-color: rgba(0, 52, 154, 3%);
}

.sim-calc-scope .sim-tab-btn.active {
    background-color: #ffffff;
    border-bottom-color: #00349a;
    color: #00349a;
}

.sim-calc-scope .sim-tab-content { display: none; }
.sim-calc-scope .sim-tab-content.active { display: block; }
.sim-calc-scope .sim-tab-grid { display: flex; flex-wrap: wrap; }

.sim-calc-scope .sim-col-left,
.sim-calc-scope .sim-col-right {
    width: 50%;
    flex: 0 0 50%;
}

.sim-calc-scope .sim-calc-visual {
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid #e5ebf8;
}

/* --- ÀÄÀÏÒÈÂÍÛÉ ÁËÎÊ ÈÇÎÁÐÀÆÅÍÈÉ ÄÂÅÐÅÉ --- */
.sim-calc-scope .sim-doors-double-container {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 480px;
    justify-content: center;
}

.sim-calc-scope .sim-door-view-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0; /* Çàùèùàåò ôëåêñ-ýëåìåíò îò ðàñïèðàíèÿ */
}

.sim-calc-scope .sim-door-view-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #00349a;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-align: center;
}

.sim-calc-scope .sim-door-wrapper-mini {
    position: relative;
    width: 100%;
    max-width: 235px;
    height: auto;
    max-height: 500px;
    aspect-ratio: 235 / 500; /* Ñîõðàíÿåò ïðîïîðöèè äâåðåé ïðè ñæàòèè */
    background-color: #e5ebf8;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- ÀÄÀÏÒÈÂÍÛÉ ÁËÎÊ ÈÇÎÁÐÀÆÅÍÈÉ ÂÎÐÎÒ --- */
.sim-calc-scope .sim-gate-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: auto;
    max-height: 400px;
    aspect-ratio: 475 / 350; /* Ñîõðàíÿåò ïðîïîðöèè âîðîò ïðè ñæàòèè */
    background-color: #e5ebf8;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- ÎÁÙÈÅ ÑÒÈËÈ ÄËß ÈÇÎÁÐÀÆÅÍÈÉ Â ÊÀÍÂÀÑÅ ÎÊÎÍ --- */
.sim-calc-scope .sim-dynamic-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Êàðòèíêà ïîëíîñòüþ âïèñûâàåòñÿ áåç äåôîðìàöèè è îáðåçêè */
    position: absolute;
    top: 0; left: 0;
    z-index: 5;
    transition: opacity 0.25s ease-in-out;
}

.sim-calc-scope .sim-gate-fallback-mesh {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px 0;
    background-color: #ffffff;
    transition: background 0.3s;
}

.sim-calc-scope .sim-panel-section {
    height: 22%;
    width: 100%;
    border-top: 1px solid rgba(0,0,0,0.08);
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* ÔÎËËÁÅÊÈ ÄËß ÄÂÅÐÅÉ (ïîêà êàðòèíêè ãðóçÿòñÿ) */
.sim-calc-scope .sim-door-fallback-bg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}
.sim-calc-scope .sim-door-fallback-glass {
    width: 18px;
    height: 200px;
    background: linear-gradient(135deg, #e3f2fd 0%, #90caf9 100%);
    border: 2px solid #546e7a;
    display: none; 
    box-shadow: inset 0 0 6px rgba(0,0,0,0.2);
}

.sim-calc-scope .sim-calc-controls { padding: 40px; }
.sim-calc-scope .sim-step-box { display: flex; margin-bottom: 35px; gap: 20px; }

.sim-calc-scope .sim-step-badge {
    background-color: #f1f5fc; 
    border: 1px solid #e5ebf8;
    color: #00349a;
    width: 40px; height: 40px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; flex-shrink: 0;
}

.sim-calc-scope .sim-step-content { flex-grow: 1; }
.sim-calc-scope .sim-control-label { display: block; font-size: 14px; font-weight: 700; color: #001e29; margin-bottom: 14px; }
.sim-calc-scope .sim-size-row { display: flex; align-items: center; gap: 12px; }
.sim-calc-scope .sim-size-separator { font-weight: 700; color: #00349a; font-size: 20px; }
.sim-calc-scope .sim-select-custom { position: relative; width: 100%; }
.sim-calc-scope .sim-select-custom select {
    width: 100%; padding: 12px; border: 1px solid #cbd5e0; border-radius: 4px;
    background-color: #ffffff; font-size: 14px; font-weight: 600; color: #001e29;
    appearance: none; cursor: pointer;
}
.sim-calc-scope .sim-select-custom::after {
    content: ""; font-size: 11px; color: #00349a;
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%); pointer-events: none;
}

.sim-calc-scope .sim-tiles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; }
.sim-calc-scope .sim-tile-card {
    border: 1px solid #e5ebf8; border-radius: 10px; overflow: hidden;
    cursor: pointer; background: #f1f5fc; transition: all 0.2s; display: flex; flex-direction: column;
}
.sim-calc-scope .sim-tile-card:hover { box-shadow: 0 4px 10px rgba(0,0,0,8%); }
.sim-calc-scope .sim-tile-card.active { border-color: #00349a !important; background: #ffffff; box-shadow: 0 0 0 2px rgba(0, 52, 154, 0.1); }

/* Êîíòåéíåð êàðòèíêè-èêîíêè äëÿ ïëèòîê âûáîðà */
.sim-calc-scope .sim-tile-image-container {
    height: 75px;
    width: 100%;
    border-bottom: 1px solid #e5ebf8;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 6px;
}
.sim-calc-scope .sim-tile-img-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sim-calc-scope .sim-tile-pattern {
    height: 60px; width: 100%; border-bottom: 1px solid #e5ebf8; background-repeat: no-repeat; background-position: center;
}
.sim-calc-scope .pattern-woodgrain { background-image: repeating-linear-gradient(45deg, rgba(0, 52, 154, 0.02) 0px, rgba(0, 52, 154, 0.02) 2px, transparent 2px, transparent 10px); }
.sim-calc-scope .pattern-decograin { background: linear-gradient(45deg, #a66038 0%, #d99c52 50%, #8f4f24 100%); }

.sim-calc-scope .sim-tile-meta { padding: 10px; text-align: center; }
.sim-calc-scope .sim-tile-meta strong { display: block; font-size: 13px; color: #001e29; }
.sim-calc-scope .sim-tile-meta span { display: block; font-size: 11px; color: #555555; margin-top: 3px; }

.sim-calc-scope .sim-colors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.sim-calc-scope .sim-color-card { border: 1px solid #e5ebf8; border-radius: 6px; padding: 10px; cursor: pointer; display: flex; align-items: center; gap: 10px; background: #f1f5fc; }
.sim-calc-scope .sim-color-card.active { border-color: #00349a !important; background-color: #ffffff; box-shadow: 0 0 0 2px rgba(0, 52, 154, 0.08); }
.sim-calc-scope .sim-color-preview { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.15); flex-shrink: 0; }
.sim-calc-scope .sim-color-details { font-size: 12.5px; }
.sim-calc-scope .sim-color-name { font-weight: 600; color: #001e29; }
.sim-calc-scope .sim-color-price { color: #00349a; font-weight: 600; margin-top: 1px; }

.sim-calc-scope .sim-option-card {
    display: flex; align-items: flex-start; padding: 14px;
    border: 1px solid #e5ebf8; border-radius: 6px; background: #f1f5fc; margin-bottom: 10px;
    transition: opacity 0.2s, background-color 0.2s;
}
.sim-calc-scope .sim-option-card input[type="radio"],
.sim-calc-scope .sim-custom-checkbox { margin-top: 4px; accent-color: #00349a; width: 16px; height: 16px; flex-shrink: 0; }
.sim-calc-scope .sim-option-card label { display: flex; flex-direction: column; margin-left: 12px; cursor: pointer; width: 100%; }
.sim-calc-scope .sim-option-title { font-weight: 700; color: #00349a; font-size: 14px; }
.sim-calc-scope .sim-option-desc { color: #555555; font-size: 12px; margin-top: 2px; }

/* Áëîêèðîâêà ïðèâîäà */
.sim-calc-scope .sim-option-card.sim-disabled {
    opacity: 0.45; background-color: #f7f9fc; border-color: #e2e8f0; pointer-events: none;
}
.sim-calc-scope .sim-option-card.sim-disabled input { pointer-events: none; }
.sim-calc-scope .sim-option-card .sim-drive-error-msg {
    display: none; color: #d32f2f; font-size: 11px; font-weight: 700; margin-top: 5px;
}
.sim-calc-scope .sim-option-card.sim-disabled .sim-drive-error-msg { display: block; }

.sim-calc-scope .sim-global-summary-box { background-color: #f1f5fc; border-top: 1px solid #e5ebf8; padding: 30px 40px; }
.sim-calc-scope .sim-summary-items-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.sim-calc-scope .sim-summary-col { display: flex; flex-direction: column; }
.sim-calc-scope .sim-summary-checkbox { display: flex; align-items: center; cursor: pointer; }
.sim-calc-scope .sim-summary-checkbox input { position: absolute; opacity: 0; }
.sim-calc-scope .sim-summary-checkbox-box {
    height: 22px; width: 22px; background-color: #ffffff; border: 1px solid #cbd5e0;
    border-radius: 4px; margin-right: 12px; display: inline-block; position: relative; flex-shrink: 0;
}
.sim-calc-scope .sim-summary-checkbox input:checked ~ .sim-summary-checkbox-box { background-color: #00349a; border-color: #00349a; }
.sim-calc-scope .sim-summary-checkbox-box:after {
    content: ""; position: absolute; display: none; left: 7px; top: 3px; width: 5px; height: 10px;
    border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.sim-calc-scope .sim-summary-checkbox input:checked ~ .sim-summary-checkbox-box:after { display: block; }
.sim-calc-scope .sim-summary-product-title { font-size: 15px; font-weight: 700; color: #001e29; }
.sim-calc-scope .sim-summary-sub-price { font-size: 18px; font-weight: 700; color: #00349a; margin-top: 5px; margin-left: 34px; }
.sim-calc-scope .sim-summary-divider { border: 0; height: 1px; background: #cbd5e0; margin: 20px 0; }
.sim-calc-scope .sim-total-wrapper-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.sim-calc-scope .sim-total-label { font-size: 13px; font-weight: 800; color: #001e29; text-transform: uppercase; }
.sim-calc-scope .sim-total-price { font-size: 34px; font-weight: 800; color: #00349a; margin-top: 4px; }
.sim-calc-scope .sim-submit-btn {
    padding: 14px 35px; background-color: #00349a; color: #ffffff; border: none; border-radius: 4px;
    font-size: 14px; font-weight: 600; text-transform: uppercase; cursor: pointer; transition: all 0.2s ease-in-out;
}
.sim-calc-scope .sim-submit-btn:hover { background-color: #cbd5e0; color: #001e29; }

.sim-calc-scope .sim-modal-wrapper {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 30, 41, 0.45);
    display: none; align-items: center; justify-content: center; z-index: 999999; padding: 15px;
}
.sim-calc-scope .sim-modal-box { background: #ffffff; max-width: 480px; width: 100%; border-radius: 10px; padding: 35px; position: relative; border: 1px solid #e5ebf8; }
.sim-calc-scope .sim-modal-close { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 30px; cursor: pointer; color: #888888; }
.sim-calc-scope .sim-modal-box h3 { margin: 0 0 10px 0 !important; color: #00349a !important; font-size: 18px !important; font-weight: 700; }
.sim-calc-scope .sim-modal-box p { font-size: 13.5px; color: #555555; margin-bottom: 20px !important; line-height: 1.4; }
.sim-calc-scope .sim-form-group { margin-bottom: 15px; }
.sim-calc-scope .sim-form-group label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: #001e29; }
.sim-calc-scope .sim-form-group input { width: 100%; padding: 11px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 14px; }
.sim-calc-scope .sim-form-btn { width: 100%; padding: 13px; background: #00349a; color: #ffffff; border: none; border-radius: 4px; font-weight: 600; cursor: pointer; text-transform: uppercase; }
.sim-calc-scope .sim-form-btn:hover { background-color: #e5ebf8; color: #001e29; }

/* --- ÌÅÄÈÀ-ÇÀÏÐÎÑÛ ÄËß ÀÄÀÏÒÈÂÍÎÑÒÈ (ÏËÀÍØÅÒÛ È ÒÅËÅÔÎÍÛ) --- */
@media (max-width: 991px) {
    .sim-calc-scope .sim-tab-grid { flex-direction: column; }
    .sim-calc-scope .sim-col-left, .sim-calc-scope .sim-col-right { width: 100%; flex: 0 0 100%; }
    .sim-calc-scope .sim-calc-visual { border-right: none; border-bottom: 1px solid #e5ebf8; padding: 25px; }
    .sim-calc-scope .sim-calc-controls { padding: 25px; }
    .sim-calc-scope .sim-summary-items-grid { grid-template-columns: 1fr; gap: 15px; }
    .sim-calc-scope .sim-doors-double-container { max-width: 100%; }
}

@media (max-width: 479px) {
    .sim-calc-scope .sim-door-view-label { font-size: 10px; }
    .sim-calc-scope .sim-doors-double-container { gap: 10px; }
}