/**
 * Wareoff Distribution Theme: portal pages drawn by the theme (0.4.0).
 *
 * Sign-in, registration and password pages (the form beside a photo panel),
 * the retailer's account pages (account menu beside the page) and the frame
 * around the plugin's other retailer pages. Loaded only on those pages
 * (surface "portal-theme"). The plugin's own portal.css still styles the
 * markup of pages the theme has not redesigned yet (orders, cart…).
 */

/* Page frame ---------------------------------------------------------------- */
.wot-portal {
	padding-block: var(--wot-space-6) var(--wot-space-9);
}

.wot-portal__header {
	margin-bottom: var(--wot-space-6);
}

.wot-portal__title {
	margin: 0;
	font-size: var(--wot-text-3xl);
	line-height: var(--wot-leading-heading);
}

.wot-portal__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wot-space-6);
}

/* Lets the row of account tabs scroll instead of widening the page. */
.wot-account-nav {
	min-width: 0;
}

.wot-portal__content {
	min-width: 0;
}

.wot-portal__content > .wot-notice,
.wot-portal__content > .wds-alert {
	margin-bottom: var(--wot-space-5);
}

@media (min-width: 1024px) {
	.wot-portal__body--menu {
		grid-template-columns: 15rem minmax(0, 1fr);
		gap: var(--wot-space-8);
		align-items: start;
	}
}

/* Account menu: a row of tabs that scrolls on phones, a list beside the page
   on wide screens. */
.wot-account-nav__list {
	display: flex;
	gap: var(--wot-space-2);
	margin: 0;
	padding: 0 0 var(--wot-space-1);
	overflow-x: auto;
	list-style: none;
	scrollbar-width: thin;
}

.wot-account-nav__link {
	display: flex;
	gap: var(--wot-space-2);
	align-items: center;
	min-height: var(--wot-touch);
	padding: var(--wot-space-2) var(--wot-space-4);
	border: 1px solid var(--wot-line);
	border-radius: var(--wot-radius-pill);
	background: var(--wot-surface);
	color: var(--wot-ink);
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

.wot-account-nav__link:hover {
	border-color: var(--wot-line-strong);
	color: var(--wot-color-primary);
}

.wot-account-nav__link.is-current {
	border-color: var(--wot-color-primary);
	background: var(--wot-green-50);
	color: var(--wot-color-primary);
	font-weight: 600;
}

.wot-account-nav__link .wot-icon {
	flex: none;
}

.wot-account-nav__link .wot-badge {
	margin-inline-start: auto;
}

@media (min-width: 1024px) {
	.wot-account-nav {
		position: sticky;
		top: calc(var(--wot-header-height) + var(--wot-space-4));
	}

	.wot-account-nav__list {
		flex-direction: column;
		gap: var(--wot-space-1);
		overflow: visible;
	}

	.wot-account-nav__link {
		border-color: transparent;
		border-radius: var(--wot-radius-control);
		background: transparent;
	}

	.wot-account-nav__link.is-current {
		border-color: transparent;
		box-shadow: inset 3px 0 0 var(--wot-color-primary);
	}
}

/* Sign-in layout -------------------------------------------------------------- */
.wot-portal--auth {
	padding-block: var(--wot-space-6) var(--wot-space-9);
	background:
		radial-gradient(60rem 30rem at 100% 0%, var(--wot-green-50), transparent 70%),
		var(--wot-canvas);
}

.wot-auth {
	display: grid;
	gap: var(--wot-space-6);
	justify-items: center;
}

.wot-auth__main {
	width: 100%;
	max-width: 30rem;
}

.wot-auth--wide .wot-auth__main {
	max-width: 46rem;
}

.wot-auth__card {
	padding: var(--wot-space-6) var(--wot-space-5);
	border: 1px solid var(--wot-line);
	border-radius: var(--wot-radius-card);
	background: var(--wot-surface);
	box-shadow: var(--wot-shadow-raised);
}

.wot-auth__title {
	margin: 0 0 var(--wot-space-5);
	font-size: var(--wot-text-2xl);
	line-height: var(--wot-leading-heading);
}

.wot-auth__card > .wot-notice {
	margin-bottom: var(--wot-space-5);
}

/* The photo panel shows on wide screens only: on a phone it would push the
   form below the fold. */
.wot-auth__panel {
	display: none;
}

@media (min-width: 640px) {
	.wot-auth__card {
		padding: var(--wot-space-7) var(--wot-space-7);
	}
}

@media (min-width: 1024px) {
	.wot-auth--panel {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: var(--wot-space-8);
		align-items: stretch;
		justify-items: stretch;
	}

	.wot-auth--panel.wot-auth--wide {
		grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	}

	.wot-auth--panel .wot-auth__main {
		max-width: none;
	}

	.wot-auth__panel {
		position: relative;
		display: flex;
		align-items: flex-end;
		min-height: 32rem;
		overflow: hidden;
		border-radius: var(--wot-radius-card);
		background: var(--wot-green-900);
		color: var(--wot-ink-inverse);
		isolation: isolate;
	}

	.wot-auth--wide .wot-auth__panel {
		position: sticky;
		top: calc(var(--wot-header-height) + var(--wot-space-4));
		align-self: start;
		min-height: 36rem;
	}
}

.wot-auth__photo {
	position: absolute;
	inset: 0;
	z-index: -2;
	margin: 0;
}

.wot-auth__photo .wot-photo__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wot-auth__photo .wot-photo__credit {
	top: var(--wot-space-3);
	right: var(--wot-space-3);
	bottom: auto;
}

/* Darkens the photo where the words sit, so they keep a 4.5:1 contrast. */
.wot-auth__panel:not(.wot-auth__panel--plain)::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgb(4 41 29 / 0.15) 0%, rgb(4 41 29 / 0.7) 45%, rgb(4 41 29 / 0.94) 100%);
}

