/* ============================================================
   КАЛЬКУЛЯТОР — СТИЛІ
   ============================================================
   Все настройки внешнего вида собраны в блоке :root ниже.
   Чтобы подогнать калькулятор под фирменный стиль colorclub.ua —
   меняй значения переменных (цвета, шрифты, скругления), не трогая
   остальной код.
   ============================================================ */

:root {
  /* --- Цвета: подставь сюда фирменные цвета сайта --- */
  --cc-color-bg: #ffffff;
  --cc-color-bg-chip: #89f4c9;
  --cc-color-surface: #f7f7f8;
  --cc-color-border: #e2e2e5;
  --cc-color-text: #1a1a1a;
  --cc-color-text-muted: #6b6b70;
  --cc-color-accent: #1f6feb;      /* основной акцентный цвет (кнопки, активные табы) */
  --cc-color-accent-contrast: #ffffff;
  --cc-color-danger: #d64545;

  /* --- Типографика --- */
  --cc-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --cc-font-size-base: 15px;
  --cc-font-size-title: 22px;
  --cc-font-weight-title: 600;

  /* --- Форма --- */
  --cc-radius: 6px;
  --cc-radius-sm: 4px;
  --cc-gap: 16px;
  --cc-max-width: 640px;
}

.cc-calc {
  box-sizing: border-box;
  max-width: var(--cc-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  background: var(--cc-color-bg);
  border: 1px solid var(--cc-color-border);
  border-radius: var(--cc-radius);
  font-family: var(--cc-font-family);
  font-size: var(--cc-font-size-base);
  color: var(--cc-color-text);
}

.cc-calc *, .cc-calc *::before, .cc-calc *::after {
  box-sizing: border-box;
}

.cc-calc__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--cc-gap);
}

.cc-calc__title {
  font-size: var(--cc-font-size-title);
  font-weight: var(--cc-font-weight-title);
  margin: 0;
  line-height: 1.2;
}

.cc-calc__lang {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.cc-lang-btn {
  border: 1px solid var(--cc-color-border);
  background: var(--cc-color-bg);
  color: var(--cc-color-text-muted);
  border-radius: var(--cc-radius-sm);
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
}

.cc-lang-btn.is-active {
  background: var(--cc-color-text);
  color: var(--cc-color-bg);
  border-color: var(--cc-color-text);
}

.cc-field {
  margin-bottom: var(--cc-gap);
}

.cc-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--cc-color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.cc-select,
.cc-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--cc-color-border);
  border-radius: var(--cc-radius-sm);
  background: var(--cc-color-bg);
  color: var(--cc-color-text);
  font-family: inherit;
  font-size: var(--cc-font-size-base);
  appearance: none;
}

.cc-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%236b6b70'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.cc-select:focus,
.cc-input:focus {
  outline: none;
  border-color: var(--cc-color-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cc-color-accent) 20%, transparent);
}

.cc-toggle {
  display: flex;
  border: 1px solid var(--cc-color-border);
  border-radius: var(--cc-radius-sm);
  overflow: hidden;
}

.cc-toggle__btn {
  flex: 1;
  padding: 10px 8px;
  background: var(--cc-color-bg);
  border: none;
  border-right: 1px solid var(--cc-color-border);
  color: var(--cc-color-text-muted);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.cc-toggle__btn:last-child {
  border-right: none;
}

.cc-toggle__btn.is-active {
  background: var(--cc-color-text);
  color: var(--cc-color-bg);
  font-weight: 600;
}

.cc-input-group {
  display: flex;
  align-items: stretch;
}

.cc-input-group .cc-input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.cc-input-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--cc-color-surface);
  border: 1px solid var(--cc-color-border);
  border-left: none;
  border-top-right-radius: var(--cc-radius-sm);
  border-bottom-right-radius: var(--cc-radius-sm);
  color: var(--cc-color-text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.cc-hidden {
  display: none !important;
}

.cc-subblock {
  background: var(--cc-color-surface);
  border-radius: var(--cc-radius-sm);
  padding: 14px;
  margin-bottom: 12px;
}

.cc-subblock__title {
  font-size: 13px;
  color: var(--cc-color-text-muted);
  margin: 0 0 10px;
}

.cc-dim-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.cc-dim-row .cc-input {
  width: 90px;
  flex: none;
  padding: 8px 10px;
}

.cc-dim-row__x {
  color: var(--cc-color-text-muted);
  font-size: 13px;
}

.cc-dim-row__eq {
  color: var(--cc-color-text-muted);
  font-size: 13px;
  flex: 1;
  white-space: nowrap;
}

.cc-dim-row__remove {
  border: none;
  background: none;
  color: var(--cc-color-danger);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}

.cc-link-btn {
  border: 1px dashed var(--cc-color-border);
  background: var(--cc-color-surface);
  color: var(--cc-color-accent);
  border-radius: var(--cc-radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
}

.cc-add-btn {
  border: 1px dashed var(--cc-color-border);
  background: none;
  color: var(--cc-color-accent);
  border-radius: var(--cc-radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
}

.cc-total-area {
  display: flex;
  justify-content: space-between;
  padding: 10px 4px 4px;
  font-size: 14px;
  color: var(--cc-color-text-muted);
}

.cc-result {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--cc-color-border);
}

.cc-result__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.cc-result__label {
  font-size: 1.2rem;  
  color: var(--cc-color-text-muted);
}

.cc-result__value {
  font-size: 24px;
  font-weight: 700;
  color: var(--cc-color-accent);
}

.cc-packaging {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.cc-pack-chip {
  background: var(--cc-color-bg-chip);
  border: 1px solid var(--cc-color-border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 1rem;
  font-weight: 500;
}

.cc-result__note {
  font-size: 1rem;
  color: var(--cc-color-danger);
  margin: 0;
}

/* --- Адаптив --- */
@media (max-width: 480px) {
  .cc-calc {
    padding: 16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .cc-calc__title {
    font-size: 18px;
  }
  .cc-dim-row .cc-input {
    width: 70px;
  }
  /* 16px — чтобы iOS не увеличивал масштаб страницы при фокусе на поле */
  .cc-input,
  .cc-select {
    font-size: 16px;
  }
  .cc-result__value {
    font-size: 20px;
  }
}

/* --- Кнопки под результатом --- */
.cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.cc-btn {
  flex: 1 1 180px;
  padding: 12px 16px;
  border: 1px solid var(--cc-color-accent);
  border-radius: var(--cc-radius-sm);
  background: var(--cc-color-accent);
  color: var(--cc-color-accent-contrast);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}

.cc-btn--secondary {
  background: var(--cc-color-bg);
  color: var(--cc-color-accent);
}

.cc-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media print {
  .cc-actions { display: none; }
}
