/**
 * BS Tracking Number Lookup — front-end form and results.
 */

.bs-tracking-lookup {
	--bs-tracking-lookup-border: #e2e2e2;
	--bs-tracking-lookup-accent: var(--e-global-color-primary, #163317);
	/* Phones fill the column; desktop narrows to a phone-like portrait card. */
	max-width: 430px;
	margin: 0 auto;
	/*
	 * The footer newsletter band is pulled up over the end of the page content
	 * (-20px on the section, and the card inside it pulls up further again on
	 * large screens). Reserve that space so the form is never covered.
	 */
	padding-bottom: 40px;
}

@media (min-width: 768px) {
	.bs-tracking-lookup {
		max-width: 350px;
	}
}

@media (min-width: 1024px) {
	.bs-tracking-lookup {
		padding-bottom: 170px;
	}
}

/*
 * The informational page templates reserve 330px on the right of .container
 * above 1310px (botanica-child/assets/css/informational.css) to keep long-form
 * text off the right edge. That leaves this centred form sitting well left of
 * the true page centre, so restore a symmetric gutter — on this page only, and
 * only for the two containers the lookup renders inside.
 */
@media screen and (min-width: 1310px) {
	.bs-tracking-lookup-page #rbb-page-title > .container,
	.bs-tracking-lookup-page main#primary > .container {
		padding-right: 15px;
	}
}

/*
 * Floating-window layout: the theme's page-title bar is hidden (the heading is
 * reprinted inside the card instead) and the content area becomes a full-bleed
 * image backdrop with the card centred on it. display:none keeps the hidden
 * heading out of the accessibility tree, so it is not announced twice.
 *
 * botanica-child/style.css:1290 gives that bar `display: flex` via
 * `.page-template-informational-no-hero #rbb-page-title`, which carries the
 * same specificity as a plain `.class #id` — hence the `body` prefix below.
 */
body.bs-tracking-lookup-page #rbb-page-title {
	display: none;
}

.bs-tracking-lookup-page main#primary {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	/* The image URL is injected inline — it lives in the child theme. */
	background-color: #10210f;
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	/* Bottom padding clears the footer newsletter card's pull-up. */
	padding: 48px 0 80px;
}

/*
 * Tablet and desktop: centre the card on the backdrop. main's height is driven
 * by its content, so `align-items: center` has no slack to distribute and the
 * padding is what positions the card — hence near-symmetric values here rather
 * than relying on the flex alignment above. Being padding-based, the centring
 * holds however tall the card grows once a result or notice is shown.
 *
 * The 10px extra at the bottom accounts for the footer newsletter card, which
 * is pulled up over the foot of the image by an amount that varies with the
 * breakpoint (nothing at 1440px, 20px at 1024px). Splitting the difference
 * keeps the card within 5px of the visible backdrop's centre at either end,
 * which is far tighter than chasing each breakpoint would be worth.
 */
@media (min-width: 768px) {
	.bs-tracking-lookup-page main#primary {
		padding: 130px 0 140px;
	}
}

/* main carries the clearance on this page, so the widget does not repeat it. */
.bs-tracking-lookup-page .bs-tracking-lookup {
	padding-bottom: 0;
}

/*
 * `.page-template #page h1` in informational.css forces 2.5rem, far too large
 * for a card this narrow — hence the body + #page prefix here.
 */
body.bs-tracking-lookup-page #page .bs-tracking-lookup__title {
	margin: 0 0 16px;
	font-size: 1.5rem;
	line-height: 1.2;
	text-align: center;
}

.bs-tracking-lookup__form {
	border: 1px solid var(--bs-tracking-lookup-border);
	border-radius: 8px;
	padding: 24px;
	background: #fff;
}

.bs-tracking-lookup__intro {
	margin: 0 0 20px;
}

.bs-tracking-lookup__row {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 0 16px;
}

.bs-tracking-lookup__row label {
	font-weight: 600;
}

.bs-tracking-lookup__row .input-text {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--bs-tracking-lookup-border);
	border-radius: 4px;
	line-height: 1.4;
}

.bs-tracking-lookup__row .input-text:focus {
	border-color: var(--bs-tracking-lookup-accent);
	outline: 1px solid var(--bs-tracking-lookup-accent);
}

.bs-tracking-lookup__hint {
	margin: 0 0 16px;
	color: #b32d2e;
	font-size: 0.9rem;
}

.bs-tracking-lookup__hint[hidden] {
	display: none;
}

/* Gradient, pill shape and hover come from the theme's .bs-main-button rules. */
.bs-tracking-lookup__actions {
	margin: 8px 0 0;
}

.bs-tracking-lookup__submit {
	width: 100%;
	justify-content: center;
}

/* Results and messages. */

.bs-tracking-lookup__result {
	border: 1px solid var(--bs-tracking-lookup-border);
	border-left-width: 4px;
	border-radius: 4px;
	padding: 16px 20px;
	margin: 0 0 24px;
	background: #f7f7f7;
}

.bs-tracking-lookup__result p {
	margin: 0;
}

.bs-tracking-lookup__result--found {
	border-left-color: var(--e-global-color-accent, #61ce70);
	background: #f3faf4;
}

.bs-tracking-lookup__result--info {
	border-left-color: #d0a03a;
	background: #fdf8ee;
}

.bs-tracking-lookup__result--error {
	border-left-color: #b32d2e;
	background: #fdf3f3;
}

/* Account-history link below a list of recent orders. */
.bs-tracking-lookup__result-note {
	margin-top: 14px !important;
	padding-top: 12px;
	border-top: 1px solid var(--bs-tracking-lookup-border);
	font-size: 0.85rem;
}

.bs-tracking-lookup__order + .bs-tracking-lookup__order {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid var(--bs-tracking-lookup-border);
}

.bs-tracking-lookup__order-title {
	margin: 0 0 8px;
	font-size: 1.1rem;
}

.bs-tracking-lookup__numbers {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bs-tracking-lookup__number-item {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
	padding: 6px 0;
}

.bs-tracking-lookup__label {
	font-weight: 600;
}

.bs-tracking-lookup__number {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: monospace;
	font-size: 1rem;
	word-break: break-all;
}

/*
 * Underlined by default and cleared on hover, matching how the theme treats
 * links in body copy. The rule sits on the inner span so the icon beside it
 * is not underlined too.
 */
.bs-tracking-lookup__number-text {
	text-decoration: underline;
}

.bs-tracking-lookup__number:hover .bs-tracking-lookup__number-text,
.bs-tracking-lookup__number:focus .bs-tracking-lookup__number-text {
	text-decoration: none;
}

.bs-tracking-lookup__external-icon {
	flex: 0 0 auto;
	/* Nudge the glyph up to sit with the digits rather than on the baseline. */
	transform: translateY(-1px);
}

/* The block is narrow at every width, so the date always stacks under the number. */
.bs-tracking-lookup__shipped {
	width: 100%;
	font-size: 0.85rem;
	opacity: 0.75;
}