.wot-auth__panel-body {
	padding: var(--wot-space-8) var(--wot-space-7);
}

.wot-auth__panel-title {
	margin: 0 0 var(--wot-space-3);
	color: var(--wot-ink-inverse);
	font-size: var(--wot-text-3xl);
	line-height: var(--wot-leading-heading);
}

.wot-auth__panel-text {
	max-width: 32rem;
	margin: 0;
	color: var(--wot-ink-inverse);
	font-size: var(--wot-text-lg);
}

.wot-auth__steps {
	display: grid;
	gap: var(--wot-space-4);
	margin: var(--wot-space-6) 0 0;
	padding: 0;
	list-style: none;
}

.wot-auth__step {
	display: flex;
	gap: var(--wot-space-3);
	align-items: flex-start;
}

.wot-auth__step-number {
	display: grid;
	flex: none;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--wot-color-accent);
	color: var(--wot-green-950);
	font-weight: 700;
}

.wot-auth__step-text {
	display: block;
	color: var(--wot-ink-inverse-muted);
}

/* Sign-in forms */
.wot-auth-form__lead {
	margin: 0 0 var(--wot-space-5);
	color: var(--wot-ink-muted);
}

.wot-auth-form__note {
	margin: var(--wot-space-4) 0 0;
	color: var(--wot-ink-muted);
	font-size: var(--wot-text-sm);
}

.wot-auth-form__link {
	font-size: var(--wot-text-sm);
}

.wot-auth-form__alt {
	margin-top: var(--wot-space-6);
	padding-top: var(--wot-space-5);
	border-top: 1px solid var(--wot-line);
	text-align: center;
}

.wot-auth-form__alt p {
	margin: 0 0 var(--wot-space-3);
	color: var(--wot-ink-muted);
	font-size: var(--wot-text-sm);
}

.wot-auth-form__back {
	margin: var(--wot-space-5) 0 0;
	text-align: center;
}

.wot-auth-form__back a,
.wot-back-link a {
	display: inline-flex;
	gap: var(--wot-space-1);
	align-items: center;
	min-height: var(--wot-touch);
}

/* Forms --------------------------------------------------------------------- */
.wot-form {
	display: grid;
	gap: var(--wot-space-4);
}

.wot-form .wot-field {
	margin: 0;
}

.wot-form__grid {
	display: grid;
	gap: var(--wot-space-4);
	align-items: start;
}

/* Two columns when each can be at least 13rem wide, else one (0.8.0: the
   columns follow the space and the text size, not the screen width, so
   enlarged text does not squeeze two fields side by side). */
@supports (width: min(1px, 2px)) {
	.wot-form__grid {
		grid-template-columns: repeat(auto-fill, minmax(min(100%, max(13rem, calc(50% - var(--wot-space-4) / 2))), 1fr));
	}
}

.wot-form__grid > * {
	min-width: 0;
}

.wot-form__row--between {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wot-space-2) var(--wot-space-4);
	align-items: center;
	justify-content: space-between;
}

.wot-form__row--between .wot-check {
	padding-top: 0;
	align-items: center;
}

.wot-form__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wot-space-3) var(--wot-space-5);
	align-items: center;
}

.wot-form__actions .wot-auth-form__note {
	margin: 0;
}

.wot-form--inline {
	margin-top: var(--wot-space-4);
}

@media (min-width: 640px) {
	.wot-form--inline {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: end;
	}

	/* Keeps the button level with the input when the field has no hint. */
	.wot-form--inline .wot-button {
		margin-bottom: 0;
	}
}

