/* ============================================================
   PiacTér — FŐOLDAL (a marketplace_david.php / davidka_marketplace_2.png alapján).
   Önálló fájl, csak a főoldalon töltődik. MINDEN osztály `hp-` prefix.
   Brand: #00a63e. Árnyékok/elrendezés a david referencia szerint.
   ============================================================ */
:root {
  --hp-green: #00a63e;
  --hp-green-dark: #008f34;
  --hp-orange: #f97316;
  --hp-blue: #2563eb;
  --hp-dark: #0f172a;
  --hp-text: #334155;
  --hp-muted: #64748b;
  --hp-line: #e2e8f0;
  --hp-soft: #f8fafc;
  --hp-shadow: 0 20px 60px rgba(15, 23, 42, .10);
}

.hp-wrap { color: var(--hp-dark); }
.hp-wrap a { color: inherit; text-decoration: none; }
.hp-container { width: min(1240px, calc(100% - 32px)); margin: 0 auto; }

/* ===== HERO ===== */
.hp-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 74px 0 40px;
  background: linear-gradient(180deg, #fff 0%, var(--hp-soft) 100%);
}
.hp-hero::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 50%;
  width: 360px;
  height: 360px;
  transform: translateX(-50%);
  background: #dcfce7;
  filter: blur(90px);
  border-radius: 999px;
  opacity: .7;
}
.hp-hero-in { position: relative; z-index: 1; }
.hp-hero h1 {
  max-width: 850px;
  margin: 0 auto;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.05;
  letter-spacing: -2.2px;
  font-weight: 900;
}
.hp-hero h1 span { color: var(--hp-green); }
.hp-lead {
  max-width: 680px;
  margin: 22px auto 0;
  font-size: 18px;
  line-height: 1.7;
  color: var(--hp-muted);
}

/* Kereső doboz */
.hp-search {
  max-width: 890px;
  margin: 34px auto 0;
  background: #fff;
  border: 1px solid var(--hp-line);
  border-radius: 28px;
  padding: 8px;
  box-shadow: var(--hp-shadow);
  display: grid;
  grid-template-columns: 1fr 260px 136px;
  gap: 8px;
}
.hp-field {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-radius: 20px;
  background: #fff;
  color: var(--hp-muted);
  font-size: 15px;
}
.hp-field + .hp-field { border-left: 1px solid #f1f5f9; }
.hp-field input,
.hp-field select {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--hp-dark);
  background: transparent;
  font-weight: 600;
  font-size: 15px;
}
.hp-search-btn {
  border: 0;
  cursor: pointer;
  border-radius: 20px;
  background: var(--hp-green);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  transition: background .2s ease, transform .2s ease;
}
.hp-search-btn:hover { background: var(--hp-green-dark); transform: translateY(-2px); }

