/**
 * 17TRACK Tracking for WooCommerce – front-end styles.
 *
 * The embed is cropped with a negative top offset so only the 17TRACK result
 * area stays visible (the marketing header is scrolled out of the clip box).
 */

.w17t {
	--w17t-radius: 12px;
	--w17t-border: #e3e7ee;
	--w17t-bg: #ffffff;
	--w17t-muted: #6b7280;
	--w17t-accent: #1868db;
	--w17t-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 8px rgba(16, 24, 40, 0.06);
	position: relative;
	margin: 1.5em 0;
	max-width: 100%;
	font-size: 14px;
	line-height: 1.5;
	color: inherit;
	text-align: left;
}

.w17t *,
.w17t *::before,
.w17t *::after {
	box-sizing: border-box;
}

.w17t [hidden] {
	display: none !important;
}

/* Themes are not required to ship .screen-reader-text. */
.w17t .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------------------
 * Clip box + iframe
 * ------------------------------------------------------------------------- */

.w17t .w17t__crop {
	position: relative;
	overflow: hidden;
	height: var(--w17t-h, 760px);
	border: 1px solid var(--w17t-border);
	border-radius: var(--w17t-radius);
	background: var(--w17t-bg);
	box-shadow: var(--w17t-shadow);
	isolation: isolate;
}

.w17t .w17t__frame {
	display: block;
	float: none;
	width: 100%;
	max-width: none;
	border: 0;
	background: var(--w17t-bg);
	/* crop (top) + visible height + extra (pushes 17TRACK's fixed bottom bar
	 * below the visible band). */
	height: calc(var(--w17t-h, 760px) + var(--w17t-crop, 186px) + var(--w17t-extra, 0px));
	margin-top: calc(-1 * var(--w17t-crop, 186px));
}

/* Scaled mode: the iframe is rendered at a fixed virtual width and scaled down
 * by JS. Inline styles set width / height / transform. */
.w17t--scaled .w17t__frame {
	position: absolute;
	left: 0;
	top: 0;
	margin-top: 0;
}


/* ---------------------------------------------------------------------------
 * Loading state
 * ------------------------------------------------------------------------- */

.w17t .w17t__load {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: var(--w17t-bg);
	color: var(--w17t-muted);
	font-size: 13px;
	text-align: center;
	padding: 20px;
}

.w17t--js .w17t__load {
	display: flex;
}

.w17t--js.w17t--loaded .w17t__load {
	display: none;
}

.w17t .w17t__spin {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid #d5dae3;
	border-top-color: var(--w17t-accent);
	animation: w17t-spin 0.8s linear infinite;
}

.w17t .w17t__slowlink {
	display: none;
	color: var(--w17t-accent);
	text-decoration: underline;
}

.w17t--slow .w17t__slowlink {
	display: inline-block;
}

@keyframes w17t-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.w17t .w17t__spin {
		animation: none;
	}
}

/* ---------------------------------------------------------------------------
 * Footer line
 * ------------------------------------------------------------------------- */

.w17t .w17t__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 2px 0;
	color: var(--w17t-muted);
	font-size: 12.5px;
}

.w17t .w17t__foot[hidden] {
	display: none;
}

.w17t .w17t__nums {
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	word-break: break-all;
}

.w17t .w17t__open {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--w17t-accent);
	text-decoration: none;
	font-weight: 500;
	white-space: nowrap;
}

.w17t .w17t__open:hover,
.w17t .w17t__open:focus-visible {
	text-decoration: underline;
}

.w17t .w17t__open svg {
	display: block;
	width: 12px;
	height: 12px;
}

/* ---------------------------------------------------------------------------
 * Search form
 * ------------------------------------------------------------------------- */

.w17t .w17t__form {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 10px;
	margin: 0;
}

.w17t .w17t__input {
	flex: 1 1 240px;
	min-width: 0;
	height: 46px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid #d0d5dd;
	border-radius: 10px;
	background: #ffffff;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.w17t .w17t__input:focus {
	outline: 2px solid var(--w17t-accent);
	outline-offset: 1px;
	border-color: var(--w17t-accent);
}

