/* Harta retelei (/retea_transport) */
.retea { --panou: 380px; position: relative; display: grid; grid-template-columns: var(--panou) 1fr; height: calc(100vh - var(--antet-h)); height: calc(100dvh - var(--antet-h)); min-height: 560px; background: var(--fundal); }
.retea-panou { display: flex; flex-direction: column; min-height: 0; background: var(--suprafata); border-right: 1px solid var(--linie); z-index: 2; }
.retea-cap { padding: 22px 20px 14px; border-bottom: 1px solid var(--linie); }
.retea-cap h1 { font-size: 1.7rem; font-weight: 800; margin: 0 0 14px; }
.retea-cauta { display: flex; gap: 8px; align-items: stretch; }
.retea-cauta .filtru-cauta { flex: 1; min-width: 0; }
.retea-tipuri { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.retea-tip { --c: var(--primar); display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--linie); background: transparent; color: var(--text); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; transition: opacity .2s, border-color .2s; }
.retea-tip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.retea-tip[aria-pressed="false"] { opacity: .45; }
.retea-tip.puncte::before { background: none; border: 2px solid var(--c); box-sizing: border-box; }
.retea-tip:hover { border-color: var(--c); }

.retea-continut { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 20px 22px; }
.retea-titlu { margin: 14px 0 8px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.retea-titlu:first-child { margin-top: 0; }
.retea-grila { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.retea-nr { --c: var(--primar); display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 6px; border: 0; border-radius: var(--raza-mica); background: var(--c); color: var(--ct, #fff); font: inherit; font-weight: 800; cursor: pointer; transition: transform .18s var(--usor), box-shadow .18s; }
.retea-nr:hover, .retea-nr:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 16px -8px var(--c); }
.retea-rand { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-radius: var(--raza-mica); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.retea-rand:hover, .retea-rand:focus-visible { background: var(--suprafata-2); }
.retea-rand small { margin-left: auto; color: var(--text-2); white-space: nowrap; }
.retea-gol { color: var(--text-2); }

.retea-detaliu-cap { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.retea-detaliu-cap .retea-nr { flex: none; min-width: 58px; min-height: 58px; font-size: 1.3rem; cursor: default; }
.retea-detaliu-cap .retea-nr:hover { transform: none; box-shadow: none; }
.retea-detaliu-cap strong { display: block; line-height: 1.25; }
.retea-detaliu-cap small { color: var(--text-2); }
.retea-inapoi { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; padding: 0; border: 0; background: none; color: var(--primar); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.retea-inapoi .ic { width: 1em; height: 1em; transform: rotate(180deg); }
.retea-sens { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: var(--raza-mica); background: var(--suprafata-2); }
.retea-sens button { padding: 8px 6px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font: inherit; font-size: .84rem; font-weight: 600; line-height: 1.2; cursor: pointer; }
.retea-sens button[aria-pressed="true"] { background: var(--suprafata); color: var(--text); box-shadow: var(--umbra); }
.retea-actiuni { margin-bottom: 14px; }
.retea-opriri { list-style: none; margin: 0; padding: 0; }
.retea-opriri li { position: relative; }
.retea-opriri li::before { content: ""; position: absolute; left: 15px; top: 0; bottom: 0; width: 3px; background: var(--c); }
.retea-opriri li:first-child::before { top: 50%; }
.retea-opriri li:last-child::before { bottom: 50%; }
.retea-opriri button { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 6px 8px 9px; border: 0; border-radius: var(--raza-mica); background: none; color: var(--text); font: inherit; font-size: .95rem; text-align: left; cursor: pointer; }
.retea-opriri button:hover, .retea-opriri button:focus-visible { background: var(--suprafata-2); }
.retea-opriri i { flex: none; width: 15px; height: 15px; border-radius: 50%; background: var(--suprafata); border: 3px solid var(--c); }
.retea-opriri li:first-child button, .retea-opriri li:last-child button { font-weight: 700; }

.retea-harta { position: relative; min-width: 0; min-height: 0; z-index: 1; background: var(--suprafata-2); }
.retea-harta .leaflet-tile-pane { filter: grayscale(.85) contrast(.92) brightness(1.04); }
:root[data-theme="dark"] .retea-harta .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(.82) contrast(.9); }
.retea-harta .leaflet-container, .retea-harta.leaflet-container { font: inherit; background: var(--suprafata-2); }
.retea-harta .leaflet-bar a { background: var(--suprafata); color: var(--text); border-color: var(--linie); }
.retea-harta .leaflet-control-attribution { background: var(--suprafata); color: var(--text-2); opacity: .85; }
.retea-harta .leaflet-control-attribution a { color: var(--primar); }
.retea-harta .leaflet-popup-content-wrapper, .retea-harta .leaflet-popup-tip { background: var(--suprafata); color: var(--text); box-shadow: var(--umbra-mare); }
.retea-harta .leaflet-popup-content-wrapper { border-radius: 16px; }
.retea-harta .leaflet-popup-content { margin: 14px 16px; min-width: 210px; font-size: .95rem; line-height: 1.35; }
.retea-harta a.leaflet-popup-close-button { color: var(--text-2); }
.retea-harta .leaflet-tooltip { padding: 3px 9px; border: 0; border-radius: 99px; background: var(--suprafata); color: var(--text); font-weight: 700; box-shadow: var(--umbra); }
.retea-harta .leaflet-tooltip::before { display: none; }
.retea-pop strong { display: block; margin-bottom: 8px; font-size: 1.05rem; }
.retea-pop small { display: block; margin-bottom: 6px; color: var(--text-2); }
.retea-pop .retea-mini { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.retea-pop .retea-nr { min-width: 38px; min-height: 30px; font-size: .84rem; border-radius: 8px; }
.retea-pop .retea-titlu { margin: 10px 0 2px; }
.retea-harta .leaflet-popup-content:has(.retea-titlu) { max-height: 46vh; overflow-y: auto; }
.retea-pop .retea-rand { padding: 6px 4px; font-size: .9rem; font-weight: 600; }
.retea-pop .retea-rand small { display: inline; margin: 0 0 0 auto; }
.retea-pop .retea-mini { margin: 0 4px 8px; }
.retea-harta .leaflet-tooltip:has(.retea-tip-punct) { padding: 8px 12px; border-radius: 12px; white-space: normal; width: max-content; max-width: 240px; }
.retea-tip-punct strong { display: block; line-height: 1.25; }
.retea-tip-punct small { display: block; font-weight: 500; color: var(--text-2); }
.retea-pop a.buton { display: flex; justify-content: center; color: #fff; }

/* cartierele: etichete opace, puse exact peste numele scrise pe harta de fundal */
.retea-cartier { display: flex; justify-content: center; width: 0; height: 0; align-items: center; pointer-events: none; }
.retea-cartier span { flex: none; padding: 5px 11px; border-radius: 99px; background: var(--suprafata); color: var(--text-2); font-size: .66rem; font-weight: 800; letter-spacing: .05em; line-height: 1.2; text-transform: uppercase; white-space: nowrap; transition: opacity .2s; }
.retea-cartier.ascuns span { opacity: 0; }
.retea-cartier.oras span { padding: 6px 14px; color: var(--text); font-size: .95rem; letter-spacing: .12em; }
.retea-cartier.sat span { color: var(--text); font-size: .72rem; }

/* punctele de interes */
.retea-punct { --c: var(--text-2); display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: -12px 0 0 -12px; border: 1.5px solid var(--c); border-radius: 50%; background: var(--suprafata); color: var(--c); box-shadow: var(--umbra); cursor: pointer; transition: transform .15s var(--usor); }
.retea-punct:hover { transform: scale(1.15); }
.retea-punct .ic { width: 13px; height: 13px; }
.retea-punct.spital { --c: var(--c-red); }
.retea-punct.transport { --c: var(--primar); }
.retea-punct.educatie { --c: var(--c-sky); }
.retea-punct.cultura { --c: var(--c-purple); }
.retea-punct.timp { --c: var(--c-green); }
.retea-punct.comert { --c: var(--c-orange); }
.retea-punct.sediu { width: 30px; height: 30px; margin: -15px 0 0 -15px; border-color: #fff; background: var(--primar); color: #fff; }
.retea-punct.sediu .ic { width: 16px; height: 16px; }
.retea-punct { position: relative; }
.retea-punct-nume { display: none; position: absolute; left: calc(100% + 5px); top: 50%; transform: translateY(-50%); padding: 3px 9px; border-radius: 99px; background: var(--suprafata); color: var(--text); box-shadow: var(--umbra); font-size: .76rem; font-weight: 700; line-height: 1.25; white-space: nowrap; pointer-events: none; }
.retea-punct.cu-nume .retea-punct-nume { display: block; }
.retea-punct.mic { flex: none; width: 24px; height: 24px; margin: 0; box-shadow: none; cursor: inherit; }
.retea-harta.are-selectie .leaflet-puncte-pane { opacity: .6; }

.retea-flux { stroke-dasharray: 2 16; stroke-linecap: round; animation: retea-curge 1.1s linear infinite; }
@keyframes retea-curge { to { stroke-dashoffset: -18; } }
.fara-animatii .retea-flux { animation: none; }
@media (prefers-reduced-motion: reduce) { .retea-flux { animation: none; } }

.retea-eu { width: 18px; height: 18px; border-radius: 50%; background: var(--primar); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(5, 139, 140, .25); }
.retea-fara-js { padding: 20px; text-align: center; }

@media (max-width: 860px) {
    /* pe telefon: cautare, harta, apoi lista */
    .retea { display: flex; flex-direction: column; height: auto; min-height: 0; }
    .retea-panou { display: contents; }
    .retea-cap { order: 1; padding: 16px 16px 12px; background: var(--suprafata); border-bottom: 0; }
    .retea-cap h1 { font-size: 1.45rem; }
    .retea-cauta input { font-size: 16px; } /* sub 16px, iPhone mareste pagina la scriere */
    .retea-cauta .unealta { flex: none; min-width: 46px; }
    .retea-tipuri { flex-wrap: nowrap; overflow-x: auto; margin: 10px -16px 0; padding: 0 16px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .retea-tipuri::-webkit-scrollbar { display: none; }
    .retea-tip { flex: none; min-height: 40px; padding: 0 14px; }
    .retea-harta { order: 2; flex: none; width: 100%; height: 56vh; height: 56dvh; min-height: 320px; }
    .retea-continut { order: 3; flex: none; overflow: visible; padding: 16px 16px 96px; background: var(--suprafata); }
    .retea-grila { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); }
    .retea-opriri button { min-height: 44px; }
    .retea-sens button { min-height: 44px; }
    /* detaliile apar intr-un panou lat, jos pe harta */
    .retea-fisa { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 1000; display: flex; flex-direction: column; max-height: 62%; border-radius: 16px; background: var(--suprafata); color: var(--text); box-shadow: var(--umbra-mare); cursor: default; }
    .retea-fisa[hidden] { display: none; }
    .retea-fisa-corp { min-height: 0; overflow-y: auto; padding: 12px 14px 8px; font-size: .95rem; line-height: 1.3; -webkit-overflow-scrolling: touch; }
    .retea-fisa-x { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; border: 0; background: none; color: var(--text-2); font-size: 1.4rem; line-height: 1; cursor: pointer; }
    .retea-fisa .retea-pop strong { padding-right: 34px; margin-bottom: 2px; }
    .retea-fisa .retea-pop small { margin-bottom: 2px; }
    .retea-fisa .retea-pop .retea-titlu { margin-top: 6px; }
    .retea-fisa .retea-pop .retea-rand { padding: 4px 2px; }
    .retea-fisa .retea-pop .retea-mini { gap: 5px; margin: 0 2px 8px; }
    .retea-fisa .retea-pop .retea-nr { min-width: 40px; min-height: 34px; }
}