/* Kategória-rács (a hero-n belül) — kör-ikon badge, hoverre box-shadow + felmozdulás */
.hp-cats {
  margin: 26px auto 0;
  max-width: 970px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
}
.hp-cat {
  min-height: 110px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--hp-line);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  text-align: center;
}
.hp-cat:hover {
  transform: translateY(-5px);
  border-color: #bbf7d0;
  box-shadow: 0 18px 35px rgba(15, 23, 42, .12);
}
.hp-cat-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  color: var(--hp-green);
  transition: background .2s ease, border-color .2s ease;
}
.hp-cat-badge svg { width: 26px; height: 26px; }
/* Hoverre csak a kártya emelkedik; az ikon SOHA nem tűnik el (marad zöld a körben). */
.hp-cat:hover .hp-cat-badge { background: #dcfce7; border-color: var(--hp-green); }
.hp-cat-name { font-size: 13px; font-weight: 800; color: var(--hp-dark); }

/* Mi van a közelemben */
.hp-nearby { margin-top: 38px; }
.hp-nearby h2 { margin: 0; font-size: 22px; font-weight: 900; }
.hp-nearby p { margin: 10px 0 0; color: var(--hp-muted); }
.hp-loc-btn {
  margin-top: 18px;
  padding: 15px 24px;
  border: 0;
  cursor: pointer;
  border-radius: 18px;
  background: var(--hp-green);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 10px 25px rgba(0, 166, 62, .24);
  transition: background .2s ease, transform .2s ease;
}
.hp-loc-btn:hover { background: var(--hp-green-dark); transform: translateY(-2px); }

/* ===== TÉRKÉP =====
   FIX magasságú szekció: a térkép kitölti, a találati panel RÁÚSZIK (mint a david-en).
   Így soha nincs üres/szürke folt és a magasság kötött. */
.hp-map-sec {
  position: relative;
  height: 660px;
  border-top: 1px solid #eef2f7;
  border-bottom: 1px solid #eef2f7;
  overflow: hidden;
}
.hp-panel {
  position: absolute;
  top: 28px;
  left: 28px;
  bottom: 28px;
  width: 360px;
  max-width: calc(100% - 56px);
  background: #fff;
  border: 1px solid var(--hp-line);
  border-radius: 24px;
  box-shadow: var(--hp-shadow);
  padding: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
}
.hp-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.hp-panel-head h3 { margin: 0; font-size: 20px; font-weight: 900; }
.hp-filter-btn {
  border: 0;
  cursor: pointer;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 10px 13px;
  font-weight: 700;
  font-size: 14px;
  color: var(--hp-text);
  transition: .15s;
}
.hp-filter-btn:hover { background: #e6f6ec; color: var(--hp-green-dark); }
.hp-count { font-size: 13px; color: var(--hp-muted); margin: 2px 0 10px; }
.hp-count strong { color: var(--hp-dark); }
.hp-list { flex: 1; overflow-y: auto; margin: 0 -8px; padding: 0 8px; min-height: 0; }
.hp-card-row {
  display: flex;
  gap: 13px;
  padding: 10px;
  border-radius: 18px;
  transition: background .2s;
  color: inherit;
}
.hp-card-row:hover { background: var(--hp-soft); }
.hp-card-row img,
.hp-card-row .ph {
  width: 96px;
  height: 82px;
  border-radius: 18px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--hp-soft);
}
.hp-card-row .ph { display: grid; place-items: center; font-size: 30px; }
.hp-row-b { min-width: 0; }
.hp-row-b h4 { margin: 2px 0 5px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-row-b p { margin: 0; font-size: 13px; color: var(--hp-muted); }
.hp-row-meta { margin-top: 7px; font-size: 13px; color: var(--hp-green-dark); font-weight: 800; }
.hp-list-empty { padding: 28px 8px; text-align: center; color: var(--hp-muted); font-size: 14px; }

/* Lefelé nyíló szűrő-popup */
.hp-pop {
  position: absolute;
  top: 60px;
  left: 22px;
  right: 22px;
  background: #fff;
  border: 1px solid var(--hp-line);
  border-radius: 18px;
  box-shadow: var(--hp-shadow);
  padding: 18px;
  z-index: 10;
}
.hp-pop[hidden] { display: none; }
.hp-pop h4 { margin: 0 0 12px; font-size: 14px; font-weight: 900; }
.hp-pop-group { margin-bottom: 16px; }
.hp-pop-group:last-of-type { margin-bottom: 0; }
.hp-pop-opts { display: flex; flex-direction: column; gap: 4px; max-height: 150px; overflow-y: auto; }
.hp-pop-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.hp-pop-opt:hover { background: var(--hp-soft); }
.hp-pop-opt input { width: 18px; height: 18px; accent-color: var(--hp-green); }
.hp-pop-range { display: flex; gap: 8px; }
.hp-pop-range input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--hp-line);
  border-radius: 10px;
  outline: none;
  font-weight: 600;
}
.hp-pop-range input:focus { border-color: var(--hp-green); }
.hp-pop-actions { display: flex; gap: 8px; margin-top: 16px; }
.hp-pop-actions button { flex: 1; border: 0; cursor: pointer; padding: 11px; border-radius: 12px; font-weight: 800; transition: .15s; }
.hp-pop-reset { background: var(--hp-soft); color: var(--hp-text); }
.hp-pop-reset:hover { background: #eef2f7; }
.hp-pop-apply { background: var(--hp-green); color: #fff; }
.hp-pop-apply:hover { background: var(--hp-green-dark); }

/* Térkép-konténer kitölti a fix magasságú szekciót (abszolút), így a Leaflet height:100% működik. */
.hp-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #eaf3f0;
}
.hp-map .leaflet-container { height: 100%; width: 100%; font: inherit; background: #eaf3f0; }

/* ===== TERMÉKEK ===== */
.hp-products { padding: 54px 0; background: var(--hp-soft); }
.hp-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.hp-sec-head h2 { margin: 0; font-size: 30px; letter-spacing: -.7px; font-weight: 900; }
.hp-sec-head p { margin: 9px 0 0; color: var(--hp-muted); }
.hp-green-link { color: var(--hp-green-dark); font-weight: 800; }
.hp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.hp-prod {
  overflow: hidden;
  border-radius: 26px;
  background: #fff;
  border: 1px solid var(--hp-line);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
  transition: transform .2s ease, box-shadow .2s ease;
  color: inherit;
  display: block;
}
.hp-prod:hover { transform: translateY(-5px); box-shadow: var(--hp-shadow); }
.hp-prod-img { position: relative; height: 180px; overflow: hidden; background: linear-gradient(135deg, #00a63e22, #16653422); }
.hp-prod-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.hp-prod:hover .hp-prod-img img { transform: scale(1.05); }
.hp-prod-ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 46px; }
.hp-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  border-radius: 999px;
  padding: 7px 11px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: var(--hp-green);
}
.hp-heart {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #64748b;
  font-size: 18px;
  transition: transform .15s;
}
.hp-heart:hover { transform: scale(1.12); }
.hp-prod-body { padding: 17px; }
.hp-prod-body h3 { margin: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-price { margin-top: 7px; font-weight: 900; font-size: 19px; color: var(--hp-green-dark); }
.hp-prod-meta { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; }
.hp-distance { color: var(--hp-green-dark); font-weight: 800; font-size: 13px; }
/* "Megnézem →" finom zöld link a kártya alján (a régi nagy zöld doboz helyett) */
.hp-view { color: var(--hp-green-dark); font-weight: 800; font-size: 13px; white-space: nowrap; }
.hp-prod:hover .hp-view { text-decoration: underline; }

/* Kedvenc szív */
.hp-heart.on { background: #fff; color: #ef4444; }

/* Előny-sáv */
.hp-features {
  margin-top: 38px;
  background: #fff;
  border: 1px solid #dcfce7;
  border-radius: 28px;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
}
.hp-feature { display: flex; gap: 14px; padding: 18px; }
.hp-feature-ic { font-size: 30px; flex-shrink: 0; }
.hp-feature h3 { margin: 0; font-size: 16px; }
.hp-feature p { margin: 7px 0 0; color: var(--hp-muted); font-size: 14px; line-height: 1.5; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1080px) {
  .hp-search { grid-template-columns: 1fr; }
  .hp-field + .hp-field { border-left: 0; border-top: 1px solid #f1f5f9; }
  .hp-cats { grid-template-columns: repeat(4, 1fr); }
  .hp-features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  /* Mobilon a panel NE takarja a térképet: térkép felül fix, panel alatta normál folyásban. */
  .hp-map-sec { height: auto; overflow: visible; }
  .hp-map { position: relative; inset: auto; height: 320px; }
  .hp-panel {
    position: static; width: auto; max-width: none;
    top: auto; left: auto; bottom: auto;
    margin: 16px; max-height: 460px;
    box-shadow: 0 8px 24px rgba(15,23,42,.08);
  }
}
@media (max-width: 640px) {
  .hp-hero { padding: 46px 0 32px; }
  .hp-hero h1 { letter-spacing: -1.4px; }
  .hp-cats { grid-template-columns: repeat(2, 1fr); }
  .hp-grid { grid-template-columns: 1fr; }
  .hp-features { grid-template-columns: 1fr; }
  .hp-sec-head { display: block; }
}