.w17t .w17t__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 46px;
	min-height: 46px;
	margin: 0;
	padding: 0 22px;
	border: 0;
	border-radius: 10px;
	background: var(--w17t-accent);
	color: #ffffff;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.15s ease;
}

.w17t .w17t__btn:hover {
	filter: brightness(1.06);
	color: #ffffff;
}

.w17t .w17t__btn:active {
	transform: translateY(1px);
}

.w17t .w17t__btn:focus-visible {
	outline: 2px solid var(--w17t-accent);
	outline-offset: 2px;
}

.w17t--button .w17t__btn {
	height: auto;
	min-height: 0;
	padding: 11px 20px;
}

.w17t .w17t__error {
	margin: 8px 0 0;
	color: #b42318;
	font-size: 13px;
}

.w17t .w17t__error[hidden] {
	display: none;
}

/* Form mode: the result box appears after a search. */
.w17t .w17t__box[hidden] {
	display: none;
}

.w17t--form.w17t--open .w17t__form {
	margin-bottom: 14px;
}

.w17t--form.w17t--open .w17t__box {
	display: block;
}

/* ---------------------------------------------------------------------------
 * Automatic block on the WooCommerce order page
 * ------------------------------------------------------------------------- */

.w17t-auto {
	margin: 2em 0 0;
}

.w17t-auto__title {
	margin-bottom: 0.6em;
}

.w17t-auto__link {
	margin: 0;
}

/* ---------------------------------------------------------------------------
 * Compact mobile card (default mobile mode)
 *
 * The 17TRACK page is heavy and its mobile layout is cramped inside a narrow
 * iframe, so phones get a light card first: number + two buttons. The iframe is
 * only revealed when the visitor taps "Show tracking here".
 * ------------------------------------------------------------------------- */

.w17t .w17t__card {
	display: none;
}

.w17t .w17t__btn--ghost {
	background: transparent;
	color: var(--w17t-accent);
	border: 1px solid var(--w17t-border);
	box-shadow: none;
}

.w17t .w17t__btn--ghost:hover {
	background: rgba(24, 104, 219, 0.06);
	filter: none;
	color: var(--w17t-accent);
}

.w17t .w17t__btn--track {
	background: var(--w17t-accent);
}

/* ---------------------------------------------------------------------------
 * Mobile: JS normally overrides these with the mobile settings.
 * ------------------------------------------------------------------------- */

@media (max-width: 767px) {
	.w17t .w17t__crop {
		height: var(--w17t-h-sm, 640px);
	}

	.w17t .w17t__frame {
		height: calc(var(--w17t-h-sm, 640px) + var(--w17t-crop-sm, 0px) + var(--w17t-extra, 0px));
		margin-top: calc(-1 * var(--w17t-crop-sm, 0px));
	}

	.w17t .w17t__form {
		gap: 8px;
	}

	.w17t .w17t__btn {
		flex: 1 1 auto;
	}

	.w17t .w17t__foot {
		font-size: 12px;
	}

	/* Compact mode */
	.w17t--card .w17t__card {
		display: flex;
		flex-direction: column;
		gap: 14px;
		padding: 16px;
		border: 1px solid var(--w17t-border);
		border-radius: var(--w17t-radius);
		background: var(--w17t-bg);
		box-shadow: var(--w17t-shadow);
	}

	.w17t--card .w17t__card-text {
		display: flex;
		flex-direction: column;
		gap: 2px;
		min-width: 0;
	}

	.w17t--card .w17t__card-label {
		font-size: 11px;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: var(--w17t-muted);
	}

	.w17t--card .w17t__card-text .w17t__nums {
		font-size: 16px;
		font-weight: 600;
		color: inherit;
	}

	.w17t--card .w17t__card-actions {
		display: flex;
		flex-direction: column;
		gap: 8px;
	}

	.w17t--card .w17t__card-actions .w17t__btn {
		width: 100%;
	}

	/* The card already shows the number and the external link. */
	.w17t--card .w17t__foot {
		display: none;
	}

	.w17t--card .w17t__crop {
		display: none;
	}

	.w17t--card.w17t--open .w17t__crop {
		display: block;
	}

	.w17t--card.w17t--open .w17t__card {
		display: none;
	}
}
