/* The extra-copy decision is optional and lives inside the existing review card. */
body.woocommerce-checkout .sk-gift-calendar-host {
	position: relative;
}

body.woocommerce-checkout .sk-gift-calendar {
	position: absolute;
	z-index: 1000;
	top: calc(100% + 6px);
	left: 0;
	width: min(322px, 100%);
	box-sizing: border-box;
	padding: 14px;
	border: 1px solid #d8d3c7;
	border-radius: 12px;
	background: #fcf7ef;
	box-shadow: 0 12px 28px rgb(44 48 31 / 18%);
	color: #2c301f;
}

body.woocommerce-checkout .sk-gift-calendar--above {
	top: auto;
	bottom: calc(100% + 6px);
}

body.woocommerce-checkout .sk-gift-calendar__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
}

body.woocommerce-checkout .sk-gift-calendar__header strong {
	font-size: 15px;
	text-align: center;
}

body.woocommerce-checkout .sk-gift-calendar button {
	min-width: 0;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

body.woocommerce-checkout .sk-gift-calendar button:hover,
body.woocommerce-checkout .sk-gift-calendar button:focus-visible {
	background: #f2e3ca;
}

body.woocommerce-checkout .sk-gift-calendar button:focus-visible {
	outline: 2px solid #db8e1a;
}

body.woocommerce-checkout .sk-gift-calendar__header button {
	width: 34px;
	height: 34px;
	font-size: 26px;
	line-height: 1;
}

body.woocommerce-checkout .sk-gift-calendar__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
	text-align: center;
}

body.woocommerce-checkout .sk-gift-calendar__grid span,
body.woocommerce-checkout .sk-gift-calendar__grid button {
	display: grid;
	place-items: center;
	aspect-ratio: 1;
	font-size: 13px;
}

body.woocommerce-checkout .sk-gift-calendar__grid span {
	font-weight: 600;
}

body.woocommerce-checkout .sk-gift-calendar__grid button[aria-current="date"] {
	background: #db8e1a;
	color: #fff;
}

/* Keep the chosen plan button in place while its cart request is pending. */
body.woocommerce-checkout .sk-choose-access-card__button[data-sk-plan][aria-busy="true"] {
	position: relative;
	color: transparent !important;
	cursor: wait !important;
}

body.woocommerce-checkout .sk-choose-access-card__button[data-sk-plan][aria-busy="true"]::after {
	position: absolute;
	top: calc(50% - 9px);
	left: calc(50% - 9px);
	width: 18px;
	height: 18px;
	border: 2px solid #fff;
	border-right-color: transparent;
	border-radius: 50%;
	content: '';
	pointer-events: none;
	animation: sk-plan-button-loading 700ms linear infinite;
}

@keyframes sk-plan-button-loading {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	body.woocommerce-checkout .sk-choose-access-card__button[data-sk-plan][aria-busy="true"]::after {
		animation: none;
	}
}

body.sk-us-checkout .sk-inline-copies {
	position: relative;
	min-width: 0;
	margin-top: 17px;
	padding-top: 16px;
	border-top: 1px solid #d8d3c7;
}

body.sk-us-checkout .sk-inline-copies__toggle {
	display: grid;
	grid-template-columns: 32px minmax(0, 1fr) 14px;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 50px;
	padding: 5px 0;
	border: 0;
	background: transparent;
	color: #2c301f;
	font: inherit;
	font-weight: 600;
	line-height: 1.45;
	text-align: left;
	cursor: pointer;
}

body.sk-us-checkout .sk-inline-copies__toggle:focus-visible,
body.sk-us-checkout .sk-inline-copies__retry:focus-visible {
	outline: 2px solid #db8e1a;
	outline-offset: 4px;
}

body.sk-us-checkout .sk-inline-copies__icon {
	position: relative;
	width: 25px;
	height: 27px;
}

body.sk-us-checkout .sk-inline-copies__icon::before,
body.sk-us-checkout .sk-inline-copies__icon::after {
	position: absolute;
	width: 17px;
	height: 21px;
	border: 1.5px solid currentColor;
	border-radius: 4px;
	content: '';
}

