/* ==========================================================================
   PurOstill V2 — common
   Reset, type scale, container, buttons, cards, forms, icons.
   Colours come from the variables printed by Hooks/colors.
   ========================================================================== */

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

/* overflow-x: hidden computes overflow-y to auto, which makes the body a
   scroll container and silently breaks position: sticky everywhere in the
   theme. clip does the same job without creating one; hidden is left first as
   the fallback for browsers that do not know clip. */
html, body {
	max-width: 100vw;
	overflow-x: hidden;
	overflow-x: clip;
}

/* The gutter is always reserved, so opening a drawer — which hides the body's
   overflow — cannot shift the centred layout sideways. */
html { scrollbar-gutter: stable; }

body {
	margin: 0;
	background: var(--v2-bg);
	color: var(--v2-ink);
	font-family: var(--v2-font);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--v2-accent); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
p { margin: 0; }

[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--v2-accent); outline-offset: 2px; border-radius: 6px; }

.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;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.v2-container {
	width: 100%;
	max-width: var(--v2-container);
	margin: 0 auto;
	padding: 0 1rem;
}
@media (min-width: 641px) { .v2-container { padding: 0 var(--v2-gutter); } }

.v2-main { display: flex; flex-direction: column; gap: 3rem; padding-bottom: 3rem; }

.v2-section { padding: 2rem 0; display: flex; flex-direction: column; gap: 1.5rem; }
.v2-section--flush { padding-top: 0; }

/* A centred section heading, used by most home and archive sections. */
.v2-section__title { text-align: center; font-size: 1.5rem; margin: 0; }
@media (min-width: 640px) { .v2-section__title { font-size: 1.875rem; } }

.v2-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 2.75rem); }
.v2-heading p { margin: .75rem 0 0; color: var(--v2-muted); line-height: 1.6; }

.v2-lede { color: var(--v2-muted); line-height: 1.7; max-width: 68ch; }

/* --------------------------------------------------------------------------
   Icons
   -------------------------------------------------------------------------- */

