/* Puzzle Rental Core – front-end styles.
 * Colours follow the active theme's palette (theme.json presets) when present,
 * with fallbacks so every block still looks right in any other theme. */
:root {
	--prc-accent: var(--wp--preset--color--accent, #133c2e);
	--prc-accent-ink: var(--wp--preset--color--surface, #ffffff);
	--prc-highlight: var(--wp--preset--color--highlight, #ffb61e);
	--prc-ink: var(--wp--preset--color--contrast, #18201c);
	--prc-muted: var(--wp--preset--color--muted, #56635b);
	--prc-surface: var(--wp--preset--color--surface, #ffffff);
	--prc-tint: var(--wp--preset--color--tint, #e3eae3);
	--prc-line: var(--wp--preset--color--line, #cfd9d0);
	--prc-ok: var(--wp--preset--color--ok, #1f7a4d);
	--prc-warn: var(--wp--preset--color--warn, #b3261e);
	--prc-display: var(--wp--preset--font-family--display, inherit);
	--prc-r-lg: 24px;
	--prc-r-md: 16px;
	--prc-gap: clamp(14px, 2.2vw, 28px);
}

[data-prc-zip] [hidden], .prc-date-row[hidden] { display: none !important; }
.prc-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.prc-btn, .prc-wish, .prc-field input, .prc-field select, .prc-zip input { box-sizing: border-box; }

/* ---------- Buttons ---------- */
.prc-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .45em;
	min-height: 48px; padding: .7em 1.4em; border-radius: 999px; border: 0;
	background: var(--prc-accent); color: var(--prc-accent-ink); font: inherit; font-weight: 600;
	text-decoration: none; cursor: pointer; line-height: 1.1; transition: background .15s ease, color .15s ease;
}
.prc-btn:hover { background: var(--prc-ink); color: var(--prc-accent-ink); }
.prc-btn:focus-visible, .prc-wish:focus-visible, .prc-link:focus-visible, .prc-card a:focus-visible { outline: 3px solid var(--prc-highlight); outline-offset: 3px; }
.prc-btn--ghost { background: transparent; color: var(--prc-ink); box-shadow: inset 0 0 0 1.5px var(--prc-line); }
.prc-btn--ghost:hover { background: var(--prc-tint); color: var(--prc-ink); }
.prc-btn--block { width: 100%; }
.prc-link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }
.prc-link--danger { color: var(--prc-warn); }
.prc-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.prc-muted { color: var(--prc-muted); font-size: .94em; }
.prc-empty { padding: 2em; text-align: center; background: var(--prc-tint); border-radius: var(--prc-r-md); }

/* ---------- Status + chips ---------- */
.prc-status { display: inline-flex; align-items: center; gap: 6px; padding: .3em .8em; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.prc-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.prc-status--available { background: #dcf2e4; color: var(--prc-ok); }
.prc-status--out { background: var(--prc-ink); color: #fff; }
.prc-chip { display: inline-block; padding: .15em .65em; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--prc-tint); color: var(--prc-ink); }
.prc-chip--easy { background: #dcf2e4; }
.prc-chip--medium { background: #fff0c7; }
.prc-chip--hard { background: #e7defe; }
.prc-chip--expert { background: #ffd9d2; }

/* ---------- Filters ---------- */
.prc-filters {
	display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end;
	padding: 16px; margin-bottom: var(--prc-gap); background: var(--prc-surface); border-radius: var(--prc-r-lg);
	box-shadow: 0 1px 0 var(--prc-line);
}
.prc-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 140px; }
.prc-field label, .prc-methods legend { font-size: .82rem; font-weight: 600; color: var(--prc-muted); }
.prc-field input, .prc-field select, .prc-zip input {
	min-height: 48px; padding: .55em 1em; border: 1.5px solid var(--prc-line); border-radius: 999px;
	background: var(--prc-surface); color: var(--prc-ink); font: inherit; width: 100%;
}
.prc-field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2318201c' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1em center; background-size: 11px; padding-right: 2.4em; }
.prc-field input:focus, .prc-field select:focus, .prc-zip input:focus { outline: none; border-color: var(--prc-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--prc-accent) 18%, transparent); }
.prc-field--search { flex: 2 1 240px; }
.prc-check { display: flex; align-items: center; gap: 8px; min-height: 48px; font-weight: 600; padding: 0 6px; }
.prc-check input { width: 20px; height: 20px; accent-color: var(--prc-accent); }
.prc-filters__actions { display: flex; gap: 14px; align-items: center; }
.prc-count { color: var(--prc-muted); margin: 0 0 14px; font-size: .95rem; }

/* ---------- Puzzle cards ---------- */
.prc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 36px var(--prc-gap); }
.prc-grid--compact { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.prc-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.prc-card__media { position: relative; aspect-ratio: 4 / 3; border-radius: var(--prc-r-lg); overflow: hidden; background: var(--prc-tint); margin-bottom: 8px; }
.prc-card__media > a { display: block; height: 100%; }
.prc-card__media img, .prc-card__media svg { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.prc-card:hover .prc-card__media img { transform: scale(1.04); }
.prc-card.is-out .prc-card__media img { filter: saturate(.55); }
.prc-card__media .prc-status { position: absolute; left: 12px; bottom: 12px; }
.prc-card__title { margin: 0; font-family: var(--prc-display); font-size: 1.15rem; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
.prc-card__title a { color: inherit; text-decoration: none; }
.prc-card__title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.prc-card__meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; color: var(--prc-muted); }

/* Featured shelf scrolls sideways */
.prc-grid--featured { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 23%); grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 14px; scrollbar-width: thin; }
.prc-grid--featured > * { scroll-snap-align: start; }

/* ---------- Wishlist ---------- */
.prc-wish {
	display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 1.1em; border-radius: 999px;
	border: 0; box-shadow: inset 0 0 0 1.5px var(--prc-line); background: var(--prc-surface); color: var(--prc-ink); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
}
.prc-wish svg { fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
.prc-wish.is-on { color: #d6336c; box-shadow: inset 0 0 0 1.5px #f3b5cb; background: #fff0f5; }
.prc-wish.is-on svg { fill: currentColor; }
.prc-wish--icon { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; padding: 0; justify-content: center; box-shadow: none; background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); box-shadow: 0 4px 14px -4px rgba(0, 0, 0, .35); }
.prc-wish--icon.is-on { background: #fff; }

/* ---------- Pagination ---------- */
.prc-pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: calc(var(--prc-gap) * 1.5); }
.prc-pagination .page-numbers { min-width: 48px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 0 .9em; border-radius: 999px; background: var(--prc-surface); text-decoration: none; color: inherit; font-weight: 600; }
.prc-pagination .current { background: var(--prc-ink); color: #fff; }

/* ---------- Single puzzle ---------- */
.prc-details { display: grid; gap: 20px; margin-bottom: var(--prc-gap); }
.prc-details__head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.prc-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1.5px solid var(--prc-line); }
.prc-facts div { padding: 14px 0; border-bottom: 1.5px solid var(--prc-line); }
.prc-facts div:nth-child(odd) { padding-right: 16px; }
.prc-facts dt { font-size: .82rem; color: var(--prc-muted); }
.prc-facts dd { margin: 2px 0 0; font-weight: 600; font-size: 1.05rem; }
.prc-reserve { padding: clamp(20px, 3vw, 28px); border-radius: var(--prc-r-lg); background: var(--prc-surface); box-shadow: 0 20px 50px -30px rgba(19, 60, 46, .45); }
.prc-reserve__title { margin: 0 0 4px; font-family: var(--prc-display); font-size: 1.35rem; }
.prc-reserve__msg { margin-top: 0; }
.prc-reserve__form { display: grid; gap: 16px; }
.prc-methods { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.prc-methods legend { margin-bottom: 8px; }
.prc-pill { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--prc-line); cursor: pointer; font-weight: 600; }
.prc-pill input { accent-color: var(--prc-accent); }
.prc-pill:has(input:checked) { box-shadow: inset 0 0 0 2px var(--prc-accent); background: color-mix(in srgb, var(--prc-accent) 7%, transparent); }
.prc-allowance { margin: 0; font-size: .9rem; color: var(--prc-muted); }
.prc-placeholder { width: 100%; height: auto; display: block; }
.prc-placeholder-figure { margin: 0; border-radius: var(--prc-r-lg); overflow: hidden; }
.prc-description { max-width: 62ch; }

/* ---------- Plans ---------- */
.prc-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--prc-gap); align-items: stretch; color: var(--prc-ink); }
.prc-plan { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 30px 26px 26px; background: var(--prc-surface); border-radius: 28px; }
.prc-plan.is-featured { background: var(--prc-highlight); }
.prc-plan__tag { align-self: flex-start; background: var(--prc-ink); color: #fff; font-size: .78rem; font-weight: 600; padding: .35em .85em; border-radius: 999px; }
.prc-plan__name { margin: 0; font-family: var(--prc-display); font-size: 1.4rem; letter-spacing: -.01em; }
.prc-plan__price { font-family: var(--prc-display); font-size: clamp(2.4rem, 4vw, 3.2rem); font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.prc-plan__price .subscription-details, .prc-plan__price small { font-family: var(--wp--preset--font-family--body, inherit); font-size: 1rem; font-weight: 500; letter-spacing: 0; }
.prc-plan__features { list-style: none; margin: 4px 0 10px; padding: 18px 0 0; display: grid; gap: 10px; flex: 1; border-top: 1.5px solid color-mix(in srgb, var(--prc-ink) 14%, transparent); }
.prc-plan__features li { padding-left: 30px; position: relative; }
.prc-plan__features li::before { content: ""; position: absolute; left: 0; top: .2em; width: 20px; height: 20px; border-radius: 50%; background: var(--prc-ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-6.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.prc-plan .prc-btn--ghost { background: var(--prc-accent); color: #fff; box-shadow: none; }
.prc-plan .prc-btn--ghost:hover { background: var(--prc-ink); }
.prc-plan.is-featured .prc-btn { background: var(--prc-ink); color: #fff; }

/* ---------- ZIP checker ---------- */
.prc-zip { padding: clamp(18px, 3vw, 26px); background: var(--prc-surface); color: var(--prc-ink); border-radius: var(--prc-r-lg); margin-bottom: var(--prc-gap); }
.prc-zip__title { margin: 0 0 12px; font-family: var(--prc-display); font-size: 1.25rem; }
.prc-zip__form, .prc-zip__waitlist { display: flex; gap: 10px; flex-wrap: wrap; }
.prc-zip__form input { flex: 1 1 160px; max-width: 260px; letter-spacing: .08em; font-weight: 600; }
.prc-zip__waitlist { margin-top: 12px; }
.prc-zip__waitlist input { flex: 1 1 240px; }
.prc-zip__result { margin: 12px 0 0; font-weight: 600; min-height: 1.4em; }
.prc-zip__result.is-ok { color: var(--prc-ok); }
.prc-zip__result.is-no { color: var(--prc-warn); }

/* ---------- My account ---------- */
.prc-member-card { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--prc-gap); padding: clamp(20px, 3vw, 30px); background: var(--prc-accent); color: #fff; border-radius: 28px; margin-bottom: var(--prc-gap); }
.prc-member-card h3 { margin: 0 0 8px; font-family: var(--prc-display); font-size: 1.6rem; color: #fff; }
.prc-member-card p { margin: 0 0 8px; }
.prc-member-card .prc-muted { color: rgba(255, 255, 255, .72); }
.prc-member-card .prc-btn { background: var(--prc-highlight); color: var(--prc-ink); }
.prc-member-card .prc-btn--ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5); }
.prc-member-card .prc-status--available { background: rgba(255, 255, 255, .15); color: #b8f0cf; }
.prc-member-card .prc-status--out { background: var(--prc-highlight); color: var(--prc-ink); }
.prc-current { display: grid; gap: 14px; margin-bottom: var(--prc-gap); }
.prc-res { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 14px; border-radius: var(--prc-r-lg); background: var(--prc-surface); }
.prc-res__img img, .prc-res__img svg { width: 120px; height: 120px; object-fit: cover; border-radius: var(--prc-r-md); display: block; }
.prc-res h4 { margin: 4px 0 4px; font-family: var(--prc-display); font-size: 1.2rem; }
.prc-res h4 a { color: inherit; text-decoration: none; }
.prc-res p { margin: 0 0 10px; }
.prc-res__status { font-weight: 600; color: var(--prc-accent); }
.prc-pickup-box { padding: 12px 14px; background: var(--prc-tint); border-radius: var(--prc-r-md); margin-bottom: 10px; font-size: .95rem; }
.prc-return summary { list-style: none; display: inline-flex; }
.prc-return summary::-webkit-details-marker { display: none; }
.prc-return form { display: grid; gap: 14px; margin-top: 14px; max-width: 380px; }
.prc-history { width: 100%; }

/* ---------- Checkout ---------- */
.prc-checkout-fulfilment { margin-top: 1.5em; }
.prc-checkout-fulfilment select { width: 100%; min-height: 48px; }
.prc-terms-row { padding: 14px 16px; background: var(--prc-tint); border-radius: var(--prc-r-md); }

.prc-editor-note { padding: 14px; border: 1.5px dashed var(--prc-line); border-radius: var(--prc-r-md); color: var(--prc-muted); }

@media (max-width: 600px) {
	.prc-filters { padding: 12px; border-radius: 20px; }
	.prc-field { flex: 1 1 calc(50% - 6px); }
	.prc-field--search, .prc-filters__actions { flex-basis: 100%; }
	.prc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
	.prc-grid--featured { grid-template-columns: none; grid-auto-columns: 72%; }
	.prc-card__media { border-radius: 18px; }
	.prc-card__title { font-size: 1rem; }
	.prc-card__meta { font-size: .82rem; gap: 6px; }
	.prc-wish--icon { width: 38px; height: 38px; top: 8px; right: 8px; }
	.prc-res { grid-template-columns: 76px 1fr; gap: 14px; }
	.prc-res__img img, .prc-res__img svg { width: 76px; height: 76px; }
}
@media (prefers-reduced-motion: reduce) {
	.prc-card__media img { transition: none; }
	.prc-card:hover .prc-card__media img { transform: none; }
}
