/* TripMap Builder — конструктор футболок с картой путешествия */
.tm-builder {
  --tm-linen: #f1e8d8;
  --tm-linen-2: #e8dcc7;
  --tm-land: #a9c7c4;
  --tm-ink: #2f3a3a;
  --tm-route: #34403f;
  --tm-gold: #c79a3e;
  --tm-line: #d9cdb6;
  color: var(--tm-ink);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 820px) {
  .tm-builder { grid-template-columns: 1fr; }
}

/* ---- Controls ---- */
.tm-controls { display: flex; flex-direction: column; gap: 18px; }
.tm-field { display: flex; flex-direction: column; gap: 6px; }
.tm-field > label {
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: #6b6256;
}
.tm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tm-builder select,
.tm-builder input[type="text"] {
  width: 100%; box-sizing: border-box;
  padding: 9px 10px; font-size: 14px;
  border: 1px solid var(--tm-line); border-radius: 8px;
  background: #fff; color: var(--tm-ink);
}
.tm-builder select:focus,
.tm-builder input[type="text"]:focus {
  outline: none; border-color: var(--tm-gold);
  box-shadow: 0 0 0 3px rgba(199,154,62,.18);
}
/* сброс стилизации темы у select — одна аккуратная стрелка */
.tm-builder select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  height: auto !important;
  line-height: 1.3 !important;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236b6256' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px 8px !important;
  padding-right: 32px !important;
}
@media (max-width: 560px) {
  .tm-builder .tm-row { grid-template-columns: 1fr; }
}
.tm-leg-title {
  font-size: 13px; font-weight: 700; letter-spacing: .03em;
  color: var(--tm-ink); margin: 2px 0 -4px;
  display: flex; align-items: center; gap: 8px;
}
.tm-leg-title .tm-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tm-gold); }

.tm-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-swatch {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--tm-line);
  cursor: pointer; padding: 0;
}
.tm-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--tm-gold); }

.tm-sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-size {
  min-width: 40px; padding: 7px 10px; cursor: pointer;
  border: 1px solid var(--tm-line); border-radius: 8px;
  background: #fff; font-size: 13px; font-weight: 600;
}
.tm-size[aria-pressed="true"] { border-color: var(--tm-gold); background: #fbf3e2; }

.tm-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.tm-btn {
  padding: 12px 16px; border-radius: 10px; border: 0; cursor: pointer;
  font-size: 15px; font-weight: 700; letter-spacing: .02em;
}
.tm-btn-primary { background: var(--tm-ink); color: #fff; }
.tm-btn-primary:hover { background: #1f2828; }
.tm-btn-ghost { background: transparent; color: var(--tm-ink); border: 1px solid var(--tm-line); }
.tm-btn-ghost:hover { border-color: var(--tm-gold); }
.tm-note { font-size: 12px; color: #8a8275; }

/* ---- Preview ---- */
.tm-preview { display: flex; flex-direction: column; gap: 18px; }
.tm-stage {
  position: relative; border-radius: 14px; overflow: hidden;
  background:
    radial-gradient(120% 120% at 50% 0%, #f7f0e2 0%, var(--tm-linen) 55%, var(--tm-linen-2) 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}
.tm-stage svg { display: block; width: 100%; height: auto; }
.tm-tee-wrap {
  align-self: center; width: 100%; min-width: 200px; max-width: 380px;
}
.tmb-product-image { width: 100%; }
.tmb-product-image .tm-stage { border-radius: 0; }
.tm-tee-wrap .tm-cap {
  text-align: center; font-size: 12px; color: #8a8275; margin-top: 2px;
}

/* artwork text */
.tm-title-text { font-family: "Special Elite", Georgia, serif; fill: var(--tm-ink); }
.tm-sub-text { font-family: "Dancing Script", "Segoe Script", cursive; fill: var(--tm-ink); }
.tm-city-label { font-family: "Special Elite", Georgia, serif; fill: var(--tm-ink); }

.tmb-product-image { --tm-route: #34403f; --tm-ink: #3a4640; --tm-gold: #c79a3e; --tm-land: #a9c7c4; }
/* континенты без границ стран: обводка цветом заливки скрывает швы */
.tm-builder .tm-country, .tmb-product-image .tm-country { fill: var(--tm-land); stroke: var(--tm-land); stroke-width: 1.2; }
.tm-route-line { fill: none; stroke: var(--tm-route); stroke-linecap: round; }
.tm-visited-line { fill: none; stroke: var(--tm-route); stroke-width: 5; stroke-dasharray: 12 13; stroke-linecap: round; opacity: .8; }
.tm-deco-star { fill: var(--tm-gold); opacity: .7; }
.tm-star-visited { opacity: .92; }
.tm-visited-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: stretch; }
.tm-visited-add .tm-add { padding: 9px 14px; border: 1px solid var(--tm-line); background: #fff; border-radius: 8px; cursor: pointer; font-weight: 700; color: var(--tm-ink); white-space: nowrap; }
.tm-visited-add .tm-add:hover { border-color: var(--tm-gold); }
.tm-visited-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: #fbf3e2; border: 1px solid var(--tm-line); border-radius: 999px; font-size: 13px; }
.tm-chip button { border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; color: #8a8275; padding: 0; }
@media (max-width: 560px) {
  .tm-visited-add { grid-template-columns: 1fr 1fr; }
  .tm-visited-add .tm-add { grid-column: 1 / -1; }
}
.tm-star { fill: var(--tm-gold); }
.tm-plane { fill: var(--tm-gold); }
.tm-spark { fill: var(--tm-gold); opacity: .65; }
.tm-ocean { fill: transparent; }

.tm-busy { opacity: .5; pointer-events: none; }