.wot-fieldset {
	display: grid;
	gap: var(--wot-space-4);
	min-width: 0;
	margin: 0;
	padding: 0 0 var(--wot-space-5);
	border: 0;
	border-bottom: 1px solid var(--wot-line);
}

.wot-fieldset__legend {
	display: flex;
	gap: var(--wot-space-3);
	align-items: center;
	margin-bottom: var(--wot-space-4);
	padding: 0;
	font-size: var(--wot-text-lg);
	font-weight: 600;
}

.wot-fieldset__number {
	display: grid;
	flex: none;
	place-items: center;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	background: var(--wot-green-50);
	color: var(--wot-color-primary);
	font-size: var(--wot-text-sm);
	font-weight: 700;
}

.wot-field--check.is-invalid .wot-check {
	color: var(--wot-danger);
}

.wot-honeypot {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.wot-disclosure {
	border: 1px solid var(--wot-line);
	border-radius: var(--wot-radius-control);
}

.wot-disclosure__summary {
	display: list-item;
	min-height: var(--wot-touch);
	padding: var(--wot-space-3) var(--wot-space-4);
	font-weight: 500;
	cursor: pointer;
}

.wot-disclosure[open] .wot-disclosure__summary {
	border-bottom: 1px solid var(--wot-line);
}

.wot-disclosure > .wot-form__grid {
	padding: var(--wot-space-4);
}

/* Account pages ----------------------------------------------------------- */
.wot-account {
	display: grid;
	gap: var(--wot-space-5);
}

.wot-panel {
	padding: var(--wot-space-5);
	border: 1px solid var(--wot-line);
	border-radius: var(--wot-radius-card);
	background: var(--wot-surface);
}

@media (min-width: 640px) {
	.wot-panel {
		padding: var(--wot-space-6);
	}
}

.wot-panel__title {
	margin: 0 0 var(--wot-space-4);
	font-size: var(--wot-text-xl);
}

.wot-panel__note,
.wot-panel__text {
	margin: var(--wot-space-3) 0 0;
	color: var(--wot-ink-muted);
	font-size: var(--wot-text-sm);
}

.wot-panel__text {
	display: flex;
	gap: var(--wot-space-2);
	align-items: flex-start;
	margin: 0 0 var(--wot-space-4);
	color: var(--wot-ink);
	font-size: var(--wot-text-base);
}

.wot-details {
	display: grid;
	margin: 0;
}

.wot-details__row {
	display: grid;
	gap: var(--wot-space-1);
	padding-block: var(--wot-space-3);
	border-bottom: 1px solid var(--wot-line);
}

.wot-details__row:first-child {
	padding-top: 0;
}

.wot-details dt {
	color: var(--wot-ink-muted);
	font-size: var(--wot-text-sm);
}

.wot-details dd {
	margin: 0;
	overflow-wrap: anywhere;
	font-weight: 500;
}

@media (min-width: 640px) {
	.wot-details__row {
		grid-template-columns: 12rem minmax(0, 1fr);
		gap: var(--wot-space-4);
	}
}

/* Account status */
.wot-account-status {
	display: flex;
	gap: var(--wot-space-4);
	align-items: flex-start;
	padding: var(--wot-space-5);
	border: 1px solid var(--wot-line);
	border-left: 4px solid var(--wot-info);
	border-radius: var(--wot-radius-card);
	background: var(--wot-surface);
}

.wot-account-status--success {
	border-left-color: var(--wot-success);
}

.wot-account-status--warning {
	border-left-color: var(--wot-warning);
	background: var(--wot-warning-soft);
}

.wot-account-status--danger {
	border-left-color: var(--wot-danger);
	background: var(--wot-danger-soft);
}

.wot-account-status__icon {
	display: grid;
	flex: none;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var(--wot-info-soft);
	color: var(--wot-info);
}

.wot-account-status--success .wot-account-status__icon {
	background: var(--wot-success-soft);
	color: var(--wot-success);
}

.wot-account-status--warning .wot-account-status__icon {
	background: var(--wot-surface);
	color: var(--wot-warning);
}

.wot-account-status--danger .wot-account-status__icon {
	background: var(--wot-surface);
	color: var(--wot-danger);
}

.wot-account-status__body {
	min-width: 0;
}

.wot-account-status__title {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wot-space-2) var(--wot-space-3);
	align-items: center;
	margin: 0;
	font-size: var(--wot-text-xl);
}

.wot-account-status__meta {
	margin: var(--wot-space-1) 0 0;
	color: var(--wot-ink-muted);
	font-size: var(--wot-text-sm);
}

