/* ============================================================
   Strona komisu / dealera (otoauta) i agencji (osiedlo)
   Wymaga: otoauta.css (tokeny) + listing.css (slim header)
   Wariant agencji: body.dlr--agency
   ============================================================ */
body { background: var(--bg); }

/* ===== Cover + karta dealera ===== */
.dlr-cover { position: relative; height: 240px; overflow: hidden; background: var(--navy-900); }
.dlr-cover img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.dlr-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,18,40,.2), rgba(8,18,40,.65)); }
@media (max-width: 700px){ .dlr-cover { height: 160px; } }

.dlr-head { position: relative; margin-top: -64px; z-index: 5; }
.dlr-head__card { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 22px; display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.dlr-logo { width: 84px; height: 84px; border-radius: 18px; flex: none; display: grid; place-items: center; background: linear-gradient(155deg, var(--navy-600), var(--navy-900)); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; box-shadow: var(--shadow); }
.dlr-id { flex: 1; min-width: 240px; }
.dlr-name { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.3rem, 3vw, 1.7rem); letter-spacing: -.02em; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.dlr-name .bi-patch-check-fill { color: var(--navy-500); font-size: .85em; }
.dlr-sub { color: var(--muted); font-size: .9rem; margin-top: 3px; }
.dlr-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.dlr-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 14px; }
.dlr-stat b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: var(--ink); line-height: 1; white-space: nowrap; }
.dlr-stat span { font-size: .76rem; color: var(--muted); }
.dlr-stat .stars { color: var(--gold-600); }
.dlr-cta { display: flex; flex-direction: column; gap: 9px; min-width: 200px; }
@media (max-width: 700px){ .dlr-cta { width: 100%; flex-direction: row; flex-wrap: wrap; } .dlr-cta .btn-oa { flex: 1; } }

/* ===== Layout ===== */
.dlr-layout { display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 22px; align-items: start; padding: 22px 0 40px; }
@media (max-width: 991.98px){ .dlr-layout { grid-template-columns: 1fr; } }
.dlr-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 14px; }
@media (max-width: 991.98px){ .dlr-side { position: static; } }
.dlr-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-sm); }
.dlr-card h3 { font-family: var(--font-display); font-weight: 800; font-size: .98rem; margin: 0 0 13px; display: flex; align-items: center; gap: 8px; }
.dlr-card h3 i { color: var(--orange-500); }
.dlr-about { font-size: .88rem; color: var(--ink-2); line-height: 1.6; margin: 0; }

/* kategorie */
.dlr-cats { display: flex; flex-direction: column; gap: 2px; }
.dlr-cat { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; border: 0; background: transparent; font-weight: 600; font-size: .88rem; color: var(--ink-2); cursor: pointer; text-align: left; transition: .12s; }
.dlr-cat i { color: var(--muted); width: 18px; text-align: center; }
.dlr-cat .cnt { margin-left: auto; font-size: .74rem; font-weight: 700; color: var(--muted-2); background: var(--bg-2); border-radius: 999px; padding: .12rem .5rem; }
.dlr-cat:hover { background: var(--navy-50); color: var(--navy-700); }
.dlr-cat.active { background: var(--navy-700); color: #fff; }
.dlr-cat.active i, .dlr-cat.active .cnt { color: #fff; background: rgba(255,255,255,.18); }

/* filtry */
.dlr-flt { display: flex; flex-direction: column; gap: 11px; }
.dlr-flt .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* godziny */
.dlr-open { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 800; border-radius: 999px; padding: .3rem .7rem; margin-bottom: 11px; }
.dlr-open.is-open { background: var(--green-100); color: var(--green-600); }
.dlr-open.is-closed { background: var(--gold-100); color: var(--gold-600); }
.dlr-hours { width: 100%; font-size: .85rem; border-collapse: collapse; }
.dlr-hours td { padding: 5px 0; color: var(--ink-2); }
.dlr-hours td:last-child { text-align: right; font-weight: 700; }
.dlr-hours tr.today td { color: var(--navy-700); font-weight: 800; }

/* kontakt */
.dlr-contact { display: flex; flex-direction: column; gap: 10px; }
.dlr-contact a, .dlr-contact .row { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--ink-2); font-weight: 600; }
.dlr-contact a:hover { color: var(--navy-700); }
.dlr-contact i { width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--navy-50); color: var(--navy-700); display: grid; place-items: center; font-size: .95rem; }

/* mapa */
.dlr-map { height: 200px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }

/* formularz */
.dlr-form { display: flex; flex-direction: column; gap: 10px; }
.dlr-form .ok { display: none; align-items: center; gap: 8px; background: var(--green-100); color: var(--green-600); font-weight: 700; font-size: .85rem; border-radius: 11px; padding: .65rem .8rem; }
.dlr-form .ok.show { display: flex; }

/* prawa kolumna */
.dlr-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dlr-bar__count { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.dlr-bar__count b { color: var(--navy-700); }
.dlr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1199.98px){ .dlr-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px){ .dlr-grid { grid-template-columns: 1fr; } }