body.sk-us-checkout .sk-inline-copies__icon::before {
	left: 2px;
	top: 3px;
	transform: rotate(-12deg);
}

body.sk-us-checkout .sk-inline-copies__icon::after {
	left: 7px;
	top: 1px;
	background: #fcf7ef;
	transform: rotate(8deg);
}

body.sk-us-checkout .sk-inline-copies__chevron {
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 150ms ease;
}

body.sk-us-checkout .sk-inline-copies__toggle[aria-expanded="true"] .sk-inline-copies__chevron {
	transform: translateY(2px) rotate(225deg);
}

body.sk-us-checkout .sk-inline-copies__panel {
	min-width: 0;
	padding: 12px 0 2px;
}

body.sk-us-checkout .sk-inline-copies__panel[hidden],
body.sk-us-checkout .sk-inline-copies__status[hidden],
body.sk-us-checkout .sk-inline-copies__retry[hidden] {
	display: none !important;
}

body.sk-us-checkout .sk-inline-copies__panel .sk-extra-copies__select-label {
	display: block;
	/* The old, full-page copies layout gives this label a large top margin. */
	margin: 0 0 9px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
}

body.sk-us-checkout .sk-inline-copies__select,
body.sk-us-checkout .sk-inline-copies__select .select2-container {
	box-sizing: border-box;
	min-width: 0;
	max-width: 100%;
	width: 100% !important;
}

body.sk-us-checkout .sk-inline-copies__select .select2-selection--single {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	min-height: 56px;
	height: auto;
	padding: 11px 14px;
	border: 1px solid #b5b8ad;
	border-radius: 9px;
	background: #fff;
}

body.sk-us-checkout .sk-inline-copies__select .select2-selection__rendered {
	min-width: 0;
	padding: 0 24px 0 38px;
	line-height: 1.45 !important;
	white-space: normal;
}

body.sk-us-checkout .sk-inline-copies__select .select2-selection__arrow {
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
}

body.sk-us-checkout .sk-inline-copies__select select {
	box-sizing: border-box;
	max-width: 100%;
	width: 100%;
}

body.sk-us-checkout .sk-inline-copies .select2-dropdown {
	max-width: 100%;
	z-index: 100;
}

/*
 * Select2 normally absolutely positions its popup and flips it above when the
 * viewport is short. In this review card, the choices should remain directly
 * below the field and expand the card instead of covering the book details.
 * The popup is appended as a direct child of .sk-inline-copies.
 */
body.sk-us-checkout .sk-inline-copies > .select2-container--open {
	position: static !important;
	display: block;
	box-sizing: border-box;
	width: 100% !important;
	margin-top: -1px;
}

body.sk-us-checkout .sk-inline-copies > .select2-container--open .select2-dropdown {
	position: static !important;
	left: auto !important;
	box-sizing: border-box;
	width: 100%;
	border: 1px solid #b5b8ad;
	border-top: 0;
	border-radius: 0 0 9px 9px;
}

body.sk-us-checkout .sk-inline-copies__select .select2-container--open .select2-selection--single {
	border-radius: 9px 9px 0 0;
}

body.sk-us-checkout .sk-inline-copies .sk-option-row {
	display: flex;
	flex-wrap: wrap;
	gap: 3px 9px;
	white-space: normal;
}

body.sk-us-checkout .sk-inline-copies__status {
	margin: 10px 0 0;
	font-size: 14px;
	line-height: 1.45;
}

body.sk-us-checkout .sk-inline-copies__status.is-error {
	color: #a33523;
}