.wot-account-status__text,
.wot-account-status__reason,
.wot-account-status__link {
	margin: var(--wot-space-3) 0 0;
}

/* Account links (extra sections the plugin lists) */
.wot-account-links {
	display: grid;
	gap: var(--wot-space-3);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 640px) {
	.wot-account-links {
		grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	}
}

.wot-account-link {
	position: relative;
	display: grid;
	gap: var(--wot-space-1);
	height: 100%;
	padding: var(--wot-space-4) var(--wot-space-7) var(--wot-space-4) var(--wot-space-5);
	border: 1px solid var(--wot-line);
	border-radius: var(--wot-radius-card);
	background: var(--wot-surface);
	color: var(--wot-ink);
	text-decoration: none;
	transition: border-color var(--wot-duration) var(--wot-ease), box-shadow var(--wot-duration) var(--wot-ease);
}

.wot-account-link:hover {
	border-color: var(--wot-color-primary);
	box-shadow: var(--wot-shadow-raised);
}

.wot-account-link__title {
	color: var(--wot-color-primary);
	font-weight: 600;
}

.wot-account-link__text {
	color: var(--wot-ink-muted);
	font-size: var(--wot-text-sm);
}

.wot-account-link__icon {
	position: absolute;
	top: 50%;
	right: var(--wot-space-4);
	color: var(--wot-ink-muted);
	transform: translateY(-50%);
}

/* Delivery addresses */
.wot-addresses {
	display: grid;
	gap: var(--wot-space-5);
	align-items: start;
}

@media (min-width: 1280px) {
	.wot-addresses {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}
}

.wot-address-list {
	display: grid;
	gap: var(--wot-space-3);
	margin: 0;
	padding: 0;
	list-style: none;
}

.wot-address {
	padding: var(--wot-space-5);
	border: 1px solid var(--wot-line);
	border-radius: var(--wot-radius-card);
	background: var(--wot-surface);
}

.wot-address--default {
	border-color: var(--wot-color-primary);
	box-shadow: inset 0 0 0 1px var(--wot-color-primary);
}

.wot-address__head {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wot-space-2) var(--wot-space-3);
	align-items: center;
	margin-bottom: var(--wot-space-2);
}

.wot-address__title {
	margin: 0;
	font-size: var(--wot-text-lg);
}

.wot-address__line {
	display: flex;
	gap: var(--wot-space-2);
	align-items: flex-start;
	margin: 0;
}

.wot-address__line .wot-icon {
	flex: none;
	margin-top: 0.2rem;
	color: var(--wot-ink-muted);
}

.wot-address__meta {
	margin: var(--wot-space-1) 0 0;
	padding-left: calc(1rem + var(--wot-space-2));
	color: var(--wot-ink-muted);
	font-size: var(--wot-text-sm);
}

.wot-address__actions {
	margin: var(--wot-space-3) 0 0;
	padding-left: calc(1rem + var(--wot-space-2));
}

.wot-address__actions a {
	display: inline-flex;
	align-items: center;
	min-height: var(--wot-touch);
	font-weight: 600;
}

.wot-address-archive {
	margin-top: var(--wot-space-5);
	padding-top: var(--wot-space-5);
	border-top: 1px solid var(--wot-line);
}

.wot-address-archive .wot-field__hint {
	margin-top: var(--wot-space-2);
}

.wot-back-link {
	margin: 0;
}

/* The plugin's pages inside the theme frame (orders, cart…): its cards
   already take the theme's colours through the --wds mapping; these keep
   its spacing in step with the theme's. */
.wot-portal__content .wds-main {
	padding: 0;
}

.wot-portal__content > .wds-stack,
.wot-portal__content > .wds-card {
	margin-top: 0;
}

/* On the tinted warning and danger panels, muted grey falls below 4.5:1. */
.wot-account-status--warning .wot-account-status__meta,
.wot-account-status--danger .wot-account-status__meta {
	color: var(--wot-ink);
}

/* Buttons keep their own width unless asked to fill the row; long forms
   stay at a readable width. */
.wot-form > .wot-button:not(.wot-button--block) {
	justify-self: start;
}

.wot-panel > .wot-form,
.wot-panel > .wot-details {
	max-width: 44rem;
}

/* The plugin's own fields get the theme's focus ring for keyboard users
   (0.8.0); its soft 3px outline stays for mouse focus. */
.wot-portal .wds-input:focus-visible {
	outline: 2px solid var(--wot-color-focus);
	outline-offset: 1px;
}

.wot-portal input.wds-input:is([type="date"], [type="month"], [type="time"]):is(:focus, :focus-within) {
	outline: 2px solid var(--wot-color-focus);
	outline-offset: 1px;
}