/* ===== WARIANT AGENCJI (osiedlo) — inny wygląd ===== */
.dlr--agency .agn-hero { background: radial-gradient(120% 150% at 0% 0%, var(--navy-700) 0%, var(--navy-950) 75%); color: #fff; padding: 40px 0 112px; position: relative; overflow: hidden; }
.dlr--agency .agn-hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(245,99,30,.35), transparent 70%); }
.dlr--agency .agn-hero__in { position: relative; z-index: 2; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.dlr--agency .agn-logo { width: 92px; height: 92px; border-radius: 22px; background: #fff; color: var(--navy-800); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 2rem; box-shadow: 0 14px 40px rgba(0,0,0,.3); flex: none; }
.dlr--agency .agn-hero h1 { color: #fff; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 3.4vw, 2.2rem); letter-spacing: -.02em; margin: 0; display: flex; align-items: center; gap: 10px; }
.dlr--agency .agn-hero h1 .bi-patch-check-fill { color: var(--orange-400); font-size: .8em; }
.dlr--agency .agn-hero .sub { color: #c4cee0; margin-top: 4px; }
.dlr--agency .agn-hero .dlr-stats { margin-top: 12px; }
.dlr--agency .agn-hero .dlr-stat b { color: #fff; }
.dlr--agency .agn-hero .dlr-stat span { color: #aab8d2; }
.dlr--agency .dlr-layout { margin-top: -84px; position: relative; z-index: 5; }
.dlr--agency .dlr-cat.active { background: var(--orange-500); }
/* zespół agentów */
.agn-team { display: flex; flex-direction: column; gap: 11px; }
.agn-agent { display: flex; align-items: center; gap: 11px; }
.agn-agent__av { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--navy-100); color: var(--navy-700); font-weight: 800; font-size: .9rem; }
.agn-agent__n { font-weight: 700; font-size: .88rem; line-height: 1.15; }
.agn-agent__r { font-size: .74rem; color: var(--muted); }
.agn-agent .tel { margin-left: auto; width: 34px; height: 34px; border-radius: 9px; background: var(--green-100); color: var(--green-600); display: grid; place-items: center; }


/* ===== Widok listy (rows) na stronie komisu/agencji ===== */
.dlr-grid.rows { grid-template-columns: 1fr; }
.dlr-grid.rows .car-card { display: grid; grid-template-columns: 260px 1fr; }
.dlr-grid.rows .car-card__media { aspect-ratio: auto; height: auto; min-height: 178px; }
.dlr-grid.rows .car-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dlr-grid.rows .car-card__body { padding: 14px 16px; }
.dlr-grid.rows .car-card__title { font-size: 1.05rem; -webkit-line-clamp: 1; }
@media (max-width: 575.98px){
  .dlr-grid.rows .car-card { grid-template-columns: 1fr; }
  .dlr-grid.rows .car-card__media { aspect-ratio: 16/11; height: auto; }
}
/* ===== Opis zwijany (4 linie) ===== */
.dlr-about.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.dlr-about-more { background: none; border: 0; padding: 0; margin-top: 9px; color: var(--navy-700); font-weight: 700; font-size: .84rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.dlr-about-more:hover { color: var(--orange-600); }

/* ===== Pasek licznika/sortowania agencji — na desktopie leży na ciemnym hero ===== */
@media (min-width: 992px) {
  .dlr--agency .dlr-bar { margin-top: 0; margin-bottom: 0; padding-bottom: 26px; }
  .dlr--agency .dlr-bar__count { color: #fff; }
  .dlr--agency .dlr-bar__count b { color: var(--orange-400); }
  .dlr--agency .dlr-bar .lst-sort label { color: #c4cee0; }
}
@media (max-width: 991.98px) {
  .dlr--agency .dlr-layout { margin-top: -64px; }
}

/* ikony SVG w liście kategorii */
.dlr-cat .ic { width: 20px; height: 20px; color: var(--muted); flex: none; display: inline-flex; }
.dlr-cat .ic svg { width: 100%; height: 100%; }
.dlr-cat:hover .ic { color: var(--navy-700); }
.dlr-cat.active .ic { color: #fff; }

/* ===== Karta Galeria (grid + lightbox) ===== */
.dgal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.dgal__t { position: relative; border: 0; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer; aspect-ratio: 1/1; background: var(--bg-2); }
.dgal__t img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; display: block; }
.dgal__t:hover img { transform: scale(1.08); }
.dgal__more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,18,40,.55); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.dgal-lb { position: fixed; inset: 0; z-index: 1600; background: rgba(6,12,28,.93); display: none; flex-direction: column; }
.dgal-lb.open { display: flex; }
.dgal-lb__bg { position: absolute; inset: 0; }
.dgal-lb__top { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.dgal-lb__cnt { color: #cdd6ea; font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.dgal-lb__x { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; cursor: pointer; font-size: 1.05rem; transition: .15s; }
.dgal-lb__x:hover { background: var(--orange-500); border-color: var(--orange-500); }
.dgal-lb__fig { position: relative; z-index: 2; flex: 1; min-height: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 0 70px; }
.dgal-lb__fig img { max-width: 100%; max-height: calc(100% - 44px); border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,.5); transition: opacity .18s ease; }
.dgal-lb__fig figcaption { color: #dbe4f7; font-weight: 600; font-size: .92rem; text-align: center; }
.dgal-lb__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; font-size: 1.2rem; cursor: pointer; transition: .15s; }
.dgal-lb__nav:hover { background: var(--orange-500); border-color: var(--orange-500); }
.dgal-lb__nav.prev { left: 16px; } .dgal-lb__nav.next { right: 16px; }
.dgal-lb__strip { position: relative; z-index: 3; display: flex; gap: 7px; padding: 12px 18px 16px; overflow-x: auto; justify-content: safe center; }
.dgal-lb__strip button { width: 62px; height: 46px; flex: none; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; opacity: .6; transition: .15s; background: #000; }
.dgal-lb__strip button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dgal-lb__strip button.on { border-color: var(--orange-500); opacity: 1; }
@media (max-width: 575.98px){ .dgal-lb__fig { padding: 0 12px; } .dgal-lb__nav { display: none; } }
/* kontakt: wiersz bez konfliktu z bootstrap .row */
.dlr-contact .crow { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--ink-2); font-weight: 600; margin: 0; }
