
/* JustFind. Ασπρόμαυρο εργαλείο με ένα μόνο χρώμα (κόκκινο) για ό,τι είναι «σημείο στον χάρτη» ή επιλεγμένο. */
:root {
  --ink: #16191d;
  --text: #3d444d;
  --muted: #68707b;
  --line: #dfe2e6;
  --soft: #f4f5f6;
  --accent: #c62828;
  --ok: #1a7f4b;
  --warn: #8f5500;
  --pad: clamp(16px, 4vw, 48px);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; background: #fff; min-width: 320px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button, .store-card, .secondary-btn, .primary-btn { transition: background-color .15s cubic-bezier(.22, 1, .36, 1), border-color .15s cubic-bezier(.22, 1, .36, 1), color .15s cubic-bezier(.22, 1, .36, 1); }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h2, h3 { font-weight: 500; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── Κεφαλίδα ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  min-height: 64px; padding: 8px var(--pad);
  background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; white-space: nowrap; }
.brand-mark { display: grid; }
.brand-mark svg { width: 20px; height: 20px; fill: var(--accent); }

.header-search {
  flex: 1; max-width: 720px; height: 44px;
  display: flex; align-items: center; gap: 8px; padding-left: 12px;
  border: 1px solid #b9bfc7; border-radius: 8px; background: #fff;
}
.header-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.header-search svg { width: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.header-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; }
.header-search input::placeholder { color: var(--muted); }
.search-submit {
  align-self: stretch; margin: -1px; padding: 0 20px;
  border: 0; border-radius: 0 7px 7px 0; background: var(--ink); color: #fff; font-weight: 500;
}
.search-submit:hover { background: #000; }

.location-pill {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.location-pill:hover { border-color: var(--ink); }
.location-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.location-pill.off .location-dot { background: #b3b9c1; }
#location-label { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }

.loc-panel {
  position: absolute; right: var(--pad); top: 60px; z-index: 30;
  width: min(320px, calc(100vw - 32px)); display: grid; gap: 12px; padding: 16px;
  background: #fff; border: 1px solid var(--ink); border-radius: 8px;
}
.loc-panel[hidden] { display: none; }
.loc-panel form { display: flex; gap: 8px; }
.loc-panel input { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid #b9bfc7; border-radius: 8px; }
.loc-panel small { color: var(--muted); font-size: 12px; }

.main-nav {
  display: flex; align-items: center; gap: 24px;
  height: 40px; padding: 0 var(--pad);
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.nav-link { height: 100%; display: flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); border-bottom-color: var(--ink); }
.favorite-count { font-variant-numeric: tabular-nums; color: var(--muted); }
.favorite-count::before { content: '('; }
.favorite-count::after { content: ')'; }
.nav-spacer { flex: 1; }
.privacy-note { color: var(--muted); font-size: 12px; }

/* ── Κουμπιά ── */
.primary-btn, .secondary-btn { display: inline-block; padding: 8px 16px; border-radius: 8px; font-weight: 500; font-size: 14px; }
.primary-btn { border: 1px solid var(--ink); background: var(--ink); color: #fff; }
.primary-btn:hover { background: #000; }
.secondary-btn { border: 1px solid #b9bfc7; background: #fff; }
.secondary-btn:hover { border-color: var(--ink); }
.secondary-btn.small { padding: 4px 12px; font-size: 13px; }
.link-btn { padding: 4px 0; border: 0; background: none; font-size: 13px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--accent); }

.filter-chip { padding: 4px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
.filter-chip:hover { border-color: var(--ink); }
.filter-chip.selected { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── Αρχική ── */
.page { min-height: calc(100vh - 170px); }
/* Ο χάρτης με όλα τα καταστήματα γεμίζει τη σελίδα· το πλαίσιο αναζήτησης κάθεται αριστερά, πάνω στη θάλασσα. */
.home { position: relative; display: flex; align-items: center; min-height: calc(100vh - 105px); }
.home-map { position: absolute; inset: 0; background: var(--soft); }
.hero {
  position: relative; z-index: 1; width: 512px; margin: 32px 0 32px var(--pad); padding: 32px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}
.hero h1 { font-size: 40px; line-height: 1.08; letter-spacing: -.02em; font-weight: 500; }
.hero .lead { margin: 16px 0 24px; }
.hero .header-search { max-width: none; height: 56px; font-size: 17px; }
.hero-stats { margin-top: 12px; min-height: 20px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; color: var(--muted); font-size: 13px; }
.lead { max-width: 62ch; color: var(--text); font-size: 16px; }

/* ── Αποτελέσματα ── */
.search-layout { display: grid; grid-template-columns: minmax(380px, 480px) 1fr; }
.results-panel { padding: 24px clamp(16px, 2.2vw, 32px) 32px; border-right: 1px solid var(--line); }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.results-head h1 { font-size: 20px; font-weight: 500; }
.sort-select { padding: 4px 8px; height: 32px; border: 1px solid #b9bfc7; border-radius: 8px; background: #fff; font-size: 13px; }
.result-count { color: var(--text); font-size: 14px; margin-bottom: 12px; }
.result-count strong { color: var(--ink); }
.hint { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--ink); }
.more-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.filter-row.plain { padding-bottom: 8px; border-bottom: 0; }
.filter-row span { align-self: center; margin-right: 4px; color: var(--muted); font-size: 13px; }
.checked-note { margin-top: 16px; color: var(--muted); font-size: 12px; }

.store-card {
  display: grid; grid-template-columns: 1fr auto; gap: 16px;
  padding: 16px 12px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; cursor: pointer;
}
.store-card:hover { background: var(--soft); }
.store-card.selected { background: var(--soft); border-left-color: var(--accent); }
.store-copy { min-width: 0; }
.store-name { font-size: 15px; font-weight: 500; word-break: break-word; }
.store-distance { color: var(--muted); font-size: 13px; }
.item-name { margin: 4px 0; color: var(--text); font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sku { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.sku b { color: var(--ink); font-weight: 600; }

.stock { font-size: 13px; font-weight: 500; white-space: nowrap; }
.stock::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: currentColor; vertical-align: 1px; }
.stock.available { color: var(--ok); }
.stock.order { color: var(--warn); }
.stock.unknown { color: var(--muted); }
.more-note { margin-left: 12px; color: var(--muted); font-size: 12px; }
.more-note.exact { color: var(--ink); font-weight: 600; }

.card-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; font-size: 13px; }
.card-links a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #b9bfc7; }
.card-links a:hover { text-decoration-color: var(--ink); }
.card-end { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.price { font-size: 18px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mini-heart { display: grid; padding: 4px; margin: -4px; border: 0; background: none; color: var(--muted); }
.mini-heart svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.mini-heart.saved svg { fill: currentColor; }
.mini-heart:hover, .mini-heart.saved { color: var(--accent); }

.no-results { padding: 32px 4px; color: var(--text); font-size: 14px; }
.no-results strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.skeleton { height: 104px; border-bottom: 1px solid var(--line); background: var(--soft); animation: wait 1.2s ease-in-out infinite alternate; }
@keyframes wait { to { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { transition: none !important; } }

/* ── Χάρτης ── */
.map-panel { position: sticky; top: 64px; height: calc(100vh - 64px); background: var(--soft); }
#map { position: absolute; inset: 0; }
.map-note { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }
.map-pin { display: block; width: 18px; height: 18px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px #00000040; }
.map-pin.approx { background: #fff; border-color: var(--accent); }
.map-pin.active { background: var(--ink); border-color: #fff; transform: scale(1.35); }
.my-location { width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: #1a66ff; box-shadow: 0 0 0 6px #1a66ff33; }
.mapboxgl-popup-content { padding: 8px 12px; border-radius: 8px; font: 13px/1.4 'IBM Plex Sans', system-ui, sans-serif; box-shadow: 0 1px 4px #00000040; }
.mapboxgl-popup-content small { color: var(--text); font-size: 13px; }

/* ── Σελίδα καταστήματος και σελίδες κειμένου ── */
.detail-wrap, .content-wrap { max-width: 1080px; margin: 0 auto; padding: 32px var(--pad) 56px; }
.detail-wrap h1, .content-wrap h1 { font-size: clamp(28px, 4vw, 36px); font-weight: 500; line-height: 1.15; margin-bottom: 12px; }
.back-link { display: inline-block; margin-bottom: 20px; font-size: 13px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 40px; }
.shop-facts { display: grid; gap: 2px; color: var(--text); }
.detail-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 8px; }
.detail-section-title { margin-top: 28px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); font-size: 16px; }
.detail-aside h3 { font-size: 14px; margin-bottom: 12px; }
.mini-map { margin-bottom: 12px; border: 1px solid var(--line); }
.mini-map img { display: block; width: 100%; height: auto; aspect-ratio: 370 / 215; background: var(--soft); } /* ο χώρος κρατιέται πριν έρθει η εικόνα, να μην πηδά η σελίδα */

.store-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.store-row-name { font-weight: 500; }
.store-row-sub { color: var(--muted); font-size: 13px; }
.store-row-right { display: grid; justify-items: end; gap: 8px; }

.content-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 32px; }
.info-card { padding-top: 12px; border-top: 2px solid var(--ink); }
.info-card h3 { font-size: 16px; margin-bottom: 8px; }
.info-card p { color: var(--text); font-size: 14px; }
.content-card { max-width: 70ch; margin-top: 40px; }
.content-card h2 { font-size: 18px; margin-bottom: 8px; }
.content-card p, .content-card li { color: var(--text); margin-bottom: 8px; }
.content-card ul { padding-left: 20px; margin: 0 0 8px; }
.content-card code, .content-card pre { background: var(--soft); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: 13px; }
.content-card pre { padding: 12px; overflow: auto; }

.empty-state { padding: 40px 0; }
.empty-state h2 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--text); margin-bottom: 16px; }
.favorites-grid { margin-top: 24px; border-top: 1px solid var(--ink); }
.favorite-product { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.favorite-product h3 { font-size: 15px; }
.favorite-product p { color: var(--muted); font-size: 13px; }
.favorite-actions { display: flex; align-items: center; gap: 16px; flex: none; }
.favorite-actions button { padding: 4px 0; border: 0; background: none; font-size: 13px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── Υποσέλιδο, ειδοποίηση ── */
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 20px var(--pad); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.toast { position: fixed; left: 50%; bottom: 20px; z-index: 50; transform: translateX(-50%); padding: 8px 16px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.toast.show { opacity: 1; }

/* ── Κινητό ── */
@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; gap: 8px 12px; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .loc-panel { top: 52px; }
  .main-nav { gap: 20px; overflow-x: auto; white-space: nowrap; }
  .privacy-note, .nav-spacer { display: none; }
  .search-layout { display: flex; flex-direction: column; }
  .map-panel { position: relative; top: 0; order: 1; height: 42vh; min-height: 260px; }
  .home { flex-direction: column; align-items: stretch; min-height: 0; }
  .hero { width: auto; margin: 0; padding: 32px var(--pad) 24px; border: 0; border-radius: 0; box-shadow: none; }
  .hero h1 { font-size: 36px; }
  .home-map { position: relative; order: 2; height: 60vh; min-height: 320px; border-top: 1px solid var(--line); }
  .results-panel { order: 2; border-right: 0; }
  .detail-grid { grid-template-columns: 1fr; gap: 24px; }
  .content-grid { grid-template-columns: 1fr; gap: 20px; }
  .favorite-product { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 430px) {
  #location-label { max-width: 96px; }
  .search-submit { padding: 0 12px; }
}

/* Με δάχτυλο: τα μικρά κουμπιά και οι σύνδεσμοι της λίστας παίρνουν ύψος που πατιέται άνετα (40px). */
@media (pointer: coarse) {
  .filter-chip { padding: 8px 12px; min-height: 40px; }
  .card-links a { padding: 10px 0; }
  .card-links { margin-top: 0; }
  .mini-heart { padding: 12px; margin: -12px; }
  .brand { min-height: 40px; }
}
