/* ==========================================================================
   listing-cta.css — wzmocnione przyciski kontaktu na kafelku listingu
   (browse/search). Ladowane po fix.css (override). Brand #2AC59B.
   Zachowuje hooki JS: .dip (reveal telefonu), .phone (cel reveal),
   .card-message (overlay wiadomosci).
   ========================================================================== */

/* Kontener CTA — nadpisuje float/width/text-align z .offer-contact */
.offer-contact.offer-cta {
	float: none;
	width: 100%;
	text-align: left;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 6px;
}

/* Wspolny przycisk (specyficznosc .offer-large ... zeby wygrac z main.css) */
.offer-large .offer-cta .offer-cta-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	box-sizing: border-box;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	padding: 11px 14px;
	margin: 0;
	border-radius: 12px;
	border: 1.5px solid transparent;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .08s ease;
}
.offer-large .offer-cta .offer-cta-btn:active { transform: translateY(1px); }

/* Zadzwon — filled brand */
.offer-large .offer-cta .offer-cta-btn--call {
	background: #2AC59B;
	border-color: #2AC59B;
	color: #fff;
}
.offer-large .offer-cta .offer-cta-btn--call:hover,
.offer-large .offer-cta .offer-cta-btn--call:focus {
	background: #4ad8b2;
	border-color: #4ad8b2;
	color: #fff;
}

/* Neutralizacja starego fix.css ".dip { padding:0 5px!important; top:-1px;
   margin-left:2px; width:auto!important }" — przez nie "Zadzwon" byl za niski.
   Wyzsza specyficznosc (.dip jako 4. klasa) + !important wygrywa z fix.css. */
.offer-large .offer-cta .offer-cta-btn.dip {
	padding: 11px 14px !important;
	width: 100% !important;
	top: 0;
	margin-left: 0;
}

/* Wyslij wiadomosc — outline brand */
.offer-large .offer-cta .offer-cta-btn--msg {
	background: #fff;
	border-color: #2AC59B;
	color: #1f9a78;
}
.offer-large .offer-cta .offer-cta-btn--msg:hover,
.offer-large .offer-cta .offer-cta-btn--msg:focus {
	background: #f2fbf8;
	border-color: #2AC59B;
	color: #1f9a78;
}

/* Ikona w przycisku */
.offer-cta .offer-cta-ico {
	width: 17px; height: 17px;
	stroke: currentColor; stroke-width: 2; fill: none;
	stroke-linecap: round; stroke-linejoin: round;
	flex: 0 0 auto;
}

/* Reveal telefonu — span (.phone) sibling .dip; ukryty dopoki pusty.
   Po odkryciu numer zajmuje miejsce przycisku "Zadzwon": ten sam gabaryt
   (padding/radius/wysokosc) i styl brandowy, zeby layout nie skakal. */
.offer-cta .offer-cta-phone {
	display: block;
	text-align: center;
	width: 100%;
	box-sizing: border-box;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: .03em;
	color: #1f9a78;
	height: 42px;       /* == .offer-cta-btn (17px ikona + 22px padding + 3px border) */
	line-height: 39px;  /* content = 42 - 3 border -> jedna linia wysrodkowana pionowo */
	padding: 0 14px;
	border: 1.5px solid #2AC59B;
	border-radius: 12px;
	background: #f2fbf8;
}
.offer-cta .offer-cta-phone:empty { display: none; }
.offer-cta .offer-cta-phone a { color: #1f9a78; text-decoration: none; }

/* Fix nachodzenia "Wyslij wiadomosc" na "Ostatnia aktywnosc".
   Prawa kolumna miala sztywne height:205px, a .offer-bottom (aktywnosc) bylo
   position:absolute; bottom:0 (campaigns-main.css). Z poprawnie wysokimi
   przyciskami i po odkryciu numeru tresc nie miescila sie. Pozwalamy kolumnie
   rosnac i ukladamy aktywnosc w naturalnym flow pod przyciskami. Clearfix na
   .offer-large gwarantuje, ze karta obejmie wyzsza kolumne (bez clipowania jak
   przy overflow:hidden — chroni cien i pasek .offer-featured:before). */
.offer-large::after { content: ""; display: block; clear: both; }
.offer-large .offer-large-right { height: auto; min-height: 205px; }
.offer-large .offer-large-right .offer-bottom { position: static; margin-top: 8px; }

/* Mobile: dwa CTA obok siebie 50/50 */
@media (max-width: 767px) {
	.offer-contact.offer-cta { flex-direction: row; flex-wrap: wrap; }
	.offer-large .offer-cta .offer-cta-btn { flex: 1 1 0; min-width: 130px; }
	.offer-cta .offer-cta-phone { flex: 1 0 100%; }
}

/* ==========================================================================
   Overlay wiadomosci — restyle bootstrap-modala #modal-card-message
   na wyglad prototypu (desktop modal + mobile bottom sheet). Backend
   (write_message/send_message) bez zmian — zmieniamy tylko wyglad + UX.
   ========================================================================== */
#modal-card-message .modal-dialog {
	width: 520px;
	max-width: calc(100% - 32px);
	margin: 40px auto;
}
#modal-card-message .modal-content {
	border: none;
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(56, 64, 71, .16);
	overflow: hidden;
}
#modal-card-message .modal-header {
	position: relative;
	padding: 18px 20px;
	border-bottom: 1px solid #eef0f2;
}
#modal-card-message .modal-header h3 {
	font-size: 13px; font-weight: 500; color: #6b747c; margin: 0; text-transform: none;
}
#modal-card-message .modal-header h4 {
	font-size: 18px; font-weight: 700; color: #384047; margin: 2px 0 0;
}
#modal-card-message .ek-modal-head { display: flex; align-items: center; gap: 12px; padding-right: 36px; }
#modal-card-message .ek-modal-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #eef0f2; flex: 0 0 auto; }
#modal-card-message .ek-modal-head-text { min-width: 0; }