body.sk-us-checkout .sk-inline-copies__retry {
	margin-top: 8px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #2c301f;
	font: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

body.sk-us-checkout .sk-us-review__continue:disabled {
	background: #b9b9b0 !important;
	color: #fff !important;
	cursor: wait;
}

body.sk-inline-payment-review .sk-inline-copies.sk-inline-copies--card {
	margin: 0;
	padding: 17px 22px;
	border: 1px solid #e2d6c6;
	border-radius: 12px;
	background: #fcf7ef;
}

/* Pulse the quantity field, keeping the surrounding offer card still. */
body.sk-inline-payment-review [data-sk-step="4"].is-active .sk-inline-copies--card:not(.is-engaged)
	.sk-inline-copies__select .select2-selection--single,
body.sk-inline-payment-review [data-sk-step="4"].is-active .sk-inline-copies--card:not(.is-engaged)
	.sk-inline-copies__select select:not(.select2-hidden-accessible) {
	animation: sk-inline-copies-gentle-pulse 2.8s ease-in-out 2;
}

@keyframes sk-inline-copies-gentle-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgb(219 142 26 / 0%); }
	50% { box-shadow: 0 0 0 5px rgb(219 142 26 / 12%); }
}

body.sk-inline-payment-review .sk-us-review__payment {
	margin: 0;
	padding: 22px;
	border: 1px solid #e2d6c6;
	border-radius: 12px;
	background: #fcf7ef;
}

body.sk-inline-payment-review .sk-us-review {
	padding-bottom: 0;
}

/* Payment is temporarily hidden while an extra-copy change refreshes the
 * cart. Keep the review card clear of the Trustpilot footer in that state. */
body.sk-inline-payment-review #sk-checkout-form.sk-inline-payment-syncing .sk-us-review {
	padding-bottom: 64px;
}

body.sk-inline-payment-review .sk-inline-payment-step .sk-step2 {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
	gap: 28px;
	max-width: 1100px;
	margin: 0 auto;
	padding: 16px 24px 80px;
}

body.sk-inline-payment-review .sk-inline-payment-step .sk-step2__aside,
body.sk-inline-payment-review .sk-inline-payment-step .sk-step-progress-label {
	display: none !important;
}

body.sk-inline-payment-review .sk-inline-payment-step .sk-step2__main {
	grid-column: 1;
	min-width: 0;
}

body.sk-inline-payment-review .sk-us-review__payment .sk-step2__heading {
	margin: 0 0 18px;
}

body.sk-inline-payment-review .sk-us-review__layout {
	row-gap: 16px;
}

body.sk-inline-payment-review .sk-us-review__details {
	display: grid;
}

body.sk-inline-payment-review .sk-us-review__order {
	grid-column: 2;
	align-self: start;
}

body.sk-inline-payment-review .sk-us-review__continue[hidden] {
	display: none !important;
}

body.sk-inline-payment-review .sk-inline-payment-syncing .sk-us-review__payment {
	pointer-events: none;
	user-select: none;
}

body.sk-inline-payment-review .sk-inline-payment-syncing #place_order {
	opacity: .6;
	cursor: wait;
}

@media (prefers-reduced-motion: reduce) {
	body.sk-inline-payment-review [data-sk-step="4"].is-active .sk-inline-copies--card:not(.is-engaged)
		.sk-inline-copies__select .select2-selection--single,
	body.sk-inline-payment-review [data-sk-step="4"].is-active .sk-inline-copies--card:not(.is-engaged)
		.sk-inline-copies__select select:not(.select2-hidden-accessible) {
		animation: none;
	}
}

@media (max-width: 781px) {
	body.sk-inline-payment-review #sk-checkout-form.sk-inline-payment-syncing .sk-us-review {
		padding-bottom: 48px;
	}
	body.sk-inline-payment-review .sk-us-review__layout {
		grid-template-columns: minmax(0, 1fr);
	}
	body.sk-inline-payment-review .sk-us-review__order {
		grid-column: 1;
	}
	body.sk-inline-payment-review .sk-inline-payment-step .sk-step2 {
		grid-template-columns: minmax(0, 1fr);
		padding: 16px 16px 56px;
	}
	body.sk-inline-payment-review .sk-inline-copies.sk-inline-copies--card,
	body.sk-inline-payment-review .sk-us-review__payment {
		padding: 17px 18px;
	}
	body.sk-us-checkout .sk-inline-copies__toggle {
		font-size: 15px;
	}
	body.sk-us-checkout .sk-inline-copies__select .select2-selection--single {
		min-height: 60px;
	}
}
