/* Lokum24 – stylistyka własna (teal + bursztyn) */
:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --bg: #f4f7f6;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #64748b;
  --border: #e2e8e6;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 118, 110, .08), 0 4px 16px rgba(15, 118, 110, .06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
code { background: #eef2f1; padding: 2px 6px; border-radius: 6px; font-size: .85em; word-break: break-all; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.section { padding: 28px 16px; }
.narrow { max-width: 460px; }
.narrow-wide { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); font-size: .92rem; }

/* Header */
.site-header { background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 800; font-size: 1.25rem; letter-spacing: -.5px; }
.logo:hover { text-decoration: none; }
.main-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.main-nav a { color: #d7eceb; font-weight: 500; font-size: .9rem; }
.main-nav a:hover { color: #fff; text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* Przyciski */
.btn { display: inline-block; padding: 9px 18px; border-radius: 9px; border: 1px solid transparent; font-weight: 600; cursor: pointer; font-size: .95rem; text-align: center; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-accent { background: var(--accent); color: #1f2937; }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-block { display: block; width: 100%; }
.btn-block + .btn-block { margin-top: 10px; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }
.btn-sm { padding: 4px 10px; font-size: .85rem; }
.linklike { background: none; border: none; color: #d7eceb; cursor: pointer; font: inherit; padding: 0; }
main .linklike { color: var(--muted); }
.inline-form { display: inline; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary-dark), var(--primary) 60%, #149398); color: #fff; padding: 48px 0 56px; }
.hero h1 { font-size: 2.2rem; margin: 0 0 6px; }
.hero-sub { color: #cfe9e7; margin: 0 0 22px; }
.search-box { background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.search-row { display: grid; grid-template-columns: 1fr 1fr 2fr auto; gap: 10px; }
.search-row-small { grid-template-columns: repeat(4, 1fr); margin-top: 10px; }
.search-box input, .search-box select { width: 100%; }

/* Formularze */
input, select, textarea { padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; background: #fff; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15, 118, 110, .35); border-color: var(--primary); }
label { display: block; margin-bottom: 12px; font-weight: 500; font-size: .92rem; }
label input, label select, label textarea { margin-top: 4px; font-weight: 400; }
.checkbox-label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.checkbox-label input { width: auto; margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.filter-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; }
.input-sm { max-width: 90px; }
.span-2 { grid-column: 1 / -1; margin-bottom: 12px; }
.field-label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; border: 1px solid var(--border); border-radius: 8px; padding: 6px 13px; cursor: pointer; font-size: .88rem; background: #fff; margin: 0; font-weight: 400; user-select: none; }
.chip:hover { border-color: var(--primary); }
.chip input { display: none; }
.chip:has(input:checked) { border-color: var(--primary); background: #e6f4f2; color: var(--primary-dark); font-weight: 600; }

/* Mapy (Leaflet) */
#form-map { height: 360px; border-radius: 10px; border: 1px solid var(--border); }
#o-map { height: 360px; border-radius: 10px; }
.map-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

/* Dropzone na zdjęcia */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px 16px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone p { margin: 6px 0; }
.dropzone.dz-over { border-color: var(--primary); background: #eef7f6; }
.image-actions { display: flex; gap: 6px; justify-content: center; }

/* Własna lista podpowiedzi (autocomplete) */
.ac-anchor { position: relative; display: block; }
.ac-list { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-top: none; border-radius: 0 0 9px 9px; box-shadow: var(--shadow); z-index: 80; max-height: 280px; overflow-y: auto; }
.ac-item { padding: 8px 12px; cursor: pointer; font-size: .92rem; font-weight: 400; color: var(--text); }
.ac-item:hover, .ac-item.active { background: #e6f4f2; color: var(--primary-dark); }
.ac-sub { color: var(--muted); font-size: .8rem; margin-left: 6px; }

/* Karty */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.flash { padding: 12px 16px; border-radius: 9px; margin: 14px 0; font-weight: 500; }
.flash-success { background: #d6f5e9; color: #065f46; }
.flash-error { background: #fde8e8; color: #991b1b; }
.flash-info { background: #e0f2fe; color: #075985; }

/* Siatka ofert */
.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.offer-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; position: relative; }
.offer-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 118, 110, .15); text-decoration: none; }
.offer-card-img { position: relative; aspect-ratio: 4/3; background: #e8efee; overflow: hidden; }
.offer-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.offer-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.offer-card-price { font-size: 1.12rem; color: var(--primary-dark); }
.offer-card-title { font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.offer-card-loc, .offer-card-meta { color: var(--muted); font-size: .87rem; }
.offer-card.is-featured { border-color: var(--accent); }
.offer-card.is-premium { border-color: var(--primary); }
.offer-card-inactive { opacity: .55; }
.noimg { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: .85rem; min-height: 120px; }
.fav-btn { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.92); border: none; border-radius: 50%; width: 36px; height: 36px; font-size: 1.15rem; cursor: pointer; color: #be123c; line-height: 1; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: .4px; }
.badge-featured { background: #fef3c7; color: #92400e; }
.badge-premium { background: var(--primary); color: #fff; }
.badge-active { background: #d6f5e9; color: #065f46; }
.badge-pending, .badge-draft { background: #fef3c7; color: #92400e; }
.badge-expired, .badge-rejected, .badge-pay-failed, .badge-pay-cancelled { background: #fde8e8; color: #991b1b; }
.badge-archived { background: #e5e7eb; color: #374151; }
.badge-pay-paid { background: #d6f5e9; color: #065f46; }
.badge-pay-new, .badge-pay-pending { background: #e0f2fe; color: #075985; }
.card-badges { position: absolute; top: 8px; left: 8px; }

/* Strona główna */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.cat-tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; display: flex; flex-direction: column; gap: 4px; color: var(--text); transition: transform .15s; }
.cat-tile:hover { transform: translateY(-3px); text-decoration: none; border-color: var(--primary); }
.cat-icon { font-size: 1.8rem; }
.cat-name { font-weight: 700; }
.cat-count { color: var(--muted); font-size: .85rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cta-strip { background: var(--primary-dark); color: #fff; border-radius: var(--radius); display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 10px; margin-bottom: 26px; }
.cta-strip p { color: #cfe9e7; margin: 0; }

/* Lista wyników */
.filters-top { margin-bottom: 52px; }
.filters-row { display: flex; flex-wrap: wrap; gap: 10px; }
.filters-row > * { flex: 1 1 135px; min-width: 0; }
.filters-row > .filter-wide { flex: 2 1 220px; }
.filters-row > button[type=submit] { flex: 0 0 auto; }
.filters-row .filter-pair { display: flex; gap: 10px; }
.filter-check { align-items: center; white-space: nowrap; flex: 0 0 auto; margin-bottom: 0; }
.filters-more { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }
.filters-actions { display: flex; gap: 22px; margin-top: 12px; }
.filters-actions .linklike { color: var(--primary); font-weight: 600; }

.listing-wrap { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
.featured-aside { display: none; }
.featured-aside h3 { margin-top: 0; }
.featured-aside .offer-grid { grid-template-columns: 1fr; gap: 14px; }
.featured-aside .offer-card-price { font-size: 1rem; }
.featured-aside .offer-card-title { font-size: .9rem; }
.featured-aside .offer-card-meta { display: none; }
@media (min-width: 1240px) {
  /* kolumna mieści się w standardowej szerokości strony (1180px) */
  .listing-wrap { grid-template-columns: 1fr 280px; }
  .featured-aside { display: block; }
}
.listing-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.listing-toolbar select { width: auto; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: #fff; }
.view-toggle button { border: none; background: none; padding: 8px 11px; cursor: pointer; color: var(--muted); display: flex; align-items: center; }
.view-toggle button.active { background: var(--primary); color: #fff; }
.view-toggle button:not(.active):hover { background: #eef7f6; color: var(--primary-dark); }

/* Widok listy (poziome boxy, jeden na wiersz) */
.offer-grid.view-list { grid-template-columns: 1fr; }
.offer-grid.view-list .offer-card { flex-direction: row; }
.offer-grid.view-list .offer-card-img { width: 280px; min-width: 280px; aspect-ratio: 4/3; }
.offer-grid.view-list .offer-card-body { padding: 16px 20px; gap: 6px; justify-content: center; }
.offer-grid.view-list .offer-card-price { font-size: 1.3rem; }
.offer-grid.view-list .offer-card-title { font-size: 1.05rem; }
.loader { text-align: center; color: var(--muted); padding: 26px; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -4px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
#scroll-sentinel { height: 1px; }

/* Strona oferty */
.offer-layout { display: grid; grid-template-columns: 1fr 330px; gap: 24px; align-items: start; }
.offer-main, .listing-main { min-width: 0; } /* nie pozwól treści rozpychać kolumny siatki */
.breadcrumbs { color: var(--muted); font-size: .88rem; margin-bottom: 12px; }
.gallery-main { height: 420px; background: #1f2a29; border-radius: var(--radius); overflow: hidden; position: relative; }
.g-badges { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 8px; pointer-events: none; }
.g-badge { background: rgba(0, 0, 0, .65); color: #fff; padding: 4px 11px; border-radius: 99px; font-size: .85rem; font-weight: 600; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.gallery-thumbs img { width: 92px; height: 66px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; flex-shrink: 0; }
.gallery-thumbs img.active { border-color: var(--primary); }
.offer-header { display: flex; justify-content: space-between; gap: 18px; margin: 0 0 16px; align-items: flex-start; }
.offer-header > div:first-child { flex: 1 1 auto; min-width: 0; }
.offer-header .offer-price { flex: 0 0 auto; }
.gallery { margin-bottom: 18px; }
.offer-header h1 { margin: 0 0 4px; font-size: 1.45rem; line-height: 1.35; overflow-wrap: break-word; }
.offer-location { color: var(--muted); margin: 0; }
.offer-price .price { font-size: 1.7rem; font-weight: 800; color: var(--primary-dark); white-space: nowrap; }
.offer-price .price-m2 { color: var(--muted); text-align: right; }
.price-inline { color: var(--primary-dark); font-size: 1.15rem; }
.params-table { width: 100%; border-collapse: collapse; }
.params-table td { padding: 7px 4px; border-bottom: 1px solid var(--border); }
.params-table td:first-child { color: var(--muted); width: 45%; }
.offer-desc { white-space: normal; }
.offer-meta { color: var(--muted); font-size: .85rem; margin: 10px 0; }
.contact-card { position: sticky; top: 76px; }
.contact-card .btn-block { margin-top: 10px; }
.phone-shown { font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); text-align: center; padding: 10px; background: #eef7f6; border-radius: 9px; margin-bottom: 10px; }
.form-result { font-size: .9rem; font-weight: 600; }
.report-link { font-size: .85rem; }
/* Pełnoekranowa galeria */
.no-scroll { overflow: hidden; }
#gallery-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 300; overflow-y: auto; }
.go-header { position: sticky; top: 0; background: #fff; display: flex; align-items: center; gap: 16px; padding: 12px 24px; box-shadow: var(--shadow); z-index: 2; }
.go-count { background: #e6f4f2; color: var(--primary-dark); padding: 5px 14px; border-radius: 99px; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.go-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.go-video { max-width: 1000px; margin: 20px auto 0; padding: 0 24px; }
.go-video iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; display: block; }
.go-grid { columns: 2; column-gap: 14px; max-width: 1400px; margin: 20px auto; padding: 0 24px 32px; }
.go-grid img { width: 100%; border-radius: 10px; margin-bottom: 14px; display: block; }
@media (max-width: 800px) { .go-grid { columns: 1; } }

.dialog { border: none; border-radius: var(--radius); padding: 22px; max-width: 420px; width: 90%; box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Pakiety */
.package-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 14px 0; }
.package { background: var(--card); border: 2px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; position: relative; }
.package:has(input:checked) { border-color: var(--primary); background: #f0faf9; }
.package input[type=radio] { position: absolute; top: 14px; right: 14px; width: auto; }
.package-best { border-color: var(--accent); }
.package-best::before { content: "Polecany"; position: absolute; top: -11px; left: 14px; background: var(--accent); color: #1f2937; font-size: .7rem; font-weight: 800; padding: 1px 9px; border-radius: 99px; text-transform: uppercase; }
.package-name { font-weight: 800; font-size: 1.05rem; }
.package-price { font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); }
.package-desc { color: var(--muted); font-size: .85rem; font-weight: 400; }

/* Konto / admin */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 18px 0; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--muted); font-size: .88rem; }
.stat-num { display: block; font-size: 1.6rem; font-weight: 800; color: var(--primary-dark); }
.account-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.link-card { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.link-card:hover { border-color: var(--primary); text-decoration: none; }
.link-card span { color: var(--muted); font-size: .87rem; }
.my-offer { display: flex; gap: 16px; }
.my-offer-img { width: 150px; flex-shrink: 0; border-radius: 9px; overflow: hidden; background: #e8efee; aspect-ratio: 4/3; }
.my-offer-img img { width: 100%; height: 100%; object-fit: cover; }
.my-offer-body { flex: 1; min-width: 0; }
.my-offer-body h3 { margin: 4px 0; }
.my-offer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.edit-images { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.edit-image { position: relative; }
.edit-image[draggable=true] { cursor: grab; }
.edit-image.dragging { opacity: .4; }
.edit-image img { width: 110px; height: 80px; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 4px; pointer-events: none; }
.main-flag { display: none; position: absolute; top: 4px; left: 4px; background: var(--accent); color: #1f2937; font-size: .68rem; font-weight: 800; padding: 1px 7px; border-radius: 99px; text-transform: uppercase; z-index: 1; }
.edit-image.is-main-img .main-flag { display: inline-block; }
.edit-image.is-main-img img { outline: 2px solid var(--accent); }
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; margin: 14px 0 22px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px; }
.admin-nav a { padding: 7px 13px; border-radius: 8px; font-weight: 600; }
.admin-nav a:hover { background: #eef7f6; text-decoration: none; }
.admin-filter { display: flex; gap: 10px; margin-bottom: 16px; max-width: 560px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { text-align: left; background: #eef4f3; padding: 9px 12px; white-space: nowrap; }
.data-table td { padding: 8px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.actions-cell { white-space: nowrap; }
.actions-cell form { margin-right: 4px; }
.pricing-table input { min-width: 70px; }
.token { font-size: .75rem; }
.abon-form { display: flex; gap: 6px; align-items: center; }
.format-select { width: auto; min-width: 110px; padding: 5px 8px; font-size: .85rem; }
.abon-form select, .abon-form input[type=date] { width: auto; padding: 5px 8px; font-size: .85rem; }
.prose h2 { margin-top: 22px; }

/* Stopka */
.site-footer { background: #0c3835; color: #b6d6d3; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; padding: 28px 16px; flex-wrap: wrap; font-size: .9rem; }
.site-footer a { color: #d7eceb; margin-right: 14px; }

/* Responsywność */
@media (max-width: 920px) {
  .listing-layout, .offer-layout { grid-template-columns: 1fr; }
  .filters, .contact-card { position: static; }
  .search-row { grid-template-columns: 1fr 1fr; }
  .search-row-small { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  /* Mobile: zawsze kafelki, bez przełącznika widoku */
  .view-toggle { display: none; }
  .offer-grid.view-list { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
  .offer-grid.view-list .offer-card { flex-direction: column; }
  .offer-grid.view-list .offer-card-img { width: auto; min-width: 0; }
  .offer-grid.view-list .offer-card-body { padding: 12px 14px; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; padding-bottom: 12px; }
  .main-nav.open { display: flex; }
  .header-inner { flex-wrap: wrap; }
  .my-offer { flex-direction: column; }
  .my-offer-img { width: 100%; }
  .hero h1 { font-size: 1.6rem; }
}