/* e-mail zalogowanego: chip + readonly */
#modal-card-message .ek-account-chip {
	display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600;
	color: #1f9a78; background: #e6f8f2; padding: 2px 9px; border-radius: 999px; margin-left: 6px;
}
#modal-card-message .ek-readonly-email {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	background: #f7f8f9; border: 1.5px solid #eef0f2; border-radius: 8px;
	padding: 10px 12px; color: #6b747c; font-size: 14px;
}
#modal-card-message .ek-readonly-check { width: 16px; height: 16px; stroke: #1f9a78; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* Stopka */
#modal-card-message .modal-footer.ek-modal-foot {
	display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; text-align: left;
	padding: 14px 20px; border-top: 1px solid #eef0f2;
}
#modal-card-message .ek-modal-foot .ek-legal { flex: 1 1 180px; min-width: 0; font-size: 11px; color: #98a0a6; line-height: 1.4; margin: 0; }
#modal-card-message .ek-modal-foot .ek-legal a { color: #1f9a78; }
#modal-card-message .ek-btn-cancel {
	flex: 0 0 auto;
	background: none; border: none; color: #6b747c; font-weight: 500; font-size: 14px;
	padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
#modal-card-message .ek-btn-cancel:hover { background: #f7f8f9; color: #384047; }
#modal-card-message .ek-foot-send {
	flex: 0 0 auto; float: none; margin: 0; width: auto; height: auto;
	display: inline-flex; align-items: center; gap: 8px;
	padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 700; line-height: 1;
}
#modal-card-message .ek-foot-send .ek-foot-ico { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
#modal-card-message .modal-close {
	position: absolute; top: 14px; right: 14px;
	width: 32px; height: 32px; padding: 0;
	display: flex; align-items: center; justify-content: center;
	background: none; border: none; border-radius: 8px; cursor: pointer; opacity: .7;
}
#modal-card-message .modal-close:hover { background: #f7f8f9; opacity: 1; }
#modal-card-message .modal-close img { width: 14px; height: 14px; }
#modal-card-message .modal-body { padding: 18px 20px; }

/* Pola formularza w overlayu */
#modal-card-message .form-group { margin-bottom: 14px; }
#modal-card-message .form-control {
	height: auto; font-size: 14px; color: #384047;
	border: 1.5px solid #dde2e6; border-radius: 8px; padding: 10px 12px;
	box-shadow: none; transition: border-color .14s ease, box-shadow .14s ease;
}
#modal-card-message .form-control:focus {
	border-color: #2AC59B; box-shadow: 0 0 0 3px rgba(42, 197, 155, .18);
	caret-color: #2AC59B;
}
#modal-card-message textarea.form-control { min-height: 130px; resize: vertical; line-height: 1.5; }
#modal-card-message .ek-field-hint { font-size: 12px; color: #98a0a6; margin: 6px 0 0; line-height: 1.4; }

/* Przycisk wyslij */
#modal-card-message .button-outer-wrapper { margin-top: 4px; }
#modal-card-message .send-message {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%; border-radius: 12px; font-weight: 700; font-size: 15px; padding: 12px 18px;
}

/* Mobile/tablet: bottom sheet (breakpoint zgodny z mobile layoutem site'u = 991px) */
@media (max-width: 991px) {
	#modal-card-message .modal-dialog {
		margin: 0; position: absolute; left: 0; right: 0; bottom: 0;
		width: 100%; max-width: 100%;
	}
	#modal-card-message .modal-content {
		border-radius: 16px 16px 0 0; max-height: 92vh; overflow-y: auto;
	}
	#modal-card-message .ek-success-actions { flex-direction: column; }
	#modal-card-message .ek-success-actions .ek-success-btn { width: 100%; }
}

/* ==========================================================================
   Success-state (renderowane przez JS po wyslaniu)
   ========================================================================== */
