/*
 * Layout and light structure only. Fonts, colours, inputs and buttons come
 * from the active theme. Colours, panel and field backgrounds and corner
 * radius can be overridden under Adoptions > Settings > Look and feel, which
 * adds a few rules after this file. Everything is scoped to .adtr-wrap.
 */
/*
 * Widths follow the theme's layout (theme.json "contentSize" / "wideSize"),
 * so plugin output lines up with the theme's entry-content instead of going
 * full width. Falls back to sensible widths without theme.json.
 */
.adtr-wrap {
	--adtr-content: var(--wp--style--global--content-size, 48rem);
	--adtr-wide: var(--wp--style--global--wide-size, 75rem);
	box-sizing: border-box;
	max-width: var(--adtr-content);
	margin-inline: auto;
	--adtr-gap: 1rem;
	--adtr-radius: 6px;
	--adtr-line: color-mix(in srgb, currentColor 15%, transparent);
	--adtr-map-height: 360px;
}

.adtr-wrap h2,
.adtr-wrap h3 {
	margin-top: 0;
}

/* Panels: package summary, confirmation, tracker result */
.adtr-panel {
	padding: 1.25rem 1.5rem;
	border-left: 4px solid currentColor;
	border-radius: 0 var(--adtr-radius) var(--adtr-radius) 0;
	background: color-mix(in srgb, currentColor 4%, transparent);
}

.adtr-panel > :last-child {
	margin-bottom: 0;
}

.adtr-notice {
	padding: 0.75em 1em;
	border-left: 4px solid currentColor;
	border-radius: 0 var(--adtr-radius) var(--adtr-radius) 0;
}

/* Buttons keep the theme's style; we only round and size them. */
.adtr-wrap .adtr-button {
	display: inline-block;
	border-radius: var(--adtr-radius);
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.adtr-wrap .adtr-button--wide {
	width: 100%;
	padding-top: 0.9em;
	padding-bottom: 0.9em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* Form fields */
.adtr-wrap label {
	display: block;
	margin-bottom: 0.35em;
	font-weight: 600;
}

.adtr-wrap input[type="text"],
.adtr-wrap textarea {
	width: 100%;
	box-sizing: border-box;
	border-radius: var(--adtr-radius);
	font: inherit;
}

.adtr-wrap .required {
	color: #c0392b;
	text-decoration: none;
	border: 0;
}

/* Package grid ([adoption_packages]) */
.adtr-wrap.adtr-packages {
	max-width: var(--adtr-wide);
}

.adtr-packages {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
	gap: 2rem 1.5rem;
}

.adtr-package {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.adtr-package__image {
	display: block;
	overflow: hidden;
	border-radius: var(--adtr-radius);
	aspect-ratio: 1;
}

.adtr-package__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.adtr-package__image:hover img {
	transform: scale(1.03);
}

.adtr-package__title {
	margin: 0.25rem 0 0;
	font-size: clamp(1.3rem, 2vw, 1.6rem);
}

.adtr-package__title a {
	color: inherit;
	text-decoration: none;
}

.adtr-package__price {
	margin: 0;
	font-size: 1.25em;
	font-weight: 700;
}

.adtr-package__postage {
	font-size: 0.75em;
	font-weight: 400;
}

.adtr-package__action {
	margin-top: auto;
	padding-top: 0.5rem;
}

.adtr-packages .adtr-package__summary p {
	margin: 0 0 0.5em;
}

/* Package page form */
.adtr-package-form {
	display: grid;
	gap: 1.25rem;
	margin-bottom: 2.5rem;
}

.adtr-package-form > .adtr-package__price {
	font-size: 2em;
	line-height: 1.1;
}

.adtr-package__form {
	display: grid;
	gap: 1.1rem;
}

.adtr-package__form p {
	margin: 0;
}

/* Extras */
.adtr-extras {
	display: grid;
	gap: 0.6rem;
	margin: 0;
	padding: 1.25rem;
	border: 1px solid var(--adtr-line);
	border-radius: var(--adtr-radius);
}

.adtr-extras legend {
	float: left;
	width: 100%;
	margin-bottom: 0.4rem;
	padding: 0;
	font-size: 1.15em;
	font-weight: 700;
}

.adtr-wrap .adtr-extra {
	display: flex;
	gap: 0.75em;
	align-items: center;
	margin: 0;
	padding: 0.85rem 1rem;
	border: 1px solid var(--adtr-line);
	border-radius: var(--adtr-radius);
	background: #fff;
	color: #1f1d1d;
	cursor: pointer;
}

.adtr-extra input {
	width: 1.15em;
	height: 1.15em;
	margin: 0;
}

.adtr-extra__price {
	margin-left: auto;
	font-weight: 700;
}

/* Gift Aid */
.adtr-gift-aid label {
	display: flex;
	gap: 0.6em;
	align-items: center;
	margin: 0;
}

.adtr-gift-aid input {
	width: 1.15em;
	height: 1.15em;
}

.adtr-gift-aid small {
	display: block;
	margin-top: 0.4em;
	opacity: 0.75;
	line-height: 1.5;
}

/* Tracker */
.adtr-tracker {
	display: grid;
	gap: 1.5rem;
}

.adtr-lookup__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

.adtr-lookup__row input[type="text"] {
	flex: 1 1 14rem;
	width: auto;
	min-width: 0;
	text-transform: uppercase;
}

.adtr-result__name {
	margin-bottom: 0.25em;
}

.adtr-result__facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.5em var(--adtr-gap);
	margin: var(--adtr-gap) 0;
}

.adtr-result__facts dt {
	font-weight: 600;
}

.adtr-result__facts dd {
	margin: 0;
}

.adtr-map {
	height: var(--adtr-map-height);
	margin-top: var(--adtr-gap);
	border-radius: var(--adtr-radius);
	overflow: hidden;
}

/* Confirmation */
.adtr-confirmation__refs {
	padding-left: 1.2em;
}

.adtr-confirmation__ref {
	letter-spacing: 0.05em;
}

/* Shop archive: sits inside each theme card, so no width of its own. */
.adtr-wrap.adtr-archive-meta {
	max-width: none;
	margin-inline: 0;
}

.adtr-archive-meta .adtr-package__price {
	margin: 0.5em 0;
}
