/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f0f0;
  color: #333;
  min-height: 100vh;
}

/* ===== LAYOUT ===== */
.app {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

.panel {
  width: 360px;
  min-width: 360px;
  background: #fff;
  padding: 20px;
  overflow-y: auto;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 30px 20px;
  gap: 20px;
}

.price-note {
  margin-top: 8px;
  font-size: 12px;
  color: #666;
  line-height: 1.35;
}

/* ===== ПАНЕЛЬ: ЭЛЕМЕНТЫ ===== */
.panel h2 {
  font-size: 18px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: #4a7c59;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed #ccc;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.control-group label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-row input[type="range"] {
  flex: 1;
  accent-color: #4a7c59;
}

.slider-value {
  min-width: 52px;
  text-align: right;
  font-weight: 700;
  font-size: 15px;
  color: #222;
}

.counter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.counter button {
  width: 32px;
  height: 32px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.counter button:hover { background: #e0e0e0; }
.counter button:active { background: #d0d0d0; }

.counter .counter-value {
  font-size: 18px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.radio-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.radio-group label {
  flex: 1;
  min-width: 60px;
  text-transform: none;
  font-weight: 500;
  font-size: 13px;
  padding: 8px 10px;
  border: 2px solid #ddd;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.radio-group input { display: none; }
.radio-group input:checked + label {
  border-color: #4a7c59;
  background: #e8f5e9;
  color: #2e5a3a;
}

.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active { border-color: #4a7c59; box-shadow: 0 0 0 2px #4a7c59; }

.color-swatch .tooltip {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  white-space: nowrap;
  background: #333;
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}

.color-swatch:hover .tooltip { opacity: 1; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #4a7c59;
  cursor: pointer;
}

.sub-group {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 2px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-group.hidden { display: none; }
.hidden { display: none !important; }

.info-text {
  font-size: 12px;
  color: #888;
  font-style: italic;
}

.disabled-section {
  opacity: 0.5;
  pointer-events: none;
}

/* ===== SELECT ===== */
.styled-select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
  accent-color: #4a7c59;
}

.styled-select:focus {
  outline: 2px solid #4a7c59;
  border-color: #4a7c59;
}

.jaluzi-note {
  font-size: 12px;
  color: #4a7c59;
  font-style: italic;
  padding: 6px 10px;
  background: #e8f5e9;
  border-radius: 6px;
}

/* ===== ЦЕНА ===== */
.price-block {
  background: #f8faf8;
  border: 1px solid #d4e5d8;
  border-radius: 10px;
  padding: 16px;
}

.price-block h3 {
  font-size: 14px;
  color: #555;
  margin-bottom: 8px;
}

.price-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 0;
  color: #666;
}

.price-total {
  display: flex;
  justify-content: space-between;
  font-size: 20px;
  font-weight: 800;
  color: #2e5a3a;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid #4a7c59;
}

.btn-order {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: #4a7c59;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.5px;
}
.price-subtitle {
  font-size: 14px;
  color: #555;
  margin: 8px 0 6px;
  font-weight: 600;
}

.price-subtotal {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #cbdacb;
  font-weight: 700;
  color: #333;
}

.btn-order:hover { background: #3d6a4b; }
.btn-order:active { background: #2e5a3a; }

/* ===== SVG VIEWPORT ===== */
.svg-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 20px;
  width: 100%;
  max-width: 750px;
}

.svg-container svg {
  width: 100%;
  height: auto;
}

.svg-container { position: relative; }

.svg-download{
  position:absolute; right:12px; top:12px;
  width:36px; height:36px; border-radius:10px;
  border:none; background:#ffffffcc;
  box-shadow:0 2px 8px rgba(0,0,0,.15);
  cursor:pointer; font-size:18px;
}

.svg-author{
  position:absolute; left:10px; bottom:10px;
  font-family:'Caveat', cursive;
  font-size:12px; color:#222;
  background:#ffffffcc; padding:4px 10px;
  border-radius:8px;
}
.svg-author a{ color:#1a4ab0; text-decoration:none; }
.author-icon{ margin-right:6px; }

/* ===== МОДАЛЬНОЕ ОКНО ===== */

.info-panel {
  margin-top: 16px;
  padding: 12px;
  background: #f7f7f7;
  border-radius: 10px;
  border: 1px solid #e2e2e2;
  font-size: 14px;
}

.info-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.info-item {
  margin-bottom: 8px;
  background: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  border: 1px solid #eee;
}

.info-item summary {
  cursor: pointer;
  font-weight: 600;
}

.info-item .info-text {
  margin-top: 6px;
  color: #555;
  line-height: 1.35;
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 30px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal h2 {
  margin-bottom: 16px;
  font-size: 20px;
}

.modal .form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal .form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
}

.modal .form-group input,
.modal .form-group textarea {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}

.modal .form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.modal-buttons button {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.btn-send {
  background: #4a7c59;
  color: #fff;
}

.btn-send:hover { background: #3d6a4b; }

.btn-cancel {
  background: #e0e0e0;
  color: #333;
}

.btn-cancel:hover { background: #d0d0d0; }


/* ===== COMPACT PANEL ===== */
.panel { padding: 16px; gap: 10px; }

.panel h2 { font-size: 16px; padding-bottom: 6px; margin-bottom: 2px; }

.section-title { font-size: 13px; margin-top: 4px; padding-top: 6px; }

.control-group { gap: 12px; }
.control-group label { font-size: 11px; letter-spacing: 0.4px; }

.slider-row { gap: 9px; }
.slider-value { font-size: 14px; min-width: 46px; }

.counter button { width: 28px; height: 28px; font-size: 16px; }
.counter .counter-value { font-size: 16px; }

.radio-group label { font-size: 12px; padding: 6px 8px; border-width: 1px; }

.color-palette { gap: 5px; }
.color-swatch { width: 32px; height: 32px; border-radius: 6px; border-width: 2px; }

.checkbox-row { font-size: 13px; }
.checkbox-row input { width: 16px; height: 16px; }

.sub-group { margin-left: 10px; padding-left: 10px; gap: 4px; }

.info-text, .jaluzi-note { font-size: 13px; }

.price-block { padding: 12px; }
.price-block h3 { font-size: 13px; margin-bottom: 6px; }
.price-line { font-size: 12px; }
.price-total { font-size: 18px; margin-top: 8px; padding-top: 8px; }

.btn-order { padding: 12px; font-size: 15px; }
/* ===== RESPONSIVE ===== */
@media (max-width: 800px) {
  .app {
    flex-direction: column;
  }

  .panel {
    width: 100%;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid #ddd;
    order: 2;
  }

  .viewport {
    order: 1;
    padding: 16px 12px;
  }
}

/* ===== INFO PANEL — стиль как у панели ===== */
.info-panel {
  margin-top: 0;
  padding: 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 14px;
  width: 100%;
  max-width: 750px;
}

/* подровнять элементы внутри */
.info-title { font-size: 14px; border-bottom: 2px solid #e0e0e0; padding-bottom: 6px; margin-bottom: 8px; }
.info-item { border: 1px solid #ddd; }


.consent-block {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #555;
}

.consent-label input {
  margin-top: 3px;
  cursor: pointer;
}

.consent-label a {
  color: #1976D2;
}

.consent-label.error {
  color: #d32f2f;
}

.consent-error {
  color: #d32f2f;
  font-size: 12px;
  margin-top: 5px;
  margin-left: 22px;
}


/* ===== MOBILE ORDER ===== */
@media (max-width: 800px) {
  .viewport { display: contents; }
  .svg-container { order: 1; }
  .panel { order: 2; }
  .info-panel { order: 3; }
}

@media (max-width: 768px){
  .svg-container{
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
  }
}