/* 0. Hard rule: the hidden attribute always wins.
   Component rules below set `display`, which would otherwise beat the UA
   stylesheet's `[hidden] { display: none }` and leave stepped sections and
   buttons visible when they must not be. */
.pm-site [hidden] { display: none !important; }

/* ==========================================================================
   PetMemory — interactive components
   Comparison slider, customisation wizard, upload zone, order progress.
   ========================================================================== */

/* 1. Before / after comparison ------------------------------------------- */
.pm-compare {
	position: relative;
	overflow: hidden;
	border-radius: var(--pm-radius-lg);
	aspect-ratio: 4 / 3;
	background: var(--pm-bg-alt);
	box-shadow: var(--pm-shadow-lg);
	--pm-compare-pos: 50%;
}
.pm-compare img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
/* Right-hand overlay is clipped by the slider position. */
.pm-compare__after {
	clip-path: inset(0 calc(100% - var(--pm-compare-pos)) 0 0);
}
.pm-compare__divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--pm-compare-pos);
	width: 3px;
	margin-left: -1.5px;
	background: rgba(255, 255, 255, .95);
	box-shadow: 0 0 0 1px rgba(43, 36, 31, .18);
	pointer-events: none;
}
.pm-compare__knob {
	position: absolute;
	top: 50%;
	left: var(--pm-compare-pos);
	transform: translate(-50%, -50%);
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 4px 14px rgba(43, 36, 31, .3);
	display: grid;
	place-items: center;
	color: var(--pm-ink);
	pointer-events: none;
}
/* The range input is the real control: full-bleed and invisible but focusable. */
.pm-compare__range {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: ew-resize;
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
}
.pm-compare__range:focus-visible + .pm-compare__knob,
.pm-compare__range:focus-visible ~ .pm-compare__knob {
	outline: 3px solid var(--pm-clay);
	outline-offset: 2px;
}
/* Labels use solid pills rather than a gradient scrim: a scrim's contrast
   depends on whatever photograph sits behind it, which cannot be verified. A
   solid background makes the ratio deterministic for any image. */
.pm-compare__labels {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	display: flex;
	justify-content: space-between;
	gap: 10px;
	padding: 14px 16px;
	pointer-events: none;
}
.pm-compare__labels span {
	display: inline-flex;
	align-items: center;
	min-height: 30px;
	padding: 5px 14px;
	border-radius: var(--pm-radius-pill);
	background: rgba(28, 23, 19, .92);
	color: #ffffff;
	font-size: .76rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

/* 2. Story cards ---------------------------------------------------------- */
.pm-story {
	background: var(--pm-surface);
	border: 1px solid var(--pm-line);
	border-radius: var(--pm-radius-lg);
	padding: clamp(20px, 2.6vw, 28px);
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.pm-story__quote { font-family: var(--pm-font-display); font-size: 1.08rem; line-height: 1.5; color: var(--pm-ink); margin: 0; flex: 1; }
.pm-story__meta { font-size: .86rem; color: var(--pm-ink-soft); }
.pm-story__meta strong { display: block; color: var(--pm-ink); font-size: .95rem; }
.pm-story__stars { color: var(--pm-clay); letter-spacing: 2px; font-size: .9rem; }

/* 3. Facts / timing list -------------------------------------------------- */
.pm-facts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--pm-line); }
.pm-facts li {
	display: flex; justify-content: space-between; gap: 18px;
	padding: 14px 0; border-bottom: 1px solid var(--pm-line);
	font-size: .95rem;
}
.pm-facts dt, .pm-facts__key { color: var(--pm-ink-soft); }
.pm-facts__val { font-weight: 600; text-align: right; }

/* 4. Customisation wizard ------------------------------------------------- */
.pm-wizard { display: grid; gap: clamp(20px, 3vw, 32px); }
@media (min-width: 1000px) { .pm-wizard { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; } }

.pm-wizard__main {
	background: var(--pm-surface);
	border: 1px solid var(--pm-line);
	border-radius: var(--pm-radius-lg);
	padding: clamp(20px, 3vw, 34px);
}
.pm-wizard__side { position: sticky; top: 90px; display: grid; gap: 16px; }

.pm-wizard__progress { height: 5px; background: var(--pm-bg-alt); border-radius: var(--pm-radius-pill); overflow: hidden; margin-bottom: 20px; }
.pm-wizard__progress span { display: block; height: 100%; width: 25%; background: var(--pm-clay); border-radius: inherit; transition: width .3s var(--pm-ease); }

.pm-wizard__dots { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; padding: 0; list-style: none; }
.pm-wizard__dots li { flex: 1 1 120px; }
.pm-wizard__dots button {
	width: 100%; min-height: 44px; padding: 8px 12px;
	background: var(--pm-surface); border: 1px solid var(--pm-line);
	border-radius: var(--pm-radius); cursor: pointer;
	font-size: .84rem; font-weight: 600; color: var(--pm-ink-soft);
	text-align: left; display: flex; align-items: center; gap: 8px;
}
.pm-wizard__dots button[aria-current="step"] { border-color: var(--pm-clay); color: var(--pm-ink); box-shadow: var(--pm-shadow-sm); }
.pm-wizard__dots button.is-done { border-color: var(--pm-sage); color: var(--pm-sage); }
.pm-wizard__dots .pm-dotnum {
	width: 22px; height: 22px; flex: none; border-radius: 50%;
	background: var(--pm-bg-alt); display: grid; place-items: center;
	font-size: .75rem; font-weight: 700; color: var(--pm-ink-soft);
}
.pm-wizard__dots button[aria-current="step"] .pm-dotnum { background: var(--pm-clay); color: #fff; }
.pm-wizard__dots button.is-done .pm-dotnum { background: var(--pm-sage); color: #fff; }

.pm-wizard__step h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.pm-wizard__step > p:first-of-type { color: var(--pm-ink-soft); }
.pm-wizard__nav { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--pm-line); }
.pm-wizard__nav .pm-spacer { flex: 1 1 auto; }

/* 5. Form fields ---------------------------------------------------------- */
.pm-field { display: grid; gap: 7px; margin-bottom: 18px; }
.pm-field > label, .pm-field__label { font-weight: 600; font-size: .93rem; color: var(--pm-ink); }
.pm-field__hint { font-size: .85rem; color: var(--pm-ink-soft); }
.pm-field input[type="text"],
.pm-field input[type="email"],
.pm-field input[type="tel"],
.pm-field input[type="date"],
.pm-field select,
.pm-field textarea {
	width: 100%; min-height: 48px; padding: 11px 14px;
	background: var(--pm-surface); color: var(--pm-ink);
	border: 1px solid var(--pm-line-strong); border-radius: var(--pm-radius-sm);
	font-family: var(--pm-font-body); font-size: 1rem;
}
.pm-field textarea { min-height: 110px; resize: vertical; }
.pm-field input:focus, .pm-field select:focus, .pm-field textarea:focus { border-color: var(--pm-clay); outline: 2px solid var(--pm-clay-soft); }
.pm-field input[aria-invalid="true"], .pm-field select[aria-invalid="true"], .pm-field textarea[aria-invalid="true"] { border-color: var(--pm-danger); }
.pm-field__error { color: var(--pm-danger); font-size: .85rem; font-weight: 600; }
.pm-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 620px) { .pm-field-row { grid-template-columns: minmax(0, 1fr); } }

.pm-choice { display: grid; gap: 10px; }
.pm-choice label {
	display: flex; gap: 12px; align-items: flex-start;
	padding: 14px 16px; min-height: 48px;
	border: 1px solid var(--pm-line-strong); border-radius: var(--pm-radius);
	background: var(--pm-surface); cursor: pointer;
	transition: border-color .16s var(--pm-ease), background-color .16s var(--pm-ease);
}
.pm-choice label:hover { border-color: var(--pm-ink-soft); }
.pm-choice input { margin-top: 4px; flex: none; }
.pm-choice input:checked + span strong { color: var(--pm-clay); }
.pm-choice label:has(input:checked) { border-color: var(--pm-clay); background: var(--pm-clay-soft); }
.pm-choice span strong { display: block; font-size: .97rem; }
.pm-choice span em { font-style: normal; color: var(--pm-ink-soft); font-size: .88rem; }

/* 6. Upload zone ---------------------------------------------------------- */
.pm-upload { border: 2px dashed var(--pm-line-strong); border-radius: var(--pm-radius-lg); padding: clamp(18px, 3vw, 28px); background: var(--pm-surface-alt); }
.pm-upload.is-dragover { border-color: var(--pm-clay); background: var(--pm-clay-soft); }
.pm-upload__inner { display: grid; gap: 10px; justify-items: center; text-align: center; }
.pm-upload__icon { color: var(--pm-clay); }
.pm-upload__title { font-weight: 600; }
.pm-upload__hint { font-size: .87rem; color: var(--pm-ink-soft); }
.pm-upload input[type="file"] { max-width: 100%; }
.pm-upload__status { font-size: .88rem; color: var(--pm-ink-soft); margin-top: 10px; }
.pm-upload__list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.pm-upload__item {
	display: grid; grid-template-columns: 56px minmax(0, 1fr) auto;
	gap: 12px; align-items: center;
	background: var(--pm-surface); border: 1px solid var(--pm-line);
	border-radius: var(--pm-radius); padding: 10px 12px;
}
.pm-upload__item.is-error { border-color: var(--pm-danger); background: var(--pm-danger-soft); }
.pm-upload__item img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--pm-radius-sm); display: block; }
.pm-upload__meta { min-width: 0; }
.pm-upload__name { display: block; font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-upload__size { font-size: .8rem; color: var(--pm-ink-soft); }
.pm-upload__remove {
	background: none; border: 0; color: var(--pm-danger); cursor: pointer;
	font-size: .85rem; font-weight: 600; min-height: 44px; padding: 0 10px;
}

/* 7. Live summary --------------------------------------------------------- */
.pm-summary { background: var(--pm-surface); border: 1px solid var(--pm-line); border-radius: var(--pm-radius-lg); padding: clamp(18px, 2.4vw, 24px); }
.pm-summary h2 { font-size: 1.1rem; margin-bottom: 14px; }
.pm-summary ul { list-style: none; margin: 0; padding: 0; }
.pm-summary li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--pm-line); font-size: .9rem; }
.pm-summary li:last-child { border-bottom: 0; }
.pm-summary__label { color: var(--pm-ink-soft); flex: none; }
.pm-summary__value { text-align: right; }

/* 8. Sticky mobile purchase bar ------------------------------------------ */
.pm-sticky {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
	background: rgba(255, 255, 255, .97);
	backdrop-filter: blur(8px);
	border-top: 1px solid var(--pm-line);
	padding: 10px var(--pm-gutter) calc(10px + env(safe-area-inset-bottom, 0px));
	display: none;
	gap: 12px; align-items: center;
	transform: translateY(105%);
	transition: transform .24s var(--pm-ease);
}
.pm-sticky.is-visible { transform: translateY(0); }
.pm-sticky__price { font-weight: 700; font-size: 1rem; }
.pm-sticky__price small { display: block; font-weight: 500; font-size: .78rem; color: var(--pm-ink-soft); }
.pm-sticky .pm-btn { flex: 1 1 auto; }
@media (max-width: 900px) { .pm-sticky { display: flex; } }

/* 9. Media / editorial ---------------------------------------------------- */
.pm-media-wide { width: 100%; border-radius: var(--pm-radius-lg); display: block; box-shadow: var(--pm-shadow); }
.pm-badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* 10. Reveal ------------------------------------------------------------- */
[data-pm-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--pm-ease), transform .5s var(--pm-ease); }
[data-pm-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	[data-pm-reveal] { opacity: 1; transform: none; transition: none; }
}

/* 11. Inline checkbox ------------------------------------------------ */
.pm-check {
	display: flex; gap: 11px; align-items: flex-start;
	min-height: 44px; cursor: pointer; font-weight: 500; font-size: .95rem;
}
.pm-check input { margin-top: 4px; flex: none; width: 18px; height: 18px; }

/* 12. Editorial page body -------------------------------------------- */
.pm-prose { max-width: 760px; }
.pm-prose h2 { margin-top: 1.6em; }
.pm-prose h3 { margin-top: 1.4em; }
.pm-prose ul, .pm-prose ol { padding-left: 1.25em; }
.pm-prose li { margin-bottom: .5em; }
.pm-prose figure { margin: 1.8em 0; }
.pm-prose figure img { border-radius: var(--pm-radius-lg); width: 100%; display: block; }
.pm-prose figcaption { font-size: .88rem; color: var(--pm-ink-soft); margin-top: 10px; }
.pm-prose-wide { max-width: none; }
.pm-lead { font-size: 1.12rem; color: var(--pm-ink-soft); max-width: 62ch; }

/* 13. Commission summary inside cart / checkout line items ------------ */
.pm-cart-summary {
	display: block; margin-top: 5px;
	font-size: .82rem; font-weight: 500; color: var(--pm-clay-dark);
}

/* 14. Receipt photo strip ------------------------------------------- */
.pm-receipt-photos {
	display: flex; flex-wrap: wrap; gap: 10px;
	list-style: none; margin: 0 0 12px; padding: 0;
}
.pm-receipt-photos img {
	width: 72px; height: 72px; object-fit: cover;
	border-radius: var(--pm-radius-sm); display: block;
	border: 1px solid var(--pm-line);
}

/* 15. Format groups on the homepage ---------------------------------- */
.pm-format-group { margin-top: clamp(34px, 5vw, 58px); }
.pm-format-group:first-of-type { margin-top: 0; }
.pm-format-group__head {
	max-width: 66ch;
	margin-bottom: clamp(18px, 2.4vw, 26px);
	padding-bottom: 14px;
	border-bottom: 1px solid var(--pm-line);
}
.pm-format-group__head h3 {
	font-family: var(--pm-font-display);
	font-size: clamp(1.3rem, 2.4vw, 1.75rem);
	margin: 0 0 .3em;
}
.pm-format-group__head p { color: var(--pm-ink-soft); margin: 0; font-size: .98rem; }
