/* zdielna.sk – základné štýly */
:root {
  --green: #16a34a;
  --green-dark: #166534;
  --amber: #fde68a;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --ink: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card-border: #d9dce1;
  --bg: #f7f7f7;
  --danger: #dc2626;
  --warn: #b45309;
  --radius: 10px;
  --radius-pill: 999px;
  --font-body: "Open Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: "Plus Jakarta Sans", Montserrat, ui-sans-serif, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
img { max-width: 100%; display: block; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.text-muted { color: var(--muted); }

/* Buttons */
.btn { display: inline-block; padding: 10px 20px; border-radius: var(--radius-pill); font-weight: 700; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { background: #fff; border-color: var(--green); color: var(--green-dark); }
.btn-outline:hover { background: #f0fdf4; }
.btn-secondary { background: #fff; border-color: var(--border); color: var(--ink); }
.btn-amber { background: var(--amber); color: var(--ink); }
.btn-amber:hover { opacity: .9; }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* Flash */
.flash { margin: 16px 0; padding: 12px 16px; border-radius: var(--radius); font-weight: 500; }
.flash-success { background: #ecfdf5; color: var(--green-dark); border: 1px solid #bbf7d0; }
.flash-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.flash-info { background: #eff6ff; color: var(--blue-dark); border: 1px solid #bfdbfe; }

/* Sections */
section.block { padding: 40px 0; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }

/* Filter panel */
.filter-panel { background: #fff; border: 0.8px solid var(--card-border); border-radius: 18px; padding: 20px; margin-bottom: 24px; }
.filter-panel h3 { margin-top: 0; }
.filter-form .form-group { margin-bottom: 14px; }

/* Category grid */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.category-card { background: #fff; border: 0.8px solid var(--card-border); border-radius: 18px; padding: 18px; text-align: center; color: var(--ink); font-weight: 600; }
.category-card .icon { font-size: 28px; display: block; margin-bottom: 8px; }
.category-card:hover { border-color: var(--green); text-decoration: none; }

/* Listing grid/cards */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.listing-card { background: #fff; border: 0.8px solid var(--card-border); border-radius: 18px; overflow: hidden; color: var(--ink); display: block; transition: box-shadow .15s, transform .15s; }
.listing-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); text-decoration: none; transform: translateY(-2px); }
.listing-card-image { position: relative; aspect-ratio: 4/3; background: #eee; overflow: hidden; }
.listing-card-image img { width: 100%; height: 100%; object-fit: cover; }
.listing-card-image-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 14px; }
.listing-card-badge { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.92); font-size: 12px; padding: 3px 8px; border-radius: 999px; font-weight: 600; }
.listing-card-body { padding: 12px 14px; }
.listing-card-body h3 { font-size: 16px; margin-bottom: 4px; }
.listing-card-price { font-weight: 700; color: var(--green-dark); margin-top: 6px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-group .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; font-family: inherit;
}
textarea { resize: vertical; min-height: 110px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > .form-group { flex: 1; min-width: 200px; }
.radio-group, .checkbox-group { display: flex; gap: 16px; flex-wrap: wrap; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card-narrow { max-width: 480px; margin: 40px auto; }

/* Status badges */
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-PENDING { background: #fef3c7; color: var(--warn); }
.status-APPROVED { background: #dcfce7; color: var(--green-dark); }
.status-REJECTED { background: #fee2e2; color: var(--danger); }
.status-ARCHIVED { background: #e5e7eb; color: var(--muted); }

/* Listing detail */
.listing-detail { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; margin: 24px 0 48px; }
.gallery-main { aspect-ratio: 4/3; background: #eee; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumbs img { width: 70px; height: 56px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs img.active { border-color: var(--green); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); display: none; align-items: center; justify-content: center; z-index: 999; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.lightbox .close { position: absolute; top: 20px; right: 28px; color: #fff; font-size: 32px; cursor: pointer; background: none; border: none; }
.lightbox .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 28px; padding: 10px 16px; cursor: pointer; border-radius: 6px; }
.lightbox .prev { left: 20px; }
.lightbox .next { right: 20px; }

.sidebar-box { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.price-box .price { font-size: 26px; font-weight: 800; color: var(--green-dark); }
.safety-tip { background: #fff7ed; border: 1px solid #fde68a; border-radius: var(--radius); padding: 16px; font-size: 14px; }
.safety-tip strong { display: block; margin-bottom: 6px; }
.report-link { font-size: 13px; color: var(--muted); }

/* Chat */
.chat-layout { display: grid; grid-template-columns: 280px 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; min-height: 560px; }
.chat-list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 640px; }
.chat-list-item { display: block; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--ink); }
.chat-list-item:hover { background: var(--bg); text-decoration: none; }
.chat-list-item.active { background: #f0fdf4; }
.chat-list-item .meta { font-size: 12px; color: var(--muted); }
.chat-panel { display: flex; flex-direction: column; min-height: 560px; }
.chat-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.chat-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble { max-width: 70%; padding: 10px 14px; border-radius: 14px; background: #f1f5f9; }
.chat-bubble.mine { align-self: flex-end; background: #dcfce7; }
.chat-bubble .time { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.chat-bubble.contract { max-width: 90%; background: #fff; border: 1px solid var(--border); white-space: pre-wrap; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.chat-form { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; gap: 10px; }
.chat-form textarea { flex: 1; min-height: 44px; }
.chat-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); padding: 40px; text-align: center; }

/* Map */
#map { height: 640px; border-radius: var(--radius); border: 1px solid var(--border); }
.map-legend { display: flex; gap: 20px; margin: 10px 0 16px; font-size: 14px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); }
.dot-blue { background: var(--blue); }
.map-popup h4 { margin: 0 0 6px; }

/* Pagination */
.pagination { display: flex; gap: 6px; margin: 24px 0; flex-wrap: wrap; }
.pagination a, .pagination span.ellipsis { padding: 7px 12px; border: 1px solid var(--border); border-radius: 6px; color: var(--ink); }
.pagination a.active { background: var(--green); color: #fff; border-color: var(--green); }
.pagination a:hover { text-decoration: none; background: var(--bg); }

/* Tables (admin) */
table.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
table.admin-table th, table.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
table.admin-table th { background: #f3f4f6; font-weight: 700; }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-tabs a { padding: 8px 14px; border-radius: 8px; background: #fff; border: 1px solid var(--border); color: var(--ink); font-weight: 600; }
.admin-tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-card .num { font-size: 28px; font-weight: 800; }

/* Cookie consent banner */

/* Responsive */
@media (max-width: 860px) {
  .listing-detail { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-list { max-height: 220px; }
          }

/* Mapa (uvodna stranka + /mapa.php) */
.zd-home-map { padding: 8px 16px 40px; }
.zd-home-map .zd-section2__inner { max-width: 1200px; margin: 0 auto; }
.zd-home-map__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.zd-map { width: 100%; border-radius: 16px; border: 1px solid #e5e7eb; overflow: hidden; z-index: 0; }
.zd-map-legend { display: flex; gap: 18px; align-items: center; margin: 0 0 12px; font-size: 14px; flex-wrap: wrap; }
.zd-map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.zd-map-status { margin-left: auto; color: #6b7280; }
.zd-map-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.zd-map-dot--green { background: #1f9d55; } .zd-map-dot--blue { background: #2563eb; }
.zd-map-pin { background: none; border: 0; } .zd-map-pin svg { display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.map-popup ul { list-style: none; margin: 0; padding: 0; } .map-popup li { margin: 0 0 8px; font-size: 13px; line-height: 1.3; } .map-popup li span { color: #6b7280; }
.map-popup h4 { margin: 0 0 6px; font-size: 15px; } .map-popup p { margin: 0 0 8px; font-size: 13px; }

.zd-map-legend { background: #f6faf7; border: 1px solid #d9e8de; border-radius: 12px; padding: 10px 14px; }
.zd-map-legend__title { font-weight: 700; }
.zd-map-legend__pin { display: inline-block; vertical-align: middle; }
.zd-map-legend__note { color: #6b7280; font-size: 13px; flex: 1 1 260px; }

/* === Podstranky s povodnym Kadence hlavickou (profil, pridanie inzeratu, administracia) – vzhlad formularov ako na zdielna.sk === */
.zd-skin { padding: 32px 0 40px; }
.zd-skin h1 { font-size: clamp(26px, 3vw, 36px); font-weight: 800; line-height: 1.15; margin: 0 0 18px; color: #1f2937; }
.zd-skin .container { max-width: none; padding: 0; }
.zd-skin .card { background: #fff; border: 1px solid var(--zd-border, #d9dce1); border-radius: 16px; box-shadow: 0 12px 30px rgba(0,0,0,.06); padding: 22px; }
.zd-skin .card-narrow { max-width: 640px; margin: 0 auto; }
.zd-skin .form-group { margin-bottom: 14px; }
.zd-skin .form-group label, .zd-skin label.lbl { display: block; font-weight: 800; font-size: 13px; margin-bottom: 6px; }
.zd-skin input[type=text], .zd-skin input[type=email], .zd-skin input[type=password], .zd-skin input[type=tel],
.zd-skin input[type=number], .zd-skin input[type=url], .zd-skin input[type=search], .zd-skin select, .zd-skin textarea {
  width: 100%; border: 1px solid var(--zd-border, #d9dce1); border-radius: 12px; padding: 12px; font-size: 15px; background: #fff; box-sizing: border-box; font-family: inherit;
}
.zd-skin input:focus, .zd-skin select:focus, .zd-skin textarea:focus { outline: none; border-color: var(--zd-green, #16a34a); box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.zd-skin input[type=radio], .zd-skin input[type=checkbox] { width: auto; }
.zd-skin .radio-group label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin-right: 16px; }
.zd-skin .btn { border-radius: 12px; font-weight: 900; }
.zd-skin .btn-primary { background: var(--zd-green, #16a34a); border-color: var(--zd-green, #16a34a); }
.zd-skin .btn-primary:hover { background: var(--zd-green-dark, #166534); }
.zd-skin .btn-outline { border-color: var(--zd-green, #16a34a); color: var(--zd-green-dark, #166534); }
.zd-skin .admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.zd-skin .admin-tabs a { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--zd-border, #d9dce1); background: #fff; color: #111827; font-weight: 700; text-decoration: none; }
.zd-skin .admin-tabs a.active { background: var(--zd-green, #16a34a); border-color: var(--zd-green, #16a34a); color: #fff; }
.zd-skin .admin-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--zd-border, #d9dce1); border-radius: 14px; overflow: hidden; }
.zd-skin .admin-table th { background: #f4faf6; text-align: left; font-size: 13px; padding: 12px 14px; }
.zd-skin .admin-table td { padding: 12px 14px; border-top: 1px solid #eef0f2; vertical-align: top; }
.zd-skin .block-head h2 { margin: 0; font-size: 22px; }
.zd-skin .flash { border-radius: 12px; }

/* Cookie banner – rovnaky vzhlad ako na zdielna.sk */
.gdpr-cb-wrapper { position: fixed; right: 20px; bottom: 20px; width: 420px; max-width: calc(100vw - 40px); z-index: 2147483647; font-family: inherit; }
.gdpr-cb-banner { background: #fff; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,.15); padding: 24px; color: #1e293b; box-sizing: border-box; }
.gdpr-cb-title { margin: 0 0 8px; font-size: 18px; font-weight: 600; line-height: 1.2; color: #1e293b; }
.gdpr-cb-description { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: #2a3952; }
.gdpr-cb-links { margin: 8px 0 0; font-size: 13px; line-height: 2; color: #2a3952; }
.gdpr-cb-links a { color: #16833f; font-weight: 500; text-decoration: none; }
.gdpr-cb-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.gdpr-cb-btn { display: flex; align-items: center; justify-content: center; padding: 12px 24px; border-radius: 8px; font-size: 14px; font-weight: 500; line-height: 1.4; cursor: pointer; font-family: inherit; }
.gdpr-cb-btn-primary { background: #16833f; color: #fff; border: 0.8px solid #16833f; }
.gdpr-cb-btn-secondary { background: transparent; color: #16833f; border: 0.8px solid #16833f; }

.zd-map { background: #fff; }
.zd-map .leaflet-control-attribution { background: rgba(255,255,255,.85); font-size: 10px; }

/* Mala mapa v detaile */
.zd-loc-map-wrap { margin-top: 4px; }
.zd-loc-map { border-radius: 14px; }
.zd-loc-map-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: #6b7280; }
.zd-loc-map-foot a { color: #166534; font-weight: 600; text-decoration: none; }
.zd-loc-map-foot a:hover { text-decoration: underline; }
