/* Costa del Sol: navštívené nehnuteľnosti. Minimalistická mapa na celú obrazovku. */
:root { --text: #141414; --tlmeny: #6b6b6b; --akcent: #D9512C; --cervena: #E0312B; --biela: #fff; --tien: 0 6px 24px rgba(0, 0, 0, .16); }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: #e9edf0; -webkit-font-smoothing: antialiased; }
#mapa { position: fixed; inset: 0; z-index: 0; background: #d5dadc; }
.leaflet-container { font: inherit; }

/* hlavička */
.hlavicka { position: fixed; z-index: 30; left: max(16px, env(safe-area-inset-left)); top: max(16px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 16px; padding: 12px 16px 11px; border-radius: 14px; background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 2px 12px rgba(0, 0, 0, .08); pointer-events: none; }
.hlavicka h1 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.hlavicka p { margin: 2px 0 0; font-size: 12.5px; color: var(--tlmeny); }
.hlavicka { max-width: calc(100vw - 86px); }
#vyber-tlacidlo, #prepni-upravy { pointer-events: auto; flex: none; height: 34px; padding: 0 14px; border: 1.5px solid #d4d4d4; border-radius: 999px; background: var(--biela); color: var(--text); font: 600 13px/1 inherit; font-family: inherit; cursor: pointer; }
#prepni-upravy[hidden] { display: none; }
#prepni-upravy[aria-pressed="true"], #vyber-tlacidlo[aria-expanded="true"] { background: var(--text); border-color: var(--text); color: var(--biela); }
#prepni-upravy { margin-left: -8px; }
#vyber-tlacidlo { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* výber nehnuteľností zaškrtávaním */
.vyber { position: fixed; z-index: 30; left: max(16px, env(safe-area-inset-left)); top: calc(max(16px, env(safe-area-inset-top)) + 70px); width: min(330px, 100vw - 32px); max-height: min(60vh, 520px); display: flex; flex-direction: column; border-radius: 14px; background: var(--biela); box-shadow: 0 8px 30px rgba(0, 0, 0, .2); overflow: hidden; }
.vyber[hidden] { display: none; }
.v-hore { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid #ececec; font-size: 13.5px; }
.v-hore strong { flex: 1; }
.v-hore button { height: 28px; padding: 0 11px; border: 1px solid #d8d8d8; border-radius: 999px; background: var(--biela); color: var(--text); font: 600 12px/1 inherit; font-family: inherit; cursor: pointer; }
.v-hore button:hover { border-color: var(--text); }
.v-zoznam { overflow-y: auto; padding: 6px 0; }
.v-polozka { display: flex; align-items: center; gap: 11px; padding: 8px 14px; cursor: pointer; }
.v-polozka:hover { background: #f5f5f3; }
.v-polozka input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--cervena); cursor: pointer; }
.v-text { min-width: 0; display: grid; }
.v-nazov { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-podrobnosti { font-size: 11.5px; color: var(--tlmeny); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* pevné body: mestá */
.mesto { position: absolute; pointer-events: none; }
.mesto i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px var(--biela); }
.mesto span { position: absolute; white-space: nowrap; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text); text-shadow: 0 0 3px var(--biela), 0 0 3px var(--biela), 0 0 6px var(--biela); }
.mesto.dole span { left: 0; top: 11px; transform: translateX(-50%); }
.mesto.hore span { left: 0; top: -11px; transform: translate(-50%, -100%); }
.mesto.vpravo span { left: 13px; top: 0; transform: translateY(-50%); }
.mesto.vlavo span { left: -13px; top: 0; transform: translate(-100%, -50%); }
.mesto.vedlajsie i { background: var(--tlmeny); width: 6px; height: 6px; left: -3px; top: -3px; }
.mesto.vedlajsie span { color: var(--tlmeny); font-weight: 600; }

/* nehnuteľnosť na mape: červená bodka (mestá majú čiernu) */
.bod { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--cervena); box-shadow: 0 0 0 3px var(--biela), 0 1px 6px rgba(0, 0, 0, .35); cursor: pointer; transition: transform .15s; }
.bod-obal.aktivna .bod, .bod:hover { transform: scale(1.4); }
.bod-obal:focus-visible { outline: none; }
.bod-obal:focus-visible .bod { outline: 3px solid var(--text); outline-offset: 3px; }
body.upravy .bod { cursor: move; }

/* čiary od bodiek k dlaždiciam */
.ciary { position: fixed; inset: 0; z-index: 10; width: 100%; height: 100%; pointer-events: none; transition: opacity .12s; }
.ciary.skryte { opacity: 0; }
.ciary line { stroke: var(--text); stroke-opacity: .4; stroke-width: 1.25; stroke-linecap: round; }
.ciary line.aktivna { stroke: var(--cervena); stroke-opacity: 1; stroke-width: 2.25; }

/* rad nehnuteľností pri spodku obrazovky (nad morom); pri väčšom počte sa posúva do strany */
.pas { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; gap: 12px; padding: 14px max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; pointer-events: none; }
.pas::-webkit-scrollbar { display: none; }
.np { pointer-events: auto; flex: none; width: 188px; border-radius: 14px; overflow: hidden; background: var(--biela); box-shadow: 0 3px 14px rgba(0, 0, 0, .16); cursor: pointer; outline: 2px solid transparent; outline-offset: -2px; transition: box-shadow .15s, outline-color .15s; }
.np:first-child { margin-left: auto; }
.np:last-child { margin-right: auto; }
.np.aktivna, .np:hover, .np:focus-visible { box-shadow: 0 6px 22px rgba(0, 0, 0, .26); outline-color: var(--cervena); }
.np-foto { position: relative; aspect-ratio: 3 / 2; background: #e3e3e3; }
.np-foto img { display: block; width: 100%; height: 100%; object-fit: cover; }
.np-pocet { position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .58); color: var(--biela); font-size: 10.5px; font-weight: 600; }
.np-prazdne { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--tlmeny); }
.np-text { padding: 9px 11px 10px; }
.np-text p { margin: 0; }
.np-nazov { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-text .np-cena { margin-top: 1px; display: flex; align-items: baseline; gap: 4px; white-space: nowrap; font-size: 15px; font-weight: 700; letter-spacing: -.005em; }
.c-povodna, .c-lomka { font-size: 11.5px; font-weight: 500; color: #5c5c5c; }
.c-navysena { font-size: 15.5px; font-weight: 800; }
.np-text .np-cena.np-bez { display: block; font-size: 12px; font-weight: 500; color: var(--tlmeny); }
.np-miesto { margin-top: 4px; font-size: 11.5px; color: var(--tlmeny); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-text .np-udaje { margin-top: 2px; font-size: 12px; color: #3a3a3a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-cesty { list-style: none; margin: 7px 0 0; padding: 6px 0 0; border-top: 1px solid #ececec; display: grid; gap: 1px; font-size: 11.5px; color: #4a4a4a; }
.np-cesty li { display: flex; justify-content: space-between; gap: 8px; }
.np-cesty strong { font-weight: 600; color: var(--text); white-space: nowrap; }
.np-upravit { display: block; width: 100%; height: 30px; margin-top: 8px; border: 0; border-radius: 8px; background: var(--cervena); color: var(--biela); font: 600 12px/1 inherit; font-family: inherit; cursor: pointer; }

/* ovládanie mapy a podpis podkladu */
.leaflet-bar { border: 0 !important; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); }
.leaflet-bar a { width: 36px; height: 36px; line-height: 35px; color: var(--text); border-bottom-color: #eee; }
.leaflet-top.leaflet-right .leaflet-control-zoom { margin: 10px max(16px, env(safe-area-inset-right)) 0 0; }
.leaflet-control-attribution { font-size: 10.5px; background: rgba(255, 255, 255, .7) !important; }

/* fotky a videá: mriežka všetkých (hlavné zobrazenie) a jedna na celú obrazovku */
.galeria { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: #0e0e0e; color: var(--biela); }
.galeria[hidden] { display: none; }
.galeria button { border: 0; background: rgba(255, 255, 255, .14); color: var(--biela); cursor: pointer; font-family: inherit; }
.galeria button[hidden] { display: none; }
.galeria button:hover { background: rgba(255, 255, 255, .26); }
.g-hore { display: flex; align-items: center; gap: 12px; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
.g-hore p { margin: 0; }
.g-titulok { flex: 1; min-width: 0; }
.g-nazov { font-size: 15.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-info { margin-top: 2px !important; font-size: 12.5px; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-info:empty { display: none; }
.g-pocet { font-size: 13px; color: rgba(255, 255, 255, .78); white-space: nowrap; font-variant-numeric: tabular-nums; }
.galeria .g-vsetky { flex: none; height: 38px; padding: 0 15px 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; }
.galeria .g-vyradit { height: 36px; padding: 0 16px; border-radius: 999px; background: var(--akcent); font-size: 13px; font-weight: 600; }
.galeria .g-vyradit.vratit { background: #2f7d4f; }
.g-zavriet { flex: none; width: 40px; height: 40px; border-radius: 50%; font: 300 26px/38px system-ui, sans-serif; }

/* mriežka */
.galeria[data-rezim="mriezka"] .g-scena, .galeria[data-rezim="celok"] .g-mriezka { display: none; }
.g-mriezka { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-rows: max-content; gap: 6px; align-content: start; padding: 2px max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); scrollbar-width: thin; scrollbar-color: #555 transparent; }
.galeria .g-dlazdica { position: relative; aspect-ratio: 4 / 3; padding: 0; border-radius: 6px; overflow: hidden; background: #222; cursor: zoom-in; }
.g-dlazdica img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.g-dlazdica:hover img { transform: scale(1.035); }
.g-dlazdica:focus-visible { outline: 3px solid var(--biela); outline-offset: -3px; }
.g-dlzka { position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, .66); font-size: 12px; font-weight: 600; }

/* jedna fotka alebo video na celú obrazovku; hlavička leží cez obrázok */
.galeria[data-rezim="celok"] .g-hore { position: absolute; z-index: 3; left: 0; right: 0; top: 0; padding-bottom: 26px; background: linear-gradient(rgba(0, 0, 0, .62), rgba(0, 0, 0, 0)); pointer-events: none; }
.galeria[data-rezim="celok"] .g-hore > * { pointer-events: auto; }
.galeria[data-rezim="celok"] .g-hore button { background: rgba(0, 0, 0, .5); }
.galeria[data-rezim="celok"] .g-hore button:hover { background: rgba(0, 0, 0, .75); }
.galeria[data-rezim="celok"] .g-hore .g-vyradit { background: var(--akcent); }
.galeria[data-rezim="celok"] .g-hore .g-vyradit.vratit { background: #2f7d4f; }
.galeria[data-rezim="celok"] .g-titulok { text-shadow: 0 1px 4px rgba(0, 0, 0, .7); pointer-events: none; }
.galeria[data-rezim="celok"] .g-pocet { padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .5); color: var(--biela); font-weight: 600; }
.galeria[data-rezim="celok"]:not([data-triedenie="1"]) .g-info { display: none; }
.g-scena { position: absolute; inset: 0; }
.g-medium { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.g-medium img, .g-medium video { max-width: 100%; max-height: 100%; object-fit: contain; -webkit-user-select: none; user-select: none; }
.g-medium video { width: 100%; height: 100%; background: #000; }
.g-medium.vyradene img, .g-medium.vyradene video { opacity: .3; }
.g-medium.vyradene::after { content: "Vyradené"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 8px 18px; border-radius: 999px; background: rgba(0, 0, 0, .7); font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }
.galeria .g-sipka { position: absolute; z-index: 2; top: 50%; width: 46px; height: 46px; margin-top: -23px; border-radius: 50%; background: rgba(0, 0, 0, .45); font: 300 30px/42px system-ui, sans-serif; }
.galeria .g-sipka:hover { background: rgba(0, 0, 0, .75); }
.g-spat { left: max(14px, env(safe-area-inset-left)); }
.g-dalej { right: max(14px, env(safe-area-inset-right)); }

/* úprava nehnuteľnosti (len lokálne) */
.editor { position: fixed; inset: 0; z-index: 1500; display: flex; flex-direction: column; background: #f6f6f4; }
.editor[hidden] { display: none; }
.e-hore { display: flex; align-items: center; gap: 16px; padding: 14px 24px; background: var(--biela); border-bottom: 1px solid #e6e6e6; }
.e-titul { flex: 1; min-width: 0; margin: 0; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ulozenie { font-size: 12.5px; color: var(--tlmeny); white-space: nowrap; }
.ulozenie.chyba { color: #b3261e; font-weight: 600; }
.editor button { font-family: inherit; cursor: pointer; }
.e-hotovo { height: 38px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--text); color: var(--biela); font-size: 14px; font-weight: 600; }
.e-telo { flex: 1; overflow-y: auto; padding: 22px 24px 60px; }
.e-telo > * { max-width: 1320px; margin-inline: auto; }
.e-formular { display: grid; grid-template-columns: 2fr 1fr 1.6fr repeat(4, .8fr); gap: 14px; }
.e-pole { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--tlmeny); }
.e-pole.e-poznamka { grid-column: span 4; }
.e-pole.e-odkaz { grid-column: span 3; }
.editor input { width: 100%; height: 40px; padding: 0 11px; border: 1.5px solid #dcdcdc; border-radius: 9px; background: var(--biela); font: 400 14.5px/1 inherit; font-family: inherit; color: var(--text); }
.editor input:focus { outline: none; border-color: var(--akcent); }
.e-telo h3 { margin: 0; font-size: 14px; font-weight: 700; }
.e-cesty { margin-top: 22px; }
.e-cesty > div { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.e-cesty > div:empty { display: none; }
.e-cesty .e-cesta { display: flex; align-items: center; gap: 6px; margin: 0; padding: 5px 6px 5px 5px; border-radius: 11px; background: var(--biela); border: 1px solid #e6e6e6; font-size: 13px; color: var(--tlmeny); }
.e-cesta input { height: 34px; border-radius: 7px; }
.e-cesta input[type="text"] { width: 190px; }
.e-cesta input[type="number"] { width: 72px; }
.e-male { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #ececec; color: var(--text); font-size: 17px; line-height: 1; }
.e-male.siroke { width: auto; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.e-nadpis { display: flex; align-items: baseline; gap: 12px; margin-top: 26px; }
.e-sucet { font-size: 13px; color: var(--tlmeny); }
.e-navod { margin-top: 6px; margin-bottom: 14px; font-size: 13px; color: var(--tlmeny); }
.e-mriezka { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.e-dlazdica { position: relative; border-radius: 10px; overflow: hidden; background: var(--biela); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); cursor: grab; }
.e-dlazdica img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; }
.e-dlazdica.vyradene img { filter: grayscale(1); opacity: .35; }
.e-dlazdica.tahana { opacity: .4; }
.e-dlazdica.ciel { outline: 3px solid var(--akcent); outline-offset: -3px; }
.e-dlazdica.navrh { outline: 3px solid #c26a00; outline-offset: -3px; }
.e-dlazdica.par { outline: 3px solid #2f7d4f; outline-offset: -3px; }
.e-cislo { position: absolute; left: 8px; bottom: 56px; min-width: 24px; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: var(--biela); font-size: 11.5px; font-weight: 600; text-align: center; pointer-events: none; }
.e-stitok.navrh { background: #c26a00; }
.e-navrhy { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; padding: 11px 14px; border-radius: 12px; background: #fff4e6; border: 1px solid #f0cfa3; font-size: 13.5px; }
.e-navrhy[hidden] { display: none; }
.e-navrhy p { flex: 1 1 320px; margin: 0; }
.e-navrhy button { height: 34px; padding: 0 15px; border: 1px solid #d9ab78; border-radius: 999px; background: var(--biela); color: var(--text); font-size: 13px; font-weight: 600; }
.e-navrhy button.hlavne { background: var(--akcent); border-color: var(--akcent); color: var(--biela); }
.e-stitok { position: absolute; left: 8px; top: 8px; padding: 3px 9px; border-radius: 999px; background: var(--akcent); color: var(--biela); font-size: 11.5px; font-weight: 700; pointer-events: none; }
.e-stitok.sedy { background: rgba(0, 0, 0, .6); }
.e-video { position: absolute; right: 8px; top: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, .65); color: var(--biela); font-size: 11.5px; font-weight: 600; pointer-events: none; }
.e-zdroj { position: absolute; right: 8px; top: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .88); color: var(--text); font-size: 11px; font-weight: 600; pointer-events: none; }
.e-akcie { display: flex; gap: 6px; padding: 8px; }
.e-akcie button { flex: 1; height: 32px; border: 1px solid #dcdcdc; border-radius: 8px; background: var(--biela); color: var(--text); font-size: 12.5px; font-weight: 600; }
.e-akcie button:hover { border-color: var(--text); }

@media (max-width: 600px) {
  .hlavicka { padding: 10px 12px 9px 14px; gap: 12px; }
  .hlavicka p { font-size: 11.5px; }
  #vyber-tlacidlo, #prepni-upravy { height: 32px; padding: 0 11px; font-size: 12.5px; }
  .hlavicka h1 { font-size: 15px; }
  .mesto span { font-size: 10px; letter-spacing: .1em; }
  .pas { gap: 10px; padding-top: 12px; }
  .np { width: 158px; }
  .np-text .np-cena { gap: 3px; }
  .c-povodna, .c-lomka { font-size: 10.5px; }
  .c-navysena { font-size: 14px; }
  .g-info { white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .g-hore { gap: 8px; }
  .g-mriezka { grid-template-columns: repeat(3, 1fr); gap: 3px; padding-left: 3px; padding-right: 3px; }
  .galeria .g-dlazdica { aspect-ratio: 1; border-radius: 2px; }
  .g-dlzka { left: 4px; bottom: 4px; padding: 2px 6px; font-size: 10.5px; }
  .galeria[data-rezim="celok"] .g-titulok { visibility: hidden; }
  .galeria .g-sipka { width: 38px; height: 38px; margin-top: -19px; font-size: 26px; line-height: 34px; }
  .g-spat { left: 8px; }
  .g-dalej { right: 8px; }
  .e-formular { grid-template-columns: 1fr 1fr; }
  .e-pole.e-poznamka, .e-pole.e-odkaz, .e-pole.e-nazov { grid-column: span 2; }
}
