/* Buyreal Delivery — header bar, address picker, product-card dates.
   Colours/sizes come from CSS variables set in Buyreal Delivery → Header Bar & Cards. */

/* ---------- Header "Deliver to" bar ---------- */
.brda-bar {
	box-sizing: border-box;
	width: 100%;
	background: var(--brda-bar-bg, #37475a);
	color: var(--brda-bar-text, #fff);
	font-size: var(--brda-bar-font, 14px);
	line-height: 1.3;
	z-index: 390;
}
.brda-bar--sticky { position: -webkit-sticky; position: sticky; top: var(--brda-bar-top, 0px); }
/* Scoped reset: themes (e.g. WoodMart) restyle buttons/links globally — centred
   flex, fixed height, capitalised text. Our controls opt out completely. */
.brda-bar .brda-bar__btn,
.brda-sheet [role="button"],
.brda-sheet button,
.brda-ce [role="button"] {
	all: unset; box-sizing: border-box; cursor: pointer; font-family: inherit;
	-webkit-tap-highlight-color: transparent;
}
.brda-bar .brda-bar__btn {
	display: flex; align-items: center; justify-content: flex-start; gap: 8px;
	width: 100%; max-width: 1400px; margin: 0 auto; padding: var(--brda-bar-pad, 10px) 15px;
	color: inherit; font-size: inherit; line-height: 1.3; text-align: left; text-transform: none; letter-spacing: normal;
}
.brda-bar .brda-bar__btn:hover { background: rgba(255, 255, 255, .06); }
.brda-bar .brda-bar__btn:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
/* Alignment (Header Bar & Cards → Alignment) */
.brda-bar.brda-bar--left .brda-bar__btn   { justify-content: flex-start; text-align: left; }
.brda-bar.brda-bar--center .brda-bar__btn { justify-content: center;     text-align: center; }
.brda-bar.brda-bar--right .brda-bar__btn  { justify-content: flex-end;   text-align: right; }
.brda-bar__pin { flex-shrink: 0; color: var(--brda-bar-icon, #fff); }
.brda-bar__label { text-transform: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.brda-bar__chev { flex-shrink: 0; opacity: .9; }
@media (min-width: 769px) { .brda-bar--dev-mobile { display: none !important; } }
@media (max-width: 768px) { .brda-bar--dev-desktop { display: none !important; } }

/* ---------- Address picker ---------- */
.brda-sheet { position: fixed; inset: 0; z-index: 100000; font-size: 15px; line-height: 1.4; color: #111827; }
.brda-sheet[hidden] { display: none; }
.brda-sheet * { box-sizing: border-box; }
.brda-sheet__backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .5); opacity: 0; transition: opacity .2s ease; }
.brda-sheet__panel {
	position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; display: flex; flex-direction: column;
	background: #f3f4f6; border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
	transform: translateY(100%); transition: transform .22s ease;
	padding-bottom: env(safe-area-inset-bottom, 0);
}
.brda-sheet.is-open .brda-sheet__backdrop { opacity: 1; }
.brda-sheet.is-open .brda-sheet__panel { transform: none; }
@media (min-width: 769px) {
	.brda-sheet__panel { left: 50%; right: auto; bottom: auto; top: 50%; width: 460px; max-height: 80vh; border-radius: 18px; transform: translate(-50%, -46%); opacity: 0; transition: transform .2s ease, opacity .2s ease; }
	.brda-sheet.is-open .brda-sheet__panel { transform: translate(-50%, -50%); opacity: 1; }
	.brda-sheet__grab { display: none; }
}
html.brda-sheet-open, html.brda-sheet-open body { overflow: hidden; }
.brda-sheet__grab { width: 42px; height: 5px; border-radius: 99px; background: #d1d5db; margin: 10px auto 0; flex-shrink: 0; }
.brda-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 6px; }
.brda-sheet__head h3 { margin: 0; font-size: 18px; font-weight: 700; color: #111827; line-height: 1.3; }
.brda-sheet .brda-sheet__close { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #e5e7eb; color: #374151; font-size: 22px; line-height: 1; flex-shrink: 0; }
.brda-sheet .brda-sheet__close:hover { background: #d1d5db; }
.brda-sheet__body { padding: 8px 16px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.brda-sheet__search {
	display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #e5e7eb; border-radius: 16px;
	padding: 6px 6px 6px 14px; margin-bottom: 10px; color: #6b7280;
}
.brda-sheet__search input {
	flex: 1; min-width: 0; height: 44px; border: 0 !important; outline: 0; box-shadow: none !important; background: transparent;
	font-size: 16px; color: #111827; padding: 0; margin: 0; letter-spacing: .04em;
}
.brda-sheet__search input::placeholder { letter-spacing: normal; color: #6b7280; }
.brda-sheet .brda-sheet__search button {
	display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 20px; border-radius: 12px;
	background: var(--brda-sheet-accent, #2563eb); color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; flex-shrink: 0;
}
.brda-sheet .brda-sheet__search button:hover { opacity: .9; }

.brda-sheet .brda-sheet__row {
	display: flex; align-items: center; justify-content: flex-start; gap: 14px; width: 100%; margin: 0 0 10px; padding: 16px 18px;
	background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; color: #111827; font-size: 15px; font-weight: 600;
	line-height: 1.35; text-align: left; text-decoration: none; text-transform: none; letter-spacing: normal; cursor: pointer;
}
.brda-sheet .brda-sheet__row:hover { border-color: #cbd5e1; color: #111827; }
.brda-sheet .brda-sheet__row:focus-visible, .brda-sheet .brda-addr:focus-visible, .brda-sheet .brda-recent:focus-visible { outline: 2px solid var(--brda-sheet-accent, #2563eb); outline-offset: 2px; }
.brda-sheet .brda-sheet__row--add, .brda-sheet .brda-sheet__row--add:hover { color: var(--brda-sheet-accent, #2563eb); }
.brda-sheet__row--add .brda-sheet__ico { font-size: 26px; font-weight: 400; line-height: 1; }
.brda-sheet__ico { width: 24px; display: inline-flex; justify-content: center; color: var(--brda-sheet-accent, #2563eb); flex-shrink: 0; }
.brda-sheet__row-text { flex: 1; min-width: 0; text-align: left; }
.brda-sheet__go { color: var(--brda-sheet-accent, #2563eb); flex-shrink: 0; }
.brda-sheet__msg { font-size: 13px; color: #374151; margin: -2px 4px 10px; }
.brda-sheet__msg:empty { display: none; }
.brda-sheet__msg.is-error { color: #d93025; font-weight: 600; }
.brda-sheet__label { margin: 16px 4px 8px; font-size: 12px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; }
.brda-sheet__signin { display: block; padding: 14px 16px; margin-bottom: 10px; border-radius: 16px; background: #fff; border: 1px dashed #cbd5e1; color: #374151; font-weight: 600; text-decoration: none; }

/* Address card — same look as My Account → Address book */
.brda-sheet .brda-addr {
	position: relative; display: flex; align-items: flex-start; gap: 14px; width: 100%; margin: 0 0 12px; padding: 16px 16px 14px;
	background: #fff; border: 1.5px solid #e5e7eb; border-radius: 20px; color: #111827; text-align: left;
	text-transform: none; letter-spacing: normal; line-height: 1.45; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease;
}
.brda-sheet .brda-addr:hover { border-color: #cbd5e1; box-shadow: 0 2px 10px rgba(17, 24, 39, .06); }
.brda-sheet .brda-addr.is-selected { border-color: var(--brda-sheet-accent, #2563eb); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.brda-addr__ico { width: 44px; height: 44px; border-radius: 14px; background: #f3f4f6; color: #111827; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brda-addr__body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding-right: 26px; }
.brda-addr__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; }
.brda-addr__title { font-weight: 700; font-size: 16px; color: #111827; }
.brda-addr__badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: #ecfdf3; color: #15803d; font-size: 12px; font-weight: 600; }
.brda-addr__lines { display: block; color: #1f2937; font-size: 14.5px; word-break: break-word; }
.brda-addr__meta { display: block; margin-top: 4px; color: #6b7280; font-size: 13.5px; word-break: break-word; }
.brda-addr__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.brda-sheet .brda-addr__edit { color: #111827; font-weight: 700; font-size: 14px; text-decoration: none; padding: 2px 0; }
.brda-sheet .brda-addr__edit:hover { text-decoration: underline; color: #111827; }
.brda-addr__sel { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; background: #eff6ff; color: var(--brda-sheet-accent, #2563eb); font-size: 12px; font-weight: 700; }
.brda-addr__use { color: var(--brda-sheet-accent, #2563eb); font-size: 13px; font-weight: 600; }
.brda-addr__radio { position: absolute; top: 18px; right: 16px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #cbd5e1; background: #fff; }
.brda-addr.is-selected .brda-addr__radio { border-color: var(--brda-sheet-accent, #2563eb); box-shadow: inset 0 0 0 4px #fff; background: var(--brda-sheet-accent, #2563eb); }

.brda-sheet .brda-recent {
	display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 8px; padding: 12px 14px;
	background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; color: #111827; font-size: 14px;
	text-align: left; text-transform: none; letter-spacing: normal; cursor: pointer;
}
.brda-recent svg { color: #6b7280; flex-shrink: 0; }
.brda-recent span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brda-recent em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--brda-sheet-accent, #2563eb); }
.brda-sheet .brda-recent.is-selected { border-color: var(--brda-sheet-accent, #2563eb); }

/* ---------- Product-card delivery date ---------- */
.brda-ce { font-size: var(--brda-ce-font, 12px); line-height: 1.35; color: var(--brda-ce-color, #1f2937); margin: 4px 0 2px; }
.brda-ce:empty { display: none; }
.brda-ce-date { color: var(--brda-ce-date, #0f9d58); font-weight: 700; }
.brda-ce--blocked { color: var(--brda-ce-blocked, #d93025); font-weight: 600; }
.brda-ce .brda-ce__prompt { display: inline; color: #2563eb; font-weight: 600; text-decoration: underline; text-transform: none; }

@media (prefers-reduced-motion: reduce) { .brda-sheet__panel, .brda-sheet__backdrop { transition: none; } }
