/* WTB Buy Now — front-end styles. Theme colour: #F7941D */

/* Isolate modal from the host theme — reset common form overrides.
   .wtb-bn-inline is the embedded ([wtb_find_retailer]) variant of the popup. */
.wtb-bn-overlay *,
.wtb-bn-inline * { box-sizing: border-box; }
.wtb-bn-overlay input,
.wtb-bn-overlay button,
.wtb-bn-overlay select,
.wtb-bn-overlay a,
.wtb-bn-inline input,
.wtb-bn-inline button,
.wtb-bn-inline select,
.wtb-bn-inline a { font-family: inherit; font-size: inherit; }
.wtb-bn-overlay input,
.wtb-bn-inline input { border: none !important; outline: none !important; box-shadow: none !important; -webkit-appearance: none; appearance: none; background: transparent; }
.wtb-bn-overlay button,
.wtb-bn-inline button { border: none !important; outline: none; box-shadow: none !important; }

/* ----- Button ------------------------------------------------------------ */

.wtb-bn-button {
	display: inline-block;
	padding: 12px 28px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #fff;
	background: #F7941D;
	border: 1px solid #F7941D;
	border-radius: 10px;
	cursor: pointer;
	margin: 12px 0;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.wtb-bn-button:hover,
.wtb-bn-button:focus { background: #E08518; border-color: #E08518; }

.wtb-bn-button--empty {
	background: #888;
	border-color: #888;
	cursor: not-allowed;
	opacity: 0.85;
}
.wtb-bn-button--empty:hover,
.wtb-bn-button--empty:focus { background: #888; border-color: #888; }

/* Find a Store gets a distinct default look (overridden by shortcode colors). */
.wtb-bn-button--find { background: #495965; border-color: #495965; }
.wtb-bn-button--find:hover,
.wtb-bn-button--find:focus { background: #3a4750; border-color: #3a4750; }

/* Spacing when both buttons sit next to each other. */
.wtb-bn-button + .wtb-bn-button { margin-left: 10px; }

/* ----- Modal overlay ----------------------------------------------------- */

.wtb-bn-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 16px;
	animation: wtbBnFade 0.15s ease;
}

@keyframes wtbBnFade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.wtb-bn-modal {
	width: 100%;
	max-width: 900px;
	max-height: 90vh;
	background: #fff;
	border-radius: 4px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

/* Embedded popup ([wtb_find_retailer]) — same box, in the page flow. */

/* Break out of the theme's (often narrow) content column: full viewport width,
   capped and centered, so both sections get real room. */
.wtb-bn-inline:not(.wtb-bn-inline--empty) {
	position: relative;
	left: 50%;
	transform: translateX(-50%);
	width: calc(100vw - 40px);
	max-width: 1200px;
}

.wtb-bn-modal--inline {
	max-width: 100%;
	max-height: none;
	margin: 12px 0;
	border: 1px solid #ececec;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
/* Cap each section's list like the modal does, so long lists scroll in place. */
/* .wtb-bn-modal--inline .wtb-bn-modal__body { max-height: 640px; } */

/* Two side-by-side sections: Online Retailers | Find In-Store. */
.wtb-bn-inline-cols {
	display: flex;
	align-items: stretch;
}
.wtb-bn-inline-col {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}
.wtb-bn-inline-col--instore { border-left: 1px solid #e5e5e5; }
.wtb-bn-inline-col .wtb-bn-modal__body { flex: 1; }

/* Bigger map in the embedded layout — it owns a whole column. */
.wtb-bn-inline .wtb-bn-fis-map-wrap { height: 320px; }

/* The columns are half-width, so rows must shrink/wrap instead of clipping —
   never a sideways scroll. */
.wtb-bn-inline .wtb-bn-modal__body,
.wtb-bn-inline .wtb-bn-fis-stores { overflow-x: hidden; }

.wtb-bn-inline .wtb-bn-retailer {
	flex-wrap: wrap;
	gap: 10px 14px;
	padding: 14px 16px;
}
.wtb-bn-inline .wtb-bn-retailer__logo,
.wtb-bn-inline .wtb-bn-retailer__logo--placeholder {
	flex: 0 1 110px;
	min-width: 0;
}
.wtb-bn-inline .wtb-bn-retailer__status {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}
.wtb-bn-inline .wtb-bn-retailer__cta {
	flex: 0 0 auto;
	margin-left: auto;
}

/* Store cards: use the compact two-column layout (like mobile) so the third
   column never pushes past the half-width column. */
/* .wtb-bn-inline .wtb-bn-store-card { grid-template-columns: auto 1fr; } */
.wtb-bn-inline .wtb-bn-store-col--last {
	
	text-align: left;
	align-items: flex-start;
	flex-direction: column ;
	gap: 14px;
}

/* Static section headings — same look as the tab bar, but not interactive.
   min-height keeps both bars equal even though only one holds the search box. */
.wtb-bn-modal__tabs--static { min-height: 50px; }
.wtb-bn-tab--static,
.wtb-bn-inline .wtb-bn-tab--static {
	cursor: default;
	pointer-events: none;
	display: flex;
	align-items: center;
}
.wtb-bn-tab--static:hover,
.wtb-bn-inline .wtb-bn-tab--static:hover { background: #F7941D !important; }

/* Stack the sections on small screens. */
@media (max-width: 800px) {
	.wtb-bn-inline-cols { flex-direction: column; }
	.wtb-bn-inline-col--instore { border-left: none; border-top: 1px solid #e5e5e5; }
}

/* Active tab + location input keep their look outside the overlay too. */
.wtb-bn-inline .wtb-bn-tab--active        { background: inherit !important; color: #fff !important; }
.wtb-bn-inline .wtb-bn-tab--active:hover  { background: inherit !important; }
.wtb-bn-inline .wtb-bn-loc-input {
	background: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	color: #fff !important;
}

.wtb-bn-inline--empty .wtb-bn-state {
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 4px;
}

/* ----- Inline header: product search + back-to-all reset ------------------ */

.wtb-bn-inline-side {
	margin-left: auto;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	flex: 0 0 auto;
}

.wtb-bn-psearch {
	position: relative;
	display: flex;
	align-items: center;
	width: 260px;
	max-width: 100%;
	height: 38px;
	padding: 0 10px;
	background: #fff;
	border: 1px solid #c8c8c8 !important;
	border-radius: 2px;
}
.wtb-bn-inline .wtb-bn-psearch__input {
	flex: 1;
	min-width: 0;
	color: #333 !important;
	font-size: 13px;
	background: transparent !important;
}
.wtb-bn-psearch__input::placeholder { color: #999; font-style: italic; }
.wtb-bn-psearch__icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	color: #555;
}

.wtb-bn-psearch__list {
	position: absolute;
	top: calc(100% + 2px);
	left: 0;
	right: 0;
	z-index: 100000;
	background: #fff;
	border: 1px solid #ddd;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	max-height: 300px;
	overflow-y: auto;
}
.wtb-bn-psearch__item {
	padding: 9px 12px;
	font-size: 13px;
	line-height: 1.4;
	color: #444;
	cursor: pointer;
	border-bottom: 1px solid #f0f0f0;
}
.wtb-bn-psearch__item:last-child { border-bottom: none; }
.wtb-bn-psearch__item:hover { background: #f5f5f5; }
.wtb-bn-psearch__item--none { cursor: default; color: #888; }
.wtb-bn-psearch__item--none:hover { background: #fff; }

.wtb-bn-inline .wtb-bn-inline-reset {
	background: none !important;
	font-size: 30px;
	line-height: 1;
	color: #cc1818;
	cursor: pointer;
	padding: 2px 6px;
}
.wtb-bn-inline .wtb-bn-inline-reset:hover { color: #333; }

@media (max-width: 640px) {
	.wtb-bn-psearch { width: 180px; }
}

/* ----- Modal header ------------------------------------------------------ */

.wtb-bn-modal__header {
	display: flex;
	gap: 16px;
	padding: 20px 24px;
	border-bottom: 1px solid #f0f0f0;
	position: relative;
	background: #fff;
}

.wtb-bn-modal__image {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	object-fit: contain;
}

.wtb-bn-modal__title-wrap { flex: 1; min-width: 0; padding-right: 32px; }

.wtb-bn-modal__title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 700;
	color: #fff;
}

.wtb-bn-modal__description {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: #666;
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 5;
}

.wtb-bn-modal__close {
	position: absolute;
	top: 12px; right: 14px;
	background: none; border: none;
	font-size: 26px; line-height: 1;
	cursor: pointer; color: #aaa;
	padding: 2px 6px;
}
.wtb-bn-modal__close:hover { color: #333; }

/* ----- Tab bar + location search ---------------------------------------- */

.wtb-bn-modal__tabs {
	display: flex;
	align-items: stretch;
	background: #3d3d3d;
	flex-shrink: 0;
	margin-bottom: 5px;
}

.wtb-bn-tab {
	flex: 0 0 auto;
	padding: 14px 22px;
	color: #c0c0c0;
	background: transparent; border: none;
	font-size: 13px; font-weight: 600;
	text-transform: uppercase; letter-spacing: 0.6px;
	cursor: pointer;
	transition: color 0.1s, background 0.1s;
}
.wtb-bn-tab:hover            { color: #fff; }
.wtb-bn-tab--active,
.wtb-bn-overlay .wtb-bn-tab--active          { background: #F7941D !important; color: #fff !important; }
.wtb-bn-tab--active:hover,
.wtb-bn-overlay .wtb-bn-tab--active:hover    { background: #E08518 !important; }

/* Location search — right side of tab bar */

.wtb-bn-loc-wrap {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 0;
	background: rgba(255, 255, 255, 0.13) !important;
	border: 1px solid rgba(255, 255, 255, 0.4) !important;
	border-radius: 2px;
	padding: 0 2px;
	margin: 8px 12px;
	height: 34px;
	box-sizing: border-box;
	box-shadow: none !important;
}

.wtb-bn-loc-geo,
.wtb-bn-loc-search {
	flex: 0 0 auto;
	display: flex; align-items: center; justify-content: center;
	width: 30px; height: 30px;
	background: none; border: none;
	cursor: pointer; color: rgba(255, 255, 255, 0.75);
	padding: 0;
	transition: color 0.1s;
}
.wtb-bn-loc-geo:hover,
.wtb-bn-loc-search:hover { color: #fff; }

.wtb-bn-loc-input,
.wtb-bn-overlay .wtb-bn-loc-input {
	flex: 1;
	min-width: 0;
	width: 150px;
	background: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	color: #fff !important;
	font-size: 13px;
	padding: 0 4px;
	-webkit-appearance: none;
	appearance: none;
}
.wtb-bn-loc-input::placeholder { color: rgba(255, 255, 255, 0.55); }

/* ----- Modal body -------------------------------------------------------- */

.wtb-bn-modal__body {
	flex: 1;
	overflow-y: auto;
	background: #f6f6f6;
}

/* ----- Retailer list ---------------------------------------------------- */

.wtb-bn-retailers { list-style: none; margin: 0; padding: 0; }

.wtb-bn-retailer {
	display: flex;
	align-items: center;
	gap: 16px;
	background: #fff;
	padding: 14px 24px;
	border-bottom: 1px solid #f0f0f0;
}

.wtb-bn-retailer__logo {
	flex: 0 0 140px;
	max-width: 140px; max-height: 44px;
	object-fit: contain;
}
.wtb-bn-retailer__logo--placeholder {
	flex: 0 0 140px;
	font-size: 14px;
	font-weight: 600;
	color: #444;
}

.wtb-bn-retailer__status { flex: 1; font-size: 14px; color: #2e7d32; font-weight: 500; }
.wtb-bn-retailer__status--unknown { color: #888; font-weight: 400; }

.wtb-bn-retailer__cta {
	flex: 0 0 auto;
	display: inline-block;
	padding: 9px 22px;
	background: #F7941D; color: #fff;
	text-decoration: none;
	font-size: 13px; font-weight: 600;
	text-transform: uppercase; letter-spacing: 0.5px;
	border-radius: 2px;
	transition: background 0.15s ease;
}
.wtb-bn-retailer__cta:hover,
.wtb-bn-retailer__cta:focus { background: #E08518; color: #fff; text-decoration: none; }

/* ----- State: loading / error / empty ----------------------------------- */

.wtb-bn-state {
	padding: 40px 24px;
	text-align: center;
	color: #666; font-size: 14px;
}
.wtb-bn-state--error { color: #b32d2e; }

/* ----- Find In-Store — map ----------------------------------------------- */

.wtb-bn-fis-map-wrap {
	flex-shrink: 0;
	height: 260px;
	background: #e8e8e8;
}

.wtb-bn-fis-map { width: 100%; height: 100%; }

/* Map pin marker (Leaflet divIcon) */

.wtb-bn-marker { width: 30px; height: 40px; cursor: pointer; }

.wtb-bn-marker__pin {
	width: 30px; height: 30px;
	background: #F7941D;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.9);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
	color: #fff;
	font-size: 12px; font-weight: 700;
	display: flex; align-items: center; justify-content: center;
	line-height: 1;
}

.wtb-bn-marker__tail {
	width: 0; height: 0;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 10px solid #F7941D;
	margin: 0 auto;
	position: relative; top: -1px;
}

/* ----- Find In-Store — store list --------------------------------------- */

.wtb-bn-fis-stores {
	background: #f6f6f6;
	/* Show ~3 store cards, scroll the rest. */
	max-height: 340px;
	overflow-y: auto;
}

/* Three-column store card: [number+image+online] [address+directions] [dist+stock+hours] */
.wtb-bn-store-card {
	display: grid;
	grid-template-columns: minmax(90px, auto) 1fr auto;
	align-items: start;
	gap: 8px 20px;
	padding: 14px 16px;
	background: #fff;
	border-bottom: 1px solid #efefef;
}
.wtb-bn-store-card:last-child { border-bottom: none; }

.wtb-bn-store-col {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 12px;
	min-width: 0;
	height: 100%;
}
.wtb-bn-store-col--last { text-align: right; align-items: flex-end; }

.wtb-bn-store-col__top {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.wtb-bn-store-col--first .wtb-bn-store-col__top {
	flex-direction: row;
	align-items: center;
	gap: 8px;
}

.wtb-bn-store-num {
	width: 28px; height: 28px;
	background: #F7941D;
	border-radius: 50%;
	color: #fff;
	font-size: 12px; font-weight: 700;
	display: flex; align-items: center; justify-content: center;
	flex-shrink: 0;
}
.wtb-bn-store-num--link { cursor: pointer; transition: transform .1s ease, box-shadow .1s ease; }
.wtb-bn-store-num--link:hover { transform: scale(1.12); box-shadow: 0 0 0 3px rgba(247,148,29,0.3); }

.wtb-bn-store-name {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #222;
	margin-bottom: 1px;
}

.wtb-bn-store-address { font-size: 12px; color: #666; }

.wtb-bn-store-phone {
	display: block;
	font-size: 12px !important;
	color: #666;
	text-decoration: none;
	margin-top: 1px;
}
.wtb-bn-store-phone:hover { color: #F7941D; }

.wtb-bn-store-link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px !important;
	font-weight: 400;
	color: #555;
	text-decoration: none;
	white-space: nowrap;
}
.wtb-bn-store-link svg { flex: 0 0 auto; }
.wtb-bn-store-link:hover,
.wtb-bn-store-link:focus { color: inherit; text-decoration: none;outline: 0; }

.wtb-bn-store-dist {
	font-size: 15px;
	font-weight: 700;
	color: #222;
	white-space: nowrap;
}

.wtb-bn-store-hours {
	font-size: 11px;
	color: #777;
	margin-top: 2px;
	line-height: 1.4;
}
.wtb-bn-store-hours p { margin: 0; }

/* ----- Mobile ----------------------------------------------------------- */

@media (max-width: 640px) {
	.wtb-bn-modal__header { gap: 12px; }
	.wtb-bn-modal__image  { width: 56px; height: 56px; flex-basis: 56px; }
	.wtb-bn-tab           { padding: 12px 14px; font-size: 11px; }
	.wtb-bn-loc-input     { width: 100px; }
	.wtb-bn-retailer      { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
	.wtb-bn-retailer__logo { flex-basis: 90px; }
	.wtb-bn-fis-map-wrap  { height: 200px; }
	.wtb-bn-store-card    { grid-template-columns: auto 1fr; }
	.wtb-bn-store-col--last { grid-column: 1 / -1; text-align: left; align-items: flex-start; flex-direction: row; gap: 14px; }
}

/* ---- Find In-Store: retailer logo, stock badges, info window ---- */
.wtb-bn-store-logo {
	width: 64px;
	height: 40px;
	object-fit: contain;
	flex: 0 0 auto;
	margin-right: 4px;
}
.wtb-bn-store-stock { font-weight: 600; font-size: 13px; white-space: nowrap; }
.wtb-bn-store-stock--in   { color: #128a3b; }
.wtb-bn-store-stock--out  { color: #b32d2e; }
.wtb-bn-store-stock--call { color: #8a6d00; }
.wtb-bn-iw {
	min-width: 170px;
	max-width: 260px;
	padding: 2px 4px 2px 2px;
	font-size: 13px;
	line-height: 1.4;
	color: #333;
}
.wtb-bn-iw__name {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: #111;
	margin-bottom: 3px;
	white-space: nowrap;
}
.wtb-bn-iw__addr { display: block; color: #666; }

/* Stop Google's scroll container from squeezing the content into a thin column. */
.gm-style .gm-style-iw-d { overflow: visible !important; }
