/* [tplm_finder] — one-panel Deal Finder. Card/modal styles are shared with deals-map2.css. */
.tplm-fd { width: 100%; }
.tplm-fd *, .tplm-fd *::before, .tplm-fd *::after { box-sizing: border-box; }

/* Panel: deals column on the left, map filling the full height on the right. */
.tplm-fd-box {
	display: grid;
	grid-template-columns: calc(var(--tplm-fd-list-w, 430px) + 48px) minmax(0, 1fr);
	grid-template-rows: auto minmax(0, 1fr);
	grid-template-areas: "top map" "list map";
	height: var(--tplm-d2-map-h, 760px);
	border: 1.5px solid #cfd5de; border-radius: 18px; background: #fff; overflow: hidden;
}
.tplm-fd-top { grid-area: top; display: flex; flex-direction: column; gap: 14px; padding: 26px 24px 14px; min-width: 0; }
.tplm-fd-listcol { grid-area: list; position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 6px 24px 22px; }
.tplm-fd-mapcol { grid-area: map; position: relative; min-height: 0; overflow: hidden; border-left: 1.5px solid #cfd5de; background: #E8EDF2; }
.tplm-fd-mapcol .tplm-frontend-map { position: absolute; inset: 0; width: 100%; height: 100%; }

.tplm-fd-head { display: flex; flex-direction: column; gap: 4px; }
.tplm-fd-head .tplm-d2-h2 { margin: 0; }
.tplm-fd-head .tplm-d2-intro { margin: 0; }

.tplm-fd-toggle { display: flex; align-self: flex-start; overflow: hidden; border: 1.5px solid var(--tplm-d2-accent, #00437a); border-radius: 8px; }
.tplm-fd-toggle[hidden] { display: none; }
.tplm-fd-tab { margin: 0; padding: 9px 16px; border: 0; border-radius: 0; background: #fff; color: var(--tplm-d2-accent, #00437a); font: inherit; font-size: 13px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.tplm-fd-tab.is-on { background: var(--tplm-d2-accent, #00437a); color: #fff; }
.tplm-fd-tab:focus-visible { outline: 3px solid #2f6fb0; outline-offset: -3px; }

/* Address search */
.tplm-fd-addr { display: flex; flex-direction: column; gap: 8px; }
.tplm-fd-addr-row { display: flex; gap: 8px; }
.tplm-fd-q { flex: 1 1 auto; min-width: 0; height: 42px; margin: 0; padding: 0 14px; border: 1.5px solid #b9c0cc; border-radius: 8px; font: inherit; font-size: 14px; background: #fff; color: #1a2230; }
.tplm-fd-addr .tplm-d2-go { flex: none; height: 42px; margin: 0; white-space: nowrap; }
.tplm-fd-addr .tplm-d2-near { align-self: flex-start; margin: 0; }
.tplm-fd .tplm-d2-status[hidden], .tplm-fd-note[hidden], .tplm-fd-empty[hidden], .tplm-fd-views[hidden], .tplm-fd-near[hidden], .tplm-fd-strip[hidden] { display: none; }
.tplm-fd .tplm-d2-status { margin: 0; }
.tplm-fd-note { margin: 0; padding: 12px 16px; border-left: 4px solid #2f6fb0; border-radius: 6px; background: #EAF2FB; color: #1a2230; font-size: 14px; line-height: 1.45; }

/* Deals | Closest to me */
.tplm-fd-views { display: flex; padding: 3px; border-radius: 999px; background: #eef1f5; }
.tplm-fd-view { flex: 1 1 0; margin: 0; padding: 9px 0; border: 0; border-radius: 999px; background: transparent; color: #4b5563; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.tplm-fd-view.is-on { background: #fff; color: #1a2230; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }

.tplm-fd-count { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #4b5563; }
.tplm-fd-clear { margin: 0 0 0 8px; padding: 0; border: 0; background: none; color: #2f6fb0; font: inherit; font-size: 12px; font-weight: 700; text-transform: none; letter-spacing: 0; text-decoration: underline; cursor: pointer; }
.tplm-fd-grid { display: grid; grid-template-columns: repeat(var(--tplm-fd-cols, 1), minmax(0, 1fr)); gap: 22px 14px; }
.tplm-fd-strip { position: relative; }
.tplm-fd-arrow { display: none; }
.tplm-fd-empty { margin: 8px 0; color: #4b5563; font-size: 14px; }

/* Closest to me list */
/* each location is its own card */
.tplm-fd-near { display: flex; flex-direction: column; gap: 10px; }
.tplm-fd-near-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border: 2px solid var(--tplm-d2-tile, #2f6fb0); border-radius: 14px; background: #fff; overflow: hidden; cursor: pointer; transition: box-shadow .15s ease; }
.tplm-fd-near-row:hover { box-shadow: 0 4px 14px rgba(16, 30, 54, .18); }
.tplm-fd-near-row::after { content: ""; position: absolute; inset: 0; background: rgba(47, 111, 176, .14); opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.tplm-fd-near-row.is-active::after { opacity: 1; }
.tplm-fd-near-row:focus-visible { outline: 3px solid #2f6fb0; outline-offset: -3px; }
.tplm-fd-near-logo { flex: none; display: flex; align-items: center; justify-content: center; width: 78px; height: 58px; }
.tplm-fd-near-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tplm-fd-near-name { font-size: 10px; font-weight: 700; text-align: center; }
.tplm-fd-near-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tplm-fd-near-text .tplm-fd-deal { font-size: 12px; }
.tplm-fd-near-text .tplm-fd-deal i { font-style: normal; color: #777; font-size: 10px; letter-spacing: .1em; }
.tplm-fd-near-addr { font-size: 11.5px; color: #555; line-height: 1.3; }
.tplm-fd-dir { align-self: flex-start; font-size: 11.5px; font-weight: 700; color: #2271b1; text-decoration: underline; }
.tplm-fd-near-mi { flex: none; font-size: 13px; font-weight: 800; color: #00437a; }

/* Online mode: no map, no address search, rows in columns. */
.tplm-fd.is-online .tplm-fd-mapcol, .tplm-fd.is-online .tplm-fd-addr, .tplm-fd.is-online .tplm-fd-views { display: none; }
.tplm-fd.is-online .tplm-fd-box { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "list"; height: auto; }
.tplm-fd.is-online .tplm-fd-listcol { overflow: visible; }
.tplm-fd.is-online .tplm-fd-grid { grid-template-columns: repeat(var(--tplm-fd-ocols-d, 2), minmax(0, 1fr)); }

@media (max-width: 1024px) {
	.tplm-fd-box { grid-template-columns: calc(360px + 48px) minmax(0, 1fr); }
}
@media (max-width: 900px) {
	/* Phone / small tablet: heading + address, then swipe strip, then a short map; after a search: map, then the closest list. */
	.tplm-fd-box { display: flex; flex-direction: column; height: auto; overflow: visible; }
	.tplm-fd-top { order: 0; padding: 20px 16px 12px; }
	.tplm-fd-listcol { order: 1; overflow: visible; padding: 0 16px 16px; }
	.tplm-fd-mapcol { order: 2; flex: none; height: var(--tplm-d2-map-h-m, 340px); margin: 0 16px 16px; border: 1.5px solid #cfd5de; border-radius: 12px; }
	.tplm-fd.has-search .tplm-fd-mapcol { order: 1; margin-bottom: 8px; }
	.tplm-fd.has-search .tplm-fd-listcol { order: 2; }
	.tplm-fd-addr-row { gap: 6px; }
	.tplm-fd-toggle { width: 100%; }
	.tplm-fd-tab { flex: 1 1 0; padding: 12px 0; text-align: center; }
}

/* ---------- Deal row cards ----------
   Desktop: a wide card with a border in the card color. Left block = photo with the logo centered on it;
   right = deal text on white, expiry bottom-right. Phone: no photo; plain white card with the logo
   straddling the top edge. One offer per card; a double deal is two cards joined by an OR badge. */
.tplm-fd-row { --tplm-d2-tile: #d62839; position: relative; display: flex; width: 100%; min-height: 116px; margin: 0; padding: 0; border: 1.5px solid var(--tplm-d2-tile); border-radius: 14px; background: #fff; color: inherit; font: inherit; text-align: left; cursor: pointer; overflow: visible; transition: box-shadow .15s ease; }
.tplm-fd-row:hover { box-shadow: 0 4px 14px rgba(16, 30, 54, .18); }
.tplm-fd-row::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(47, 111, 176, .14); opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.tplm-fd-row.is-active::after { opacity: 1; }
.tplm-fd-row:focus-visible { outline: 3px solid #2f6fb0; outline-offset: 2px; }
.tplm-fd-row-photo { position: relative; flex: none; align-self: stretch; display: block; width: 38%; min-width: 140px; max-width: 200px; overflow: hidden; border-radius: 12px 0 0 12px; background: #eef1f5; background: color-mix(in srgb, var(--tplm-d2-tile) 14%, #fff); pointer-events: none; }
.tplm-fd-row-photo::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, var(--tplm-fd-veil, .28)); }
.tplm-fd-row-photo > img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tplm-fd-row-logo { position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%); display: block; width: 86%; height: 68%; pointer-events: none; }
.tplm-fd-row-logo img { display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; object-position: center; }
.tplm-fd-row-text { position: relative; z-index: 2; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 14px 16px 30px 18px; }
.tplm-fd-row-name { font-size: 14px; font-weight: 700; color: #1a2230; }
.tplm-fd-deal { display: block; font-size: 17px; font-weight: 800; line-height: 1.15; text-transform: uppercase; color: var(--tplm-d2-deal, #e5202e); }
.tplm-fd-deal--big { font-size: 34px; line-height: 1; letter-spacing: -.01em; }
.tplm-fd-detail { display: block; font-size: 14px; line-height: 1.3; color: #444; }
.tplm-fd-bridge { position: absolute; z-index: 6; left: 50%; top: calc(100% + 11px); transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; box-sizing: border-box; border: 1.5px solid var(--tplm-d2-tile); border-radius: 50%; background: #fff; color: var(--tplm-d2-tile); font-size: 12px; font-weight: 800; line-height: 1; pointer-events: none; }
.tplm-fd-or { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-size: 9px; font-weight: 700; letter-spacing: .14em; color: #555; }
.tplm-fd-or::before, .tplm-fd-or::after { content: ""; flex: 1; height: 1px; background: #c9c9c9; }
.tplm-fd-row-foot { position: absolute; right: 14px; bottom: 9px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.tplm-fd-exp { font-size: 12.5px; font-style: italic; color: #555; }
.tplm-fd-tag { align-self: flex-start; padding: 2px 8px; border-radius: 999px; background: #EAF2FB; color: #1d5a99; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.tplm-fd-show { padding: 5px 10px; border-radius: 6px; background: #2f6fb0; color: #fff; font-size: 11.5px; font-weight: 700; white-space: nowrap; }

/* Online mode: rows in two columns */
.tplm-fd.is-online .tplm-fd-grid { grid-template-columns: repeat(var(--tplm-fd-ocols-d, 2), minmax(0, 1fr)); }

/* Phone / small tablet: swipe strip of vertical cards (with side arrows) ABOVE a short map. No photo here:
   plain white cards, logo straddling the top edge, centered text. The strip's top padding leaves room for the logos. */
@media (max-width: 900px) {
	.tplm-fd-grid { display: flex; gap: 10px 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 34px 14px 8px 16px; -webkit-overflow-scrolling: touch; }
	.tplm-fd-grid::-webkit-scrollbar { display: none; }
	.tplm-fd:not(.is-online) .tplm-fd-row { flex: 0 0 176px; flex-direction: column; min-height: 200px; scroll-snap-align: start; border-radius: 12px; }
	.tplm-fd:not(.is-online) .tplm-fd-row-photo { position: absolute; inset: 0; width: auto; min-width: 0; max-width: none; overflow: visible; background: none; border-radius: 0; }
	.tplm-fd:not(.is-online) .tplm-fd-row-photo::after,
	.tplm-fd:not(.is-online) .tplm-fd-row-photo > img { display: none; }
	.tplm-fd:not(.is-online) .tplm-fd-row-logo { left: 50%; top: -30px; transform: translateX(-50%); width: 130px; height: 62px; }
	.tplm-fd:not(.is-online) .tplm-fd-row-logo img { object-position: center bottom; }
	.tplm-fd:not(.is-online) .tplm-fd-row-text { flex: 1 1 auto; justify-content: center; align-items: center; gap: 5px; padding: 34px 10px 30px; text-align: center; }
	.tplm-fd:not(.is-online) .tplm-fd-deal { font-size: 15px; }
	.tplm-fd:not(.is-online) .tplm-fd-deal--big { font-size: 30px; }
	.tplm-fd:not(.is-online) .tplm-fd-detail { font-size: 12.5px; }
	.tplm-fd:not(.is-online) .tplm-fd-row-foot { position: absolute; left: 0; right: 0; bottom: 10px; justify-content: center; }
	.tplm-fd:not(.is-online) .tplm-fd-exp { font-size: 12px; }
	.tplm-fd:not(.is-online) .tplm-fd-bridge { left: calc(100% + 10px); top: 50%; }
	.tplm-fd-arrow { position: absolute; top: 50%; z-index: 10; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin: -17px 0 0; padding: 0; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(16, 30, 54, .3); color: #00437a; font-size: 24px; line-height: 1; cursor: pointer; }
	.tplm-fd-arrow--prev { left: -6px; }
	.tplm-fd-arrow--next { right: -6px; }
	/* Online mode on phones: full-width rows (same look as desktop), no arrows */
	.tplm-fd.is-online .tplm-fd-grid { display: grid; grid-template-columns: minmax(0, 1fr); overflow: visible; padding: 4px 0 0; gap: 24px 0; }
	.tplm-fd.is-online .tplm-fd-row { flex: none; flex-direction: row; }
	.tplm-fd.is-online .tplm-fd-row-photo { width: 34%; min-width: 110px; }
	.tplm-fd.is-online .tplm-fd-bridge { top: calc(100% + 12px); }
	.tplm-fd.is-online .tplm-fd-arrow { display: none; }
}
