/**
 * Pre Order WooCommerce Plugin — front-end styles.
 * Colour variables are printed inline by the plugin from your settings.
 */

.apo-notice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 14px 0;
	padding: 14px 16px;
	background: var(--apo-bg, #fdf5f8);
	border: 1px solid var(--apo-border, #e3c3d2);
	border-left: 4px solid var(--apo-accent, #431b36);
	border-radius: 4px;
	color: var(--apo-text, #43202f);
	text-align: left;
	font-size: 14px;
	line-height: 1.65;
}

.apo-notice__icon {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	margin-top: 2px;
	border-radius: 50%;
	background: var(--apo-accent, #431b36);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}

.apo-notice__text {
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

.apo-notice__label {
	font-weight: 700;
	color: var(--apo-accent, #431b36);
}

.apo-notice__text strong {
	font-weight: 700;
}

/* Inside the cart / checkout totals table. */
tr.apo-notice-row > td {
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
}

tr.apo-notice-row .apo-notice {
	margin: 12px 0 4px;
}

/* Sitting on its own between the order summary and the Place Order button. */
.apo-notice--injected {
	margin: 16px 0;
}

/* Product card button.
   No font, size or colour overrides: it inherits the theme's Add to cart styling.
   Only a small clock icon is added in front of the label. */
.apo-preorder-button .add-to-cart-text::before,
.apo-preorder-button .loop_button-text::before {
	content: "";
	display: inline-block;
	width: 1.05em;
	height: 1.05em;
	margin-right: 0.45em;
	vertical-align: -0.16em;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.2v5.1l3.2 1.9'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.2v5.1l3.2 1.9'/%3E%3C/svg%3E") center / contain no-repeat;
	animation: apo-tick 2.6s ease-in-out infinite;
}

/* Attention pulse, only where the button is actually on screen with its label. */
@media (max-width: 991px) {
	.apo-preorder-button--animated {
		animation: apo-pulse 2.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
	}
}

.apo-preorder-button--animated:hover,
.apo-preorder-button--animated:focus {
	animation: none;
}

.apo-preorder-button.apo-loading {
	opacity: 0.65;
	pointer-events: none;
}

@keyframes apo-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(var(--apo-accent-rgb, 67, 27, 54), 0.45);
	}

	70% {
		box-shadow: 0 0 0 12px rgba(var(--apo-accent-rgb, 67, 27, 54), 0);
	}

	100% {
		box-shadow: 0 0 0 0 rgba(var(--apo-accent-rgb, 67, 27, 54), 0);
	}
}

@keyframes apo-tick {
	0%, 70%, 100% {
		transform: scale(1);
	}

	80% {
		transform: scale(1.18);
	}
}

@media (prefers-reduced-motion: reduce) {
	.apo-preorder-button--animated,
	.apo-preorder-button .add-to-cart-text::before,
	.apo-preorder-button .loop_button-text::before {
		animation: none;
	}
}

@media (max-width: 480px) {
	.apo-notice {
		padding: 12px 13px;
		font-size: 13.5px;
	}
}

/* Availability wording on a pre-order product. */
.apo-preorder-availability {
	color: var(--apo-accent, #431b36);
	font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Checkout confirmation popup
   --------------------------------------------------------------------------- */

body.apo-modal-open {
	overflow: hidden;
}

.apo-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.apo-modal[hidden] {
	display: none;
}

.apo-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 8, 15, 0.62);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	animation: apo-fade 0.25s ease both;
}

.apo-modal__card {
	position: relative;
	width: 100%;
	max-width: 460px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding: 30px 26px 26px;
	background: #fff;
	border-top: 4px solid var(--apo-accent, #431b36);
	border-radius: 6px;
	box-shadow: 0 24px 60px rgba(20, 8, 15, 0.28);
	text-align: center;
	color: var(--apo-text, #43202f);
	animation: apo-rise 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.apo-modal__icon {
	display: block;
	width: 44px;
	height: 44px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: var(--apo-bg, #fdf5f8);
	border: 1px solid var(--apo-border, #e3c3d2);
	color: var(--apo-accent, #431b36);
	font-size: 22px;
	font-weight: 700;
	line-height: 42px;
}

.apo-modal__title {
	margin: 0 0 12px;
	font-size: 21px;
	line-height: 1.3;
	color: var(--apo-accent, #431b36);
}

.apo-modal__text {
	margin: 0 0 24px;
	font-size: 14.5px;
	line-height: 1.7;
}

.apo-modal__label {
	font-weight: 700;
	color: var(--apo-accent, #431b36);
}

.apo-modal__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.apo-modal__button {
	display: block;
	width: 100%;
	padding: 14px 18px;
	border: 1px solid transparent;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.apo-modal__button--agree {
	background: var(--apo-accent, #431b36);
	color: #fff;
}

.apo-modal__button--agree:hover,
.apo-modal__button--agree:focus {
	opacity: 0.88;
	color: #fff;
}

.apo-modal__button--decline {
	background: transparent;
	border-color: var(--apo-border, #e3c3d2);
	color: var(--apo-accent, #431b36);
}

.apo-modal__button--decline:hover,
.apo-modal__button--decline:focus {
	background: var(--apo-bg, #fdf5f8);
	color: var(--apo-accent, #431b36);
}

@keyframes apo-fade {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes apo-rise {
	from {
		opacity: 0;
		transform: translateY(18px) scale(0.97);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.apo-modal__backdrop,
	.apo-modal__card {
		animation: none;
	}
}

@media (max-width: 480px) {
	.apo-modal {
		padding: 14px;
	}

	.apo-modal__card {
		padding: 26px 20px 20px;
	}

	.apo-modal__title {
		font-size: 19px;
	}
}