.v2-icon {
	font-family: "Material Symbols Outlined", "Material Icons", sans-serif;
	font-weight: normal; font-style: normal; line-height: 1;
	letter-spacing: normal; text-transform: none; white-space: nowrap;
	direction: ltr; -webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
	-webkit-font-smoothing: antialiased;
	font-size: 24px;
	font-variation-settings: "wght" 400, "FILL" 0, "opsz" 24;
}
.v2-icon--lg { font-size: 40px; font-variation-settings: "wght" 300, "FILL" 0, "opsz" 24; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.v2-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
	height: 48px; padding: 0 1.5rem;
	border: none; border-radius: .75rem;
	background: var(--v2-accent); color: #fff;
	font-family: inherit; font-size: 1rem; font-weight: 700; letter-spacing: .015em;
	cursor: pointer; text-align: center;
	transition: background .2s ease, transform .2s ease, color .2s ease, border-color .2s ease;
}
.v2-btn:hover { background: rgba(var(--v2-accent-rgb), .9); color: #fff; }
.v2-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Busy: the script swaps the label for a spinner, so the button only needs to
   hold its shape and refuse further clicks. */
.v2-btn.is-busy { cursor: wait; }

.v2-spinner {
	display: inline-block;
	width: 26px; height: 26px;
	border: 3px solid rgba(var(--v2-accent-rgb), .25);
	border-top-color: var(--v2-accent);
	border-radius: 50%;
	animation: v2-spin .6s linear infinite;
}

/* Inside a button the spinner takes the button's own colour, so it reads on a
   solid and a tinted button alike. */
.v2-spinner--btn {
	width: 1.15em; height: 1.15em;
	border-width: 2px;
	border-color: color-mix(in srgb, currentColor 30%, transparent);
	border-top-color: currentColor;
}

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

@media (prefers-reduced-motion: reduce) {
	.v2-btn.is-busy::after, .v2-spinner { animation-duration: 1.6s; }
}

.v2-btn--soft { background: rgba(var(--v2-accent-rgb), .15); color: var(--v2-accent); }
.v2-btn--soft:hover { background: var(--v2-accent); color: #fff; }

.v2-btn--ghost { background: transparent; color: var(--v2-ink); border: 1px solid rgba(var(--v2-accent-rgb), .35); }
.v2-btn--ghost:hover { background: rgba(var(--v2-accent-rgb), .08); color: var(--v2-ink); border-color: var(--v2-accent); }

.v2-btn--dark { background: var(--v2-dark-2); }
.v2-btn--dark:hover { background: var(--v2-dark); }

.v2-btn--sm { height: 40px; padding: 0 1rem; font-size: .875rem; border-radius: .7rem; }
.v2-btn--full { width: 100%; }

.v2-link { color: var(--v2-accent); font-weight: 600; }
.v2-link:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Cards and panels
   -------------------------------------------------------------------------- */

.v2-card {
	background: var(--v2-surface);
	border: 1px solid var(--v2-line);
	border-radius: 1.25rem;
	padding: 1.5rem;
}
.v2-card--lift { transition: transform .2s ease, box-shadow .2s ease; }
.v2-card--lift:hover { transform: translateY(-4px); box-shadow: 0 15px 35px rgba(var(--v2-ink-rgb), .12); }

.v2-panel {
	background: rgba(var(--v2-accent-rgb), .08);
	border-radius: var(--v2-radius-lg);
	padding: clamp(1.5rem, 4vw, 3rem);
}

.v2-notice { border-radius: .9rem; padding: .9rem 1.1rem; font-size: .95rem; border: 1px solid var(--v2-line); background: var(--v2-surface); }
.v2-notice--ok { border-color: rgba(var(--v2-ok-rgb), .35); background: rgba(var(--v2-ok-rgb), .08); color: var(--v2-ok); }
.v2-notice--error { border-color: rgba(var(--v2-sale-rgb), .35); background: rgba(var(--v2-sale-rgb), .08); color: var(--v2-sale); }

.v2-empty { text-align: center; padding: 3rem 1.5rem; }
.v2-empty__title { font-size: 1.25rem; font-weight: 700; margin-bottom: .5rem; }
.v2-empty p { color: var(--v2-muted); margin-bottom: 1.25rem; }

/* --------------------------------------------------------------------------
   Rating
   -------------------------------------------------------------------------- */

.v2-rating { display: flex; align-items: center; gap: .25rem; font-size: .9rem; color: var(--v2-muted); line-height: 1; }
.v2-rating__star { color: var(--v2-star); font-size: 1rem; }
.v2-rating__star.is-half { opacity: .6; }
.v2-rating__star.is-empty { color: color-mix(in srgb, var(--v2-muted) 35%, var(--v2-line)); }
.v2-rating__count { font-size: .8rem; color: var(--v2-muted); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.v2-field { display: flex; flex-direction: column; gap: .4rem; }
.v2-field__label { font-size: .85rem; font-weight: 600; color: var(--v2-ink); }

.v2-input,
.v2 input[type="text"], .v2 input[type="email"], .v2 input[type="tel"],
.v2 input[type="url"], .v2 input[type="password"], .v2 input[type="search"],
.v2 input[type="number"], .v2 select, .v2 textarea {
	width: 100%;
	min-height: 48px;
	padding: .7rem 1rem;
	border: 1px solid color-mix(in srgb, var(--v2-line) 70%, var(--v2-muted));
	border-radius: .9rem;
	background: var(--v2-surface);
	color: var(--v2-ink);
	font-family: inherit;
	font-size: 1rem;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.v2 textarea { min-height: 140px; resize: vertical; }
.v2-input:focus,
.v2 input:focus, .v2 select:focus, .v2 textarea:focus {
	outline: none;
	border-color: var(--v2-accent);
	box-shadow: 0 0 0 3px rgba(var(--v2-accent-rgb), .15);
}
.v2 ::placeholder { color: color-mix(in srgb, var(--v2-muted) 75%, transparent); }

.v2-field__error { color: var(--v2-sale); font-size: .85rem; }

.v2-check { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-size: .95rem; }
.v2-check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--v2-accent); }

/* Quantity stepper, shared by the product page, cart and drawer. */
.v2-qty { display: inline-flex; align-items: center; border: 1px solid var(--v2-line); border-radius: .75rem; background: var(--v2-surface); overflow: hidden; }
.v2-qty button {
	width: 40px; height: 44px; border: none; background: transparent; cursor: pointer;
	color: var(--v2-ink); font-size: 1.1rem; font-family: inherit; line-height: 1;
}
.v2-qty button:hover { color: var(--v2-accent); }
.v2-qty input {
	width: 48px; min-height: 44px; height: 44px; padding: 0; text-align: center;
	border: none; border-radius: 0; background: transparent; font-weight: 700;
	-moz-appearance: textfield;
}
.v2-qty input::-webkit-outer-spin-button, .v2-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.v2-qty input:focus { box-shadow: none; }

/* --------------------------------------------------------------------------
   Long-form content (policies, posts, product description)
   -------------------------------------------------------------------------- */

.v2-prose { color: var(--v2-ink); line-height: 1.75; }
.v2-prose > * + * { margin-top: 1.1rem; }
.v2-prose h2 { font-size: 1.6rem; margin-top: 2.4rem; }
.v2-prose h3 { font-size: 1.25rem; margin-top: 1.8rem; }
.v2-prose p { color: color-mix(in srgb, var(--v2-ink) 88%, var(--v2-muted)); }
.v2-prose a { color: var(--v2-accent); text-decoration: underline; text-underline-offset: 3px; }
.v2-prose img { border-radius: var(--v2-radius); }
.v2-prose blockquote {
	margin: 1.6rem 0; padding: 1.1rem 1.4rem;
	border-left: 3px solid var(--v2-accent);
	background: rgba(var(--v2-accent-rgb), .06);
	border-radius: 0 var(--v2-radius) var(--v2-radius) 0;
	font-style: italic;
}
.v2-prose table { width: 100%; border-collapse: collapse; }
.v2-prose th, .v2-prose td { padding: .7rem .9rem; border-bottom: 1px solid var(--v2-line); text-align: left; }

/* Lists get the card treatment so long policy pages stay readable. */
.v2-prose ul, .v2-prose ol {
	margin: 1.2rem 0; padding: 1.1rem 1.3rem 1.1rem 2.4rem;
	background: var(--v2-surface); border: 1px solid var(--v2-line);
	border-radius: var(--v2-radius); list-style: none; counter-reset: v2-li;
}
.v2-prose li { position: relative; padding-left: .2rem; }
.v2-prose li + li { margin-top: .6rem; }
.v2-prose ul > li::before {
	content: ""; position: absolute; left: -1.25rem; top: .62em;
	width: 7px; height: 7px; border-radius: 50%; background: var(--v2-accent);
}
.v2-prose ol > li { counter-increment: v2-li; }
.v2-prose ol > li::before {
	content: counter(v2-li); position: absolute; left: -1.7rem; top: .05em;
	width: 1.25rem; height: 1.25rem; border-radius: 50%;
	background: rgba(var(--v2-accent-rgb), .14); color: var(--v2-accent);
	font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.v2-prose li > ul, .v2-prose li > ol { background: transparent; border: none; padding: .6rem 0 0 1.3rem; margin: 0; }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.v2-pagination { display: flex; justify-content: center; padding: 1rem 0 .5rem; }

/* paginate_links() puts the page-numbers class on the <ul> as well as on each
   link, so styling it unscoped draws a box round the whole strip and lights it
   up on hover. Every rule below targets the items only. */
.v2-pagination ul.page-numbers,
.v2-pagination .nav-links {
	display: flex; flex-wrap: wrap; align-items: center;
	gap: .6rem;
	margin: 0; padding: 0;
	border: none; background: none;
}
.v2-pagination li { list-style: none; margin: 0; }

.v2-pagination li > .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 42px; height: 42px; padding: 0 .7rem;
	border: 1px solid var(--v2-line); border-radius: .7rem;
	background: var(--v2-surface); color: var(--v2-ink);
	font-size: .9rem; font-weight: 600;
	transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.v2-pagination li > a.page-numbers:hover { border-color: var(--v2-accent); color: var(--v2-accent); }
.v2-pagination li > .page-numbers.current { background: var(--v2-accent); border-color: var(--v2-accent); color: #fff; }
.v2-pagination li > .page-numbers.dots { border: none; background: transparent; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.v2-stack { display: flex; flex-direction: column; gap: 1rem; }
.v2-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.v2-muted { color: var(--v2-muted); }
.v2-grid { display: grid; gap: 1.5rem; }
.v2-grid--4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (min-width: 1024px) { .v2-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* --------------------------------------------------------------------------
   Product card — shared by home, shop, archives, search and related rows
   -------------------------------------------------------------------------- */

.v2-product-card {
	display: flex; flex-direction: column;
	border: 1px solid var(--v2-line);
	border-radius: 1.25rem;
	background: var(--v2-surface);
	overflow: hidden;
	transition: transform .2s ease, box-shadow .2s ease;
}
.v2-product-card:hover { transform: translateY(-4px); box-shadow: 0 15px 35px rgba(var(--v2-ink-rgb), .12); }

.v2-product-card__link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.v2-product-card__link:hover { color: inherit; }

.v2-product-card__media {
	position: relative;
	display: flex; align-items: center; justify-content: center;
	padding: 1.25rem;
	background: var(--v2-tint);
}
.v2-product-card__media img {
	width: 100%; max-height: 220px; object-fit: contain;
	padding: .5rem; border-radius: .75rem; background: var(--v2-surface);
}

.v2-product-card__flash {
	position: absolute; top: .9rem; left: .9rem; z-index: 1;
	padding: .2rem .7rem; border-radius: 999px;
	background: var(--v2-sale); color: #fff;
	font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
}

.v2-product-card__body { display: flex; flex-direction: column; gap: .75rem; padding: 1.25rem; }
.v2-product-card__body h3 { margin: 0; font-size: 1.125rem; line-height: 1.3; }
.v2-product-card__link:hover h3 { color: var(--v2-accent); }

.v2-product-card__price { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--v2-ink); }
.v2-product-card__price del { color: var(--v2-muted); font-weight: 500; font-size: .95rem; margin-right: .4rem; }
.v2-product-card__price ins { text-decoration: none; }

.v2-product-card__actions { display: flex; flex-wrap: wrap; gap: .75rem; padding: 0 1.25rem 1.25rem; }
.v2-product-card__actions > * { flex: 1 1 140px; }

/* --------------------------------------------------------------------------
   Page head — breadcrumb + page name
   -------------------------------------------------------------------------- */

.v2-head { padding: clamp(1.6rem, 3vw, 2.4rem) 0 clamp(1rem, 2vw, 1.4rem); }

.v2-crumbs {
	display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
	margin-bottom: .7rem;
	font-size: .78rem; font-weight: 600;
	letter-spacing: .06em; text-transform: uppercase;
}
.v2-crumbs__sep { color: color-mix(in srgb, var(--v2-muted) 55%, transparent); }
.v2-crumbs__link { color: var(--v2-muted); }
.v2-crumbs__link:hover { color: var(--v2-accent); }
.v2-crumbs__current { color: var(--v2-accent); max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.v2-head__title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -.03em; }
.v2-head__lede { margin-top: .8rem; }

@media (max-width: 640px) { .v2-crumbs__current { max-width: 20ch; } }

/* --------------------------------------------------------------------------
   Product card: already in the bag
   -------------------------------------------------------------------------- */

.v2-icon--sm { font-size: 18px; }
.v2-product-card__in-cart { gap: .35rem; }
.v2-product-card__in-cart .v2-icon { color: var(--v2-ok); }

/* --------------------------------------------------------------------------
   Mobile
   The layout is fluid throughout; these rules cover the things fluidity alone
   does not fix — tap targets, runaway tables, and iOS quirks.
   -------------------------------------------------------------------------- */

/* Wide content must scroll inside itself, never push the page sideways. */
.v2-prose table,
.v2-prose pre { display: block; max-width: 100%; overflow-x: auto; }

/* Anything long and unbroken — an order number, a URL — wraps instead of
   stretching its container. */
.v2-prose a, .v2-cart__name, .v2-product-card__body h3, .v2-search__row h2 { overflow-wrap: anywhere; }

@media (max-width: 782px) {
	/* The admin bar is fixed rather than sticky on small screens, so the fixed
	   header has to clear it. */
	body.admin-bar .v2-header { top: 46px; }
}

@media (max-width: 640px) {
	body { font-size: 15px; }

	.v2-section { padding: 1.5rem 0; gap: 1.25rem; }
	.v2-main { gap: 2rem; }
	.v2-card { padding: 1.25rem; border-radius: 1rem; }
	.v2-panel { border-radius: 1.25rem; }

	/* Comfortable thumbs: 44px minimum on anything tappable. */
	.v2-btn { height: 46px; }
	.v2-btn--sm { height: 42px; }

	.v2-empty { padding: 2rem 1rem; }

	/* A single column of cards reads better than two cramped ones. */
	.v2-grid { gap: 1rem; }
	.v2-grid--4 { grid-template-columns: minmax(0, 1fr); }

	.v2-product-card__media { padding: 1rem; }
	.v2-product-card__media img { max-height: 200px; }
	.v2-product-card__body { padding: 1rem; gap: .5rem; }
	.v2-product-card__actions { padding: 0 1rem 1rem; }

	.v2-prose ul, .v2-prose ol { padding: 1rem 1rem 1rem 2rem; }
}

/* iOS zooms the page whenever a focused field is under 16px. */
@supports (-webkit-touch-callout: none) {
	.v2 input, .v2 select, .v2 textarea { font-size: 16px; }
}

/* Where a pointer cannot hover, the lift effects only cause repaints. */
@media (hover: none) {
	.v2-card--lift:hover,
	.v2-product-card:hover { transform: none; box-shadow: none; }
}

/* WooCommerce prints its notices wrapper whether or not there are notices. As
   an empty flex or grid item it still takes a slot and a gap, which pushes the
   content below it out of alignment with its neighbouring column. */
.woocommerce-notices-wrapper:empty { display: none; }
