/* wygge Shop plugin styles. Colours come from the tenant branding as CSS variables (--wygge-*, written
   by the plugin from effectiveBranding); the fallbacks are the wygge platform defaults. Mobile first. */

.wygge-shop,
.wygge-brand,
.wygge-nav,
.wygge-notice,
.wygge-error {
	--_primary: var(--wygge-color-primary, #032425);
	--_on-primary: var(--wygge-color-on-primary, #ffffff);
	--_accent: var(--wygge-color-accent, #c8ff16);
	--_accent-soft: var(--wygge-color-accent-soft, #f1ffd0);
	--_text: var(--wygge-color-text, #0b1f20);
	--_text-muted: var(--wygge-color-text-muted, #4a5a5b);
	--_card: var(--wygge-color-card, #ffffff);
	--_muted: var(--wygge-color-muted, #eef2f2);
	--_border: var(--wygge-color-border, #d5dddd);
	--_radius: var(--wygge-radius-card, 0.75rem);
	--_radius-button: var(--wygge-radius-button, 0.5rem);
	--_button-bg: var(--wygge-button-bg, var(--_primary));
	--_button-fg: var(--wygge-button-fg, var(--_on-primary));
}

.wygge-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---- loud failures (S13) and notices ---- */
.wygge-error {
	border: 2px solid #b3261e;
	border-radius: 6px;
	background: #fdecea;
	color: #5f1410;
	padding: 1rem 1.25rem;
	margin: 1rem 0;
}
.wygge-error__title { margin: 0 0 .25rem; }
.wygge-error__message { margin: 0 0 .25rem; }
.wygge-error__meta { margin: 0; font-size: .85em; opacity: .85; overflow-wrap: anywhere; }
.wygge-error__detail { white-space: pre-wrap; font-size: .8em; margin: .5rem 0 0; }
.wygge-inline-error {
	display: inline-block;
	margin-left: .5rem;
	padding: .15rem .5rem;
	border-radius: 999px;
	background: #fdecea;
	color: #5f1410;
	font-size: .75rem;
}

.wygge-notice {
	border: 1px solid var(--_border);
	border-left-width: 4px;
	border-radius: 6px;
	padding: .75rem 1rem;
	margin: 1rem 0;
	background: var(--_card);
	color: var(--_text);
}
.wygge-notice p { margin: 0; }
.wygge-notice p + p { margin-top: .5rem; }
.wygge-notice--success { border-left-color: #1a7f37; background: #eefbf1; color: #0f3d1d; }
.wygge-notice--warning { border-left-color: #b54708; background: #fff6e5; color: #5c2a02; }
.wygge-notice--info { border-left-color: var(--_primary); }

/* ---- account (S13) ---- */
.wygge-account { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 1rem 0; }
.wygge-account__logout { margin: 0; }

.wygge-branding dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; }
.wygge-branding dt { font-weight: 600; }
.wygge-branding dd { margin: 0; display: flex; align-items: center; gap: .5rem; }
.wygge-swatch { display: inline-block; width: 1.25rem; height: 1.25rem; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .2); }

/* ---- buttons, chips, badges ---- */
.wygge-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	min-height: 2.75rem;
	padding: .55rem 1.1rem;
	border: 1px solid currentColor;
	border-radius: var(--_radius-button, .5rem);
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
}
.wygge-button--primary {
	background: var(--_button-bg);
	border-color: var(--_button-bg);
	color: var(--_button-fg);
}
.wygge-button--secondary { color: var(--_primary); border-color: var(--_border); background: var(--_card); }
.wygge-button--link { border-color: transparent; color: var(--_text-muted); text-decoration: underline; padding-inline: .25rem; min-height: 2.25rem; }
.wygge-button[disabled], .wygge-button[aria-busy="true"] { opacity: .55; cursor: not-allowed; }
.wygge-button:focus-visible, .wygge-chip:focus-visible, .wygge-card__link:focus-visible, .wygge-nav__link:focus-visible {
	outline: 3px solid var(--_accent);
	outline-offset: 2px;
}

.wygge-chip {
	display: inline-block;
	padding: .35rem .8rem;
	border: 1px solid var(--_border);
	border-radius: 999px;
	background: var(--_card);
	color: var(--_text);
	font-size: .9rem;
	text-decoration: none;
	white-space: nowrap;
}
.wygge-chip--active { background: var(--_primary); border-color: var(--_primary); color: var(--_on-primary); }

.wygge-badge {
	display: inline-block;
	padding: .2rem .6rem;
	border-radius: 999px;
	font-size: .8rem;
	font-weight: 600;
	background: var(--_muted);
	color: var(--_text);
}
.wygge-badge--done { background: #e3f6e8; color: #0f5a26; }
.wygge-badge--current { background: #fff1d6; color: #7a3d00; }
.wygge-badge--failed { background: #fde2e0; color: #8c1d18; }
.wygge-badge--muted, .wygge-badge--open { background: var(--_muted); color: var(--_text-muted); }

/* ---- page frame ---- */
.wygge-shop { color: var(--_text); }
.wygge-shop h1.wygge-page-title, .wygge-page-title { margin: .25rem 0 1rem; font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.1rem); line-height: 1.2; }
.wygge-shop h2 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; }
.wygge-back { margin: 0 0 .5rem; }
.wygge-hint { color: var(--_text-muted); font-size: .9rem; }
.wygge-result-count { color: var(--_text-muted); margin: .5rem 0; font-size: .9rem; }
.wygge-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; margin: 1.5rem 0 0; }
.wygge-pager { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin: 1.5rem 0; }

/* ---- catalog ---- */
.wygge-search { display: flex; gap: .5rem; margin: 0 0 1rem; }
.wygge-search input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 2.75rem;
	padding: .5rem .75rem;
	border: 1px solid var(--_border);
	border-radius: var(--_radius-button, .5rem);
	font: inherit;
	background: var(--_card);
	color: var(--_text);
}
.wygge-categories ul, .wygge-facets ul {
	display: flex;
	gap: .5rem;
	list-style: none;
	margin: 0;
	padding: 0 0 .25rem;
	overflow-x: auto;
	scrollbar-width: thin;
}
.wygge-categories { margin: 0 0 .75rem; }
.wygge-facets { display: flex; flex-direction: column; gap: .5rem; margin: 0 0 .75rem; }
.wygge-facets__group { display: flex; flex-direction: column; gap: .35rem; }
.wygge-facets > .wygge-facets__name, .wygge-facets__group > .wygge-facets__name { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--_text-muted); }

.wygge-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.wygge-card { border: 1px solid var(--_border); border-radius: var(--_radius); background: var(--_card); overflow: hidden; }
.wygge-card__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.wygge-card__media { aspect-ratio: 1 / 1; background: var(--_muted); display: flex; align-items: center; justify-content: center; }
.wygge-card__image { width: 100%; height: 100%; object-fit: contain; display: block; }
.wygge-card__image--none, .wygge-product__image--none, .wygge-line__image--none {
	display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
	color: var(--_text-muted); font-size: .85rem;
}
.wygge-card__body { display: flex; flex-direction: column; gap: .25rem; padding: .75rem; }
.wygge-card__category { font-size: .75rem; color: var(--_text-muted); text-transform: uppercase; letter-spacing: .04em; }
.wygge-shop .wygge-card__title { font-size: 1rem; margin: 0; line-height: 1.3; }
.wygge-card__price { margin: .25rem 0 0; font-weight: 700; color: var(--_primary); }

/* ---- product ---- */
.wygge-product__layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.wygge-product__media { aspect-ratio: 1 / 1; background: var(--_muted); border-radius: var(--_radius); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.wygge-product__image { width: 100%; height: 100%; object-fit: contain; display: block; }
.wygge-product__price { font-size: 1.5rem; font-weight: 700; color: var(--_primary); margin: 0 0 .75rem; }
.wygge-facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.wygge-facts dt { font-weight: 600; color: var(--_text-muted); }
.wygge-facts dd { margin: 0; overflow-wrap: anywhere; }
.wygge-variants { border: 0; padding: 0; margin: 1rem 0; }
.wygge-variants legend { font-weight: 700; margin-bottom: .5rem; }
.wygge-variants ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.wygge-variants li { display: flex; align-items: flex-start; gap: .6rem; padding: .6rem .75rem; border: 1px solid var(--_border); border-radius: var(--_radius-button, .5rem); background: var(--_card); }
.wygge-variants input { margin-top: .3rem; accent-color: var(--_primary); }
.wygge-variants label { display: flex; flex-direction: column; gap: .15rem; cursor: pointer; }
.wygge-variant__meta { font-size: .85rem; color: var(--_text-muted); }
.wygge-variants input:disabled + label { opacity: .55; cursor: not-allowed; }
.wygge-stock { font-size: .9rem; color: var(--_text-muted); }
.wygge-quantity { display: flex; align-items: center; gap: .75rem; margin: 1rem 0; }
.wygge-moq { font-weight: 600; margin: 1rem 0 0; }
.wygge-line__moq { flex-basis: 100%; font-size: .85rem; font-weight: 600; margin: 0; }
.wygge-no-conditions .wygge-notice { max-width: 40rem; }
.wygge-shop input[type="number"] {
	width: 5.5rem;
	min-height: 2.75rem;
	padding: .4rem .6rem;
	border: 1px solid var(--_border);
	border-radius: var(--_radius-button, .5rem);
	font: inherit;
	background: var(--_card);
	color: var(--_text);
}

/* ---- cart, checkout, order lines ---- */
.wygge-lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--_border); }
.wygge-line {
	display: grid;
	grid-template-columns: 4rem 1fr auto;
	grid-template-areas: "media body total" "controls controls controls";
	gap: .5rem .75rem;
	align-items: start;
	padding: .9rem 0;
	border-bottom: 1px solid var(--_border);
}
.wygge-line__media { grid-area: media; width: 4rem; height: 4rem; background: var(--_muted); border-radius: .5rem; overflow: hidden; }
.wygge-line__image { width: 100%; height: 100%; object-fit: contain; display: block; }
.wygge-line__body { grid-area: body; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.wygge-line__name { font-weight: 600; color: var(--_text); overflow-wrap: anywhere; }
.wygge-line__variant, .wygge-line__price { font-size: .85rem; color: var(--_text-muted); }
.wygge-line__total { grid-area: total; font-weight: 700; white-space: nowrap; }
.wygge-line__controls { grid-area: controls; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.wygge-line__quantity { display: flex; gap: .5rem; align-items: center; }
.wygge-form { margin: 0; }
.wygge-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.15rem; margin: 1rem 0; }

.wygge-budget, .wygge-approval, .wygge-delivery {
	border: 1px solid var(--_border);
	border-radius: var(--_radius);
	background: var(--_card);
	padding: .25rem 1rem 1rem;
	margin: 1rem 0;
}
.wygge-shop .wygge-budget h2, .wygge-shop .wygge-approval h2, .wygge-shop .wygge-delivery h2, .wygge-budget h2 { margin-top: .75rem; }
.wygge-limits { margin: .5rem 0 0; padding-left: 1.25rem; font-size: .9rem; }
.wygge-submit-order { margin: 1.25rem 0; }
.wygge-submit-order .wygge-button { width: 100%; font-size: 1.05rem; }

/* ---- orders ---- */
.wygge-order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.wygge-order {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: .25rem .75rem;
	align-items: center;
	padding: .9rem 1rem;
	border: 1px solid var(--_border);
	border-radius: var(--_radius);
	background: var(--_card);
}
.wygge-order__number { font-weight: 700; grid-column: 1; }
.wygge-order__total { grid-column: 2; grid-row: 1; font-weight: 700; text-align: right; }
.wygge-order__date { grid-column: 1; color: var(--_text-muted); font-size: .9rem; }
.wygge-order .wygge-badge { grid-column: 2; justify-self: end; }
.wygge-order__payment { grid-column: 1 / -1; font-size: .85rem; color: var(--_text-muted); }
.wygge-order__meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; color: var(--_text-muted); }

.wygge-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.wygge-timeline__step { position: relative; padding: 0 0 1rem 1.75rem; display: flex; flex-direction: column; }
.wygge-timeline__step::before {
	content: "";
	position: absolute;
	left: .3rem;
	top: .3rem;
	width: .8rem;
	height: .8rem;
	border-radius: 50%;
	border: 2px solid var(--_border);
	background: var(--_card);
}
.wygge-timeline__step::after { content: ""; position: absolute; left: .65rem; top: 1.2rem; bottom: 0; width: 2px; background: var(--_border); }
.wygge-timeline__step:last-child::after { display: none; }
.wygge-timeline__step--done::before { background: #1a7f37; border-color: #1a7f37; }
.wygge-timeline__step--current::before { background: #f5a524; border-color: #b54708; }
.wygge-timeline__step--failed::before { background: #b3261e; border-color: #b3261e; }
.wygge-timeline__label { font-weight: 600; }
.wygge-timeline__detail { font-size: .85rem; color: var(--_text-muted); }

/* ---- storefront chrome (header/footer shortcodes; layout in the theme) ---- */
.wygge-brand { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; min-width: 0; }
.wygge-brand__link { display: inline-flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.15rem; min-width: 0; }
.wygge-brand__logo { height: var(--wygge-logo-height, 2.25rem); width: auto; max-width: 12rem; display: block; }
.wygge-brand__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wygge-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.wygge-nav__link { display: inline-flex; align-items: center; min-height: 2.5rem; padding: .35rem .7rem; border-radius: 999px; color: inherit; text-decoration: none; font-weight: 600; }
.wygge-nav__link[aria-current="page"] { background: var(--_accent); color: var(--wygge-color-on-accent, #032425); }
.wygge-legal { margin: 0; font-size: .85rem; }
.wygge-legal--missing { font-style: italic; opacity: .8; }

@media (min-width: 48rem) {
	.wygge-grid { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1.25rem; }
	.wygge-product__layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
	.wygge-line { grid-template-columns: 5rem 1fr auto auto; grid-template-areas: "media body controls total"; align-items: center; }
	.wygge-line__media { width: 5rem; height: 5rem; }
	.wygge-submit-order .wygge-button { width: auto; }
	.wygge-facets { flex-direction: row; flex-wrap: wrap; gap: 1rem; }
}

/* ---- order lifecycle, complaints, stock, delivery choice (S14c) ---- */
.wygge-shipments { list-style: none; margin: .25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; font-size: .9rem; }
.wygge-shipment__carrier { font-weight: 600; }
.wygge-tracking { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; overflow-wrap: anywhere; }
.wygge-shipment__link { color: var(--_primary); font-weight: 600; }
.wygge-shipment__date { display: block; color: var(--_text-muted); font-size: .85rem; }
.wygge-order-address address { font-style: normal; line-height: 1.5; padding: .75rem 1rem; border: 1px solid var(--_border); border-radius: var(--_radius); background: var(--_card); display: inline-block; }
.wygge-sums { margin: 1rem 0; display: flex; flex-direction: column; gap: .25rem; }
.wygge-sums > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.wygge-sums dt { color: var(--_text-muted); }
.wygge-sums dd { margin: 0; font-weight: 600; white-space: nowrap; }
.wygge-sums__payable { font-size: 1.15rem; border-top: 1px solid var(--_border); padding-top: .4rem; }
.wygge-sums__payable dt { color: var(--_text); font-weight: 700; }
.wygge-sums__payable dd { font-weight: 700; }
.wygge-receipt { margin: 1.25rem 0 .5rem; padding: .75rem 1rem; border: 1px solid var(--_border); border-left: 4px solid var(--_primary); border-radius: var(--_radius); background: var(--_card); }
.wygge-receipt p { margin: 0 0 .75rem; }
.wygge-order-actions { margin: 1rem 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.wygge-complaints { margin: 1.5rem 0; }
.wygge-complaint-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.wygge-complaint { border: 1px solid var(--_border); border-radius: var(--_radius); background: var(--_card); padding: .6rem .9rem; }
.wygge-complaint p { margin: 0; }
.wygge-complaint__head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-bottom: .35rem !important; }
.wygge-complaint__order { font-weight: 700; }
.wygge-complaint__date, .wygge-complaint__lines, .wygge-complaint__note { color: var(--_text-muted); font-size: .9rem; }
.wygge-complaint__text { white-space: pre-wrap; overflow-wrap: anywhere; }
.wygge-complaint-form { display: flex; flex-direction: column; gap: .6rem; max-width: 40rem; }
.wygge-complaint-form form, form.wygge-complaint-form { align-items: stretch; }
.wygge-field__label { font-weight: 600; }
.wygge-shop textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: 7rem;
	padding: .5rem .65rem;
	border: 1px solid var(--_border);
	border-radius: var(--_radius-button, .5rem);
	font: inherit;
	background: var(--_card);
	color: var(--_text);
	resize: vertical;
}
.wygge-complaint-form__lines { border: 1px solid var(--_border); border-radius: var(--_radius-button, .5rem); padding: .5rem .75rem; margin: 0; }
.wygge-complaint-form__lines legend { font-weight: 600; padding: 0 .25rem; }
.wygge-complaint-form__line { display: flex; gap: .5rem; align-items: flex-start; padding: .2rem 0; cursor: pointer; }
.wygge-missing { margin: .5rem 0 0; padding-left: 1.25rem; }
.wygge-table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; }
.wygge-table th, .wygge-table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--_border); vertical-align: top; }
.wygge-table thead th { color: var(--_text-muted); font-size: .85rem; text-transform: none; }
.wygge-table tbody th { font-weight: 400; overflow-wrap: anywhere; }
.wygge-stock .wygge-line__variant { overflow-wrap: anywhere; }
.wygge-table td[data-wygge-stock-cell] { font-weight: 700; font-variant-numeric: tabular-nums; }
.wygge-stock th .wygge-line__variant, .wygge-stock__free { display: block; }
.wygge-stock__free { font-size: .85rem; color: var(--_text-muted); }
.wygge-stock__date { color: var(--_text-muted); font-size: .85rem; white-space: nowrap; }
.wygge-delivery__options { border: 0; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.wygge-delivery__option { display: flex; align-items: flex-start; gap: .6rem; padding: .6rem .75rem; border: 1px solid var(--_border); border-radius: var(--_radius-button, .5rem); background: var(--_card); cursor: pointer; }
.wygge-delivery__option input { margin-top: .3rem; accent-color: var(--_primary); }
.wygge-delivery__option span { display: flex; flex-direction: column; gap: .15rem; }
.wygge-delivery__address { font-size: .85rem; color: var(--_text-muted); }

.wygge-documents { margin: 1.25rem 0; }
.wygge-document-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.wygge-document { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; padding: .6rem .9rem; border: 1px solid var(--_border); border-radius: var(--_radius); background: var(--_card); }
.wygge-document__title { font-weight: 700; }
.wygge-document__file, .wygge-document__date { color: var(--_text-muted); font-size: .9rem; overflow-wrap: anywhere; }
.wygge-document .wygge-button { margin-left: auto; }