#modal-card-message .ek-success { text-align: center; padding: 28px 24px; animation: ek-fade .18s ease; }
#modal-card-message .ek-success-ring {
	width: 64px; height: 64px; border-radius: 50%; background: #e6f8f2;
	display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
	color: #1f9a78; position: relative;
}
#modal-card-message .ek-success-ring svg {
	width: 30px; height: 30px; stroke: currentColor; stroke-width: 2.5; fill: none;
	stroke-linecap: round; stroke-linejoin: round;
}
#modal-card-message .ek-success-ring::after {
	content: ''; position: absolute; inset: -6px; border-radius: 50%;
	border: 2px solid #2AC59B; opacity: .5; animation: ek-ring 1.6s ease infinite;
}
#modal-card-message .ek-success h3 { font-size: 19px; font-weight: 700; margin: 0 0 8px; color: #384047; }
#modal-card-message .ek-success p { font-size: 14px; line-height: 1.55; color: #6b747c; margin: 0 auto 22px; max-width: 340px; }
#modal-card-message .ek-success-btn {
	display: inline-flex; align-items: center; justify-content: center;
	background: #2AC59B; color: #fff; border: none; border-radius: 12px;
	padding: 12px 24px; font-weight: 700; font-size: 14px; cursor: pointer;
}
#modal-card-message .ek-success-btn:hover { background: #4ad8b2; }
#modal-card-message .ek-success-actions { display: flex; gap: 12px; justify-content: center; }
#modal-card-message .ek-success-btn--outline {
	background: #fff; border: 1.5px solid #2AC59B; color: #1f9a78; text-decoration: none;
}
#modal-card-message .ek-success-btn--outline:hover { background: #f2fbf8; }
@keyframes ek-ring { 0% { transform: scale(.85); opacity: .55; } 70% { transform: scale(1.5); opacity: 0; } 100% { opacity: 0; } }
@keyframes ek-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   Mobilny sticky bar kontaktu na stronie ogloszenia (card/info.php).
   Tylko mobile (<=767px). Pojawia sie po przewinieciu poza hero (JS).
   ========================================================================== */
.ek-sticky-advert { display: none; }

@media (max-width: 767px) {
	.ek-sticky-advert {
		display: block;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
		background: linear-gradient(180deg, #f2fbf8 0%, #ffffff 60%);
		border-top: 1px solid #d8f3ea;
		padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
		box-shadow: 0 -8px 24px rgba(56, 64, 71, .12);
		transform: translateY(130%);
		transition: transform .22s cubic-bezier(0.22, 1, 0.36, 1);
	}
	.ek-sticky-advert--visible { transform: translateY(0); }
	.ek-sticky-advert::before {
		content: ''; position: absolute; left: 0; right: 0; top: -22px; height: 22px;
		background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.85) 100%);
		pointer-events: none;
	}
	.ek-sticky-advert__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
	.ek-sticky-advert__price b { font-size: 19px; font-weight: 800; color: #384047; }
	.ek-sticky-advert__price span { font-size: 13px; color: #98a0a6; }
	.ek-sticky-advert__pill {
		display: inline-flex; align-items: center; gap: 6px;
		font-size: 12px; font-weight: 600; color: #1f9a78;
		background: #e6f8f2; padding: 5px 10px; border-radius: 999px;
	}
	.ek-sticky-advert__pill--muted { color: #6b747c; background: #f0f2f4; }
	.ek-dot-sm { width: 7px; height: 7px; border-radius: 50%; background: #2AC59B; position: relative; flex: 0 0 auto; }
	.ek-dot-sm::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; background: #2AC59B; opacity: .4; animation: ek-pulse-sm 1.8s ease infinite; }
	@keyframes ek-pulse-sm { 0% { transform: scale(.7); opacity: .5; } 70% { transform: scale(1.9); opacity: 0; } 100% { opacity: 0; } }

	.ek-sticky-advert__row { display: flex; gap: 10px; align-items: stretch; }
	.ek-sticky-advert__col { flex: 1 1 0; min-width: 0; }
	.ek-sticky-advert__btn {
		display: flex; align-items: center; justify-content: center; gap: 7px;
		width: 100%; box-sizing: border-box; font-family: inherit;
		font-size: 14px; font-weight: 700; line-height: 1; padding: 12px 12px; margin: 0;
		border-radius: 12px; border: 1.5px solid transparent; cursor: pointer;
		text-decoration: none; white-space: nowrap;
	}
	.ek-sticky-advert__row > .ek-sticky-advert__btn--msg { flex: 1 1 0; }
	.ek-sticky-advert__btn--call { background: #2AC59B; border-color: #2AC59B; color: #fff; }
	.ek-sticky-advert__btn--call:hover, .ek-sticky-advert__btn--call:focus { background: #4ad8b2; border-color: #4ad8b2; color: #fff; }
	.ek-sticky-advert__btn--msg { background: #e6f8f2; border-color: #e6f8f2; color: #1f9a78; }
	.ek-sticky-advert__btn--msg:hover, .ek-sticky-advert__btn--msg:focus { background: #d8f3ea; border-color: #d8f3ea; color: #1f9a78; }
	.ek-sticky-advert__ico { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
	.ek-sticky-advert__phone { display: block; text-align: center; font-weight: 700; font-size: 15px; color: #1f9a78; padding: 6px 4px; }
	.ek-sticky-advert__phone:empty { display: none; }
	.ek-sticky-advert__phone a { color: #1f9a78; text-decoration: none; }
}
