/* Harta tarifelor — pagina /harta-tarife/ (page-harta-tarife.php).
   Toate clasele încep cu `ht-`, ca să nu se amestece cu restul temei. */

.ht-card {
  /* Rampa de culori: deschis = ieftin, închis = scump */
  --ht-s1: #b7d3f6; --ht-s2: #6da7ec; --ht-s3: #2a78d6; --ht-s4: #1c5cab; --ht-s5: #0d366b;
  display: grid;
  grid-template-columns: 1fr 320px;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.ht-map-area { padding: 20px 20px 16px; min-width: 0; }
.ht-map-head h2 { margin: 0; font-size: 20px; color: var(--navy); }
.ht-map-head p { margin: 2px 0 6px; color: var(--gray-text); font-size: 14px; }

.ht-map { width: 100%; height: auto; display: block; overflow: visible; }
.ht-base path { fill: var(--navy); }
.ht-county {
  stroke: #fff; stroke-width: 1.2; stroke-linejoin: round;
  cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent;
}
/* Stratul de deasupra (selecție, mouse, conturul Hunedoarei) nu primește click-uri */
.ht-lift { pointer-events: none; }
.ht-lift path {
  stroke: #fff; stroke-width: 1.2; stroke-linejoin: round;
  transform: translate(-2px, -4px);
  filter: drop-shadow(2px 5px 0 rgba(10,37,64,.55));
}
.ht-lift path.ht-sel { stroke: var(--amber); stroke-width: 3; }
.ht-lift path.ht-home { fill: none; stroke: var(--amber); stroke-width: 2.4; transform: none; filter: none; }
.ht-codes text {
  font-size: 10px; font-weight: 600; text-anchor: middle; dominant-baseline: middle;
  pointer-events: none; fill: var(--navy);
}
.ht-codes text.ht-on-dark { fill: #fff; }
.ht-callout { pointer-events: none; }
.ht-callout text { font-size: 13px; font-weight: 800; fill: var(--navy); }
.ht-callout line { stroke: var(--navy); stroke-width: 1.2; }
.ht-callout rect { fill: #fff; stroke: var(--amber); stroke-width: 1.5; }

.ht-legend {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: var(--gray-text); margin-top: 8px;
}
.ht-legend-wrap { display: flex; flex-direction: column; gap: 2px; }
.ht-sw, .ht-ticks { display: flex; gap: 2px; }
.ht-sw span { display: block; width: 48px; height: 12px; }
.ht-sw span:first-child { border-radius: 4px 0 0 4px; }
.ht-sw span:last-child { border-radius: 0 4px 4px 0; }
.ht-ticks { font-variant-numeric: tabular-nums; }
.ht-ticks span { width: 48px; text-align: center; }
.ht-nd { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; }
.ht-nd i {
  width: 20px; height: 12px; border-radius: 3px; border: 1px solid #a9b6c6;
  background: repeating-linear-gradient(45deg, #eef1f5 0 3px, #a9b6c6 3px 5px);
}

/* Fereastra de lângă mouse: fixă pe ecran, ca să nu fie tăiată de marginea secțiunii */
.ht-tip {
  position: fixed; z-index: 1000; pointer-events: none; opacity: 0; transition: opacity .1s;
  min-width: 170px; max-width: 260px; padding: 8px 10px;
  background: #fff; border: 1px solid var(--gray-border); border-radius: 8px; box-shadow: var(--shadow-md);
  font-size: 13px; color: var(--text);
}
.ht-tip b { display: block; color: var(--navy); font-size: 14px; }
.ht-tip .ht-v { font-size: 20px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.ht-tip .ht-unit { color: var(--gray-text); }

/* Panoul cu operatorii județului */
.ht-side {
  background: var(--blue-pale); border-left: 1px solid var(--gray-border);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 20px; display: flex; flex-direction: column;
}
.ht-side h3 { margin: 0; font-size: 22px; color: var(--navy); }
.ht-sub { color: var(--gray-text); font-size: 13px; margin: 2px 0 14px; }
.ht-op { background: #fff; border: 1px solid var(--gray-border); border-radius: var(--radius-md); padding: 12px; margin-bottom: 10px; }
.ht-op.ht-ours { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.ht-op-name { font-weight: 600; font-size: 14px; margin-bottom: 8px; color: var(--text); }
.ht-op-name em {
  font-style: normal; font-size: 11px; background: var(--amber); color: #fff;
  border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px;
}
.ht-op dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; margin: 0; font-size: 13px; }
.ht-op dt { color: var(--gray-text); }
.ht-op dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.ht-op dd.ht-t { font-weight: 800; color: var(--navy); font-size: 15px; }
.ht-bar { height: 6px; border-radius: 3px; background: var(--gray-border); margin-top: 8px; position: relative; overflow: hidden; }
.ht-bar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 3px; background: var(--ht-s3); }
.ht-note { font-size: 12px; color: var(--gray-text); margin: 5px 0 0; }

.ht-src { font-size: 12px; color: var(--gray-text); margin-top: 16px; }

/* Lista de județe și butonul „Înapoi la hartă": doar pe ecrane înguste */
.ht-pick, .ht-back { display: none; }
.ht-pick { flex-direction: column; gap: 4px; margin: 4px 0 10px; font-size: 13px; color: var(--gray-text); }
.ht-pick select {
  width: 100%; min-height: 44px; padding: 8px 12px;
  font: inherit; font-size: 16px; /* 16px: iPhone nu mai mărește pagina la atingere */
  color: var(--text);
  border: 1px solid var(--gray-border); border-radius: var(--radius-md);
  /* același aspect pe iPhone și Android: fără fundalul gri implicit din Safari */
  -webkit-appearance: none; appearance: none; padding-right: 40px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230d3a62' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.ht-back {
  margin-top: 4px; min-height: 44px; padding: 10px 14px; width: 100%;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--navy-mid);
  background: #fff; border: 1px solid var(--gray-border); border-radius: var(--radius-md); cursor: pointer;
}

@media (max-width: 900px) {
  .ht-card { grid-template-columns: 1fr; }
  .ht-side {
    border-left: 0; border-top: 1px solid var(--gray-border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
  .ht-pick { display: flex; }
  .ht-back { display: block; }
}

@media (max-width: 600px) {
  /* mai puțin spațiu pe margini, ca harta să fie cât mai mare */
  .ht-map-area { padding: 16px 10px 14px; }
  .ht-map-head, .ht-legend { padding: 0 6px; }
  .ht-side { padding: 16px 12px; }
  /* la lățimea asta literele județelor și eticheta ar ieși de ~5px: nu se pot citi */
  .ht-codes, .ht-callout { display: none; }
  .ht-legend-wrap { flex: 1 1 100%; }
  .ht-sw span, .ht-ticks span { flex: 1; width: auto; }
}
