/* Калькулятор доставки — общий для вкладки профиля и страницы /calculator.
   Поля повторяют форму адреса доставки: тот же выпадающий список стран. */
.ship-calc { display: flex; flex-direction: column; gap: 14px; width: 100%; }

/* Подсказка над формой — основным цветом текста темы (чёрный / белый). */
.ship-calc__lead {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}
.ship-calc__lead[hidden] { display: none; }

.ship-calc__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 560px) {
  .ship-calc__form { grid-template-columns: 1fr; }
}

/* Длина / ширина / высота — одной строкой на всю ширину формы. */
.ship-calc__dims {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 560px) {
  .ship-calc__dims { gap: 10px; }
}

.ship-calc__field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.ship-calc__input {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 15.5px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}
.ship-calc__input:focus { border-color: var(--brand); }

.ship-calc__list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  z-index: 60;
  display: none;
}
.ship-calc__list.open { display: block; }
.ship-calc__item {
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.ship-calc__item:hover { background: var(--surface-muted); color: var(--brand); }
.ship-calc__empty { padding: 9px 12px; font-size: 13px; color: var(--text-muted); }

.ship-calc__result { display: flex; flex-direction: column; gap: 10px; }

/* Разбор расчёта под первой линией. */
.ship-calc__block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 20px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.ship-calc__block-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.ship-calc__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
}
.ship-calc__row span:last-child { color: var(--text); text-align: right; }
.ship-calc__row--strong {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-weight: 700;
}
/* Итоговая сумма — красным, чтобы её находили сразу. */
.ship-calc__row--strong span:last-child {
  color: #e5172b;
  font-size: 17px;
}
html.dark-theme .ship-calc__row--strong span:last-child { color: #ff4053; }
.ship-calc__row--strong { align-items: center; }


.ship-calc__hint {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Линия: карточка-кнопка со стрелкой, под ней раскрывающиеся подробности. */
.ship-calc__section { display: flex; flex-direction: column; gap: 10px; }
.ship-calc__details { display: flex; flex-direction: column; gap: 10px; }
.ship-calc__details[hidden] { display: none; }

.ship-calc__line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.ship-calc__line:hover,
.ship-calc__section.is-open .ship-calc__line { border-color: var(--brand-border); }
.ship-calc__line-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.ship-calc__chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}
.ship-calc__section.is-open .ship-calc__chevron { transform: rotate(180deg); }
.ship-calc__carrier { flex-shrink: 0; width: 48px; height: 30px; display: block; }
.ship-calc__line-name { font-size: 14px; font-weight: 700; color: var(--text); }
.ship-calc__line-rate { margin-top: 2px; font-size: 12.5px; color: var(--text-muted); }
.ship-calc__line-total {
  flex-shrink: 0;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.ship-calc__note { font-size: 13px; color: var(--text-muted); }
.ship-calc__note--volume { color: var(--text); font-weight: 600; }

.ship-calc__info {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Остальные линии (обувь) — отдельной секцией в самом низу. */
.ship-calc__more-title {
  margin-top: 18px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
/* Большой отступ нужен, только когда одежда раскрыта — он уводит остальные
   линии ниже экрана. У свёрнутой одежды он смотрелся бы пустой дырой. */
.ship-calc__more-title--far { margin-top: 72px; }
.ship-calc__section:not(.is-open) + .ship-calc__more-title { margin-top: 8px; }

/* Примечание над формой: актуальность цен и куда писать. В рамке, чтобы
   клиент заметил его до того, как уйдёт искать цену у агента. */
.ship-calc__notice {
  padding: 10px 14px;
  border: 1px solid var(--brand);
  border-radius: 12px;
  background: var(--brand-soft);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
}
.ship-calc__notice a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.ship-calc__notice a:hover { text-decoration: underline; }
.ship-calc__line-eta { margin-top: 2px; font-size: 12.5px; color: var(--text); }

/* Кнопка «Рассчитать»: расчёт идёт только по нажатию. */
.ship-calc__submit {
  align-self: flex-start;
  min-width: 180px;
  padding: 13px 28px;
  border: none;
  border-radius: 12px;
  background: var(--brand);
  color: var(--on-brand);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}
.ship-calc__submit:hover:not(:disabled) { background: var(--brand-strong); }
.ship-calc__submit:disabled { opacity: 0.45; cursor: not-allowed; }
.ship-calc__submit[hidden] { display: none; }
@media (max-width: 560px) {
  .ship-calc__submit { align-self: stretch; }
}

/* Предупреждение о лёгкой посылке — в виде окна «Подтвердите заказ» из
   корзины: шапка с иконкой и крестиком, текст, галочка, две кнопки.
   z-index выше мобильного листа профиля. */
.ship-calc-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ship-calc-modal[hidden] { display: none; }
.ship-calc-modal__dialog {
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
}
.ship-calc-modal__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  background: rgba(var(--brand-rgb), 0.1);
  border-bottom: 1px solid rgba(var(--brand-rgb), 0.22);
}
.ship-calc-modal__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--brand);
}
.ship-calc-modal__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--on-brand);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ship-calc-modal__title {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.ship-calc-modal__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease;
}
.ship-calc-modal__close:hover { background: rgba(0, 0, 0, 0.1); }
html.dark-theme .ship-calc-modal__close { background: rgba(255, 255, 255, 0.1); }
html.dark-theme .ship-calc-modal__close:hover { background: rgba(255, 255, 255, 0.2); }
.ship-calc-modal__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.ship-calc-modal__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
}
.ship-calc-modal__text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Галочка — как в корзине: квадрат со скруглением, отмечено цветом бренда. */
.ship-calc-modal__check {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.ship-calc-modal__check input {
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  margin: 0;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.ship-calc-modal__check input:checked {
  border-color: var(--brand);
  background: rgba(var(--brand-rgb), 0.12);
}
.ship-calc-modal__check input::after {
  content: "";
  width: 10px;
  height: 6px;
  margin-top: -2px;
  border-left: 2.5px solid var(--brand);
  border-bottom: 2.5px solid var(--brand);
  transform: rotate(-45deg) scale(0.6);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.ship-calc-modal__check input:checked::after {
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}

.ship-calc-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.ship-calc-modal__btn {
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.ship-calc-modal__btn--cancel {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
}
.ship-calc-modal__btn--cancel:hover { background: rgba(0, 0, 0, 0.1); }
html.dark-theme .ship-calc-modal__btn--cancel { background: rgba(255, 255, 255, 0.1); }
html.dark-theme .ship-calc-modal__btn--cancel:hover { background: rgba(255, 255, 255, 0.2); }
.ship-calc-modal__btn--ok {
  background: var(--brand);
  color: var(--on-brand);
}
.ship-calc-modal__btn--ok:hover:not(:disabled) { background: var(--brand-strong); }
.ship-calc-modal__btn--ok:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 400px) {
  .ship-calc-modal__header { gap: 10px; padding: 20px 16px; }
  .ship-calc-modal__icon { width: 40px; height: 40px; }
  .ship-calc-modal__body { padding: 20px 16px; }
  .ship-calc-modal__actions { gap: 10px; }
  .ship-calc-modal__btn { flex: 1; padding: 12px 14px; }
}

/* Отметка «Tax-free» у каждой линии DHL — в рамке, без заливки. */
.ship-calc__line-name { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.ship-calc__tag {
  padding: 2px 7px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

/* Страна без тарифов: заметная карточка «доставляем по всему миру» со
   ссылкой на поддержку. Рамка и фон — цвета бренда, без градиентов. */
.ship-calc__world {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 24px;
  border: 1.5px solid var(--brand);
  border-radius: 16px;
  background: var(--brand-soft);
  text-align: center;
}
.ship-calc__world-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand);
}
.ship-calc__world-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--on-brand);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ship-calc__world-title {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 21px;
  font-weight: 800;
  color: var(--text);
}
.ship-calc__world-text {
  max-width: 460px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
}
.ship-calc__world-btn {
  margin-top: 4px;
  padding: 13px 28px;
  border-radius: 12px;
  background: var(--brand);
  color: var(--on-brand);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease;
}
.ship-calc__world-btn:hover { background: var(--brand-strong); }
