/**
 * Save-your-cart.
 *
 * Two surfaces sharing one look: the inline capture inside the cart drawer, and
 * the leave-intent prompt. Loaded wherever the cart is.
 */

/* ---------------------------------------------------- inline drawer capture */

.cart-save {
	padding: 12px 14px;
	margin-bottom: 14px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--pearl);
}

.cart-save__label {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 700;
	color: var(--ink);
}

.cart-save__label svg {
	width: 15px;
	height: 15px;
	flex: none;
	color: var(--pounamu);
}

.cart-save__row {
	display: flex;
	gap: 8px;
}

.cart-save__row input {
	flex: 1;
	min-width: 0;
	min-height: 42px;
	padding: 0 12px;
	font-family: inherit;
	font-size: 15px;
	color: var(--ink);
	background: #fff;
	border: 1.5px solid var(--line);
	border-radius: 8px;
}

.cart-save__row input::placeholder {
	color: var(--muted);
	opacity: 1;
}

.cart-save__row input:focus {
	outline: none;
	border-color: var(--pounamu);
	box-shadow: 0 0 0 3px rgba(33, 80, 61, .10);
}

.cart-save__btn {
	flex: none;
	min-height: 42px;
	padding: 0 18px;
	border: 1.5px solid var(--line);
	border-radius: 8px;
	background: #fff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	color: var(--ink);
	cursor: pointer;
	transition: border-color .18s var(--ease), color .18s var(--ease);
}

.cart-save__btn:hover:not(:disabled) {
	border-color: var(--pounamu);
	color: var(--pounamu);
}

.cart-save__btn:disabled {
	opacity: .55;
	cursor: not-allowed;
}

.cart-save__msg {
	margin: 8px 0 0;
	font-size: 12.5px;
	font-weight: 600;
	min-height: 1em;
}

.cart-save__msg:empty {
	display: none;
}

.cart-save__msg.is-ok {
	color: var(--pounamu);
}

.cart-save__msg.is-error {
	color: var(--garnet);
}

/* ------------------------------------------------------------- the prompt */

.cs-modal {
	position: fixed;
	inset: 0;
	z-index: 1200;
	display: grid;
	place-items: center;
	padding: 20px;
}

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

.cs-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(28, 26, 23, .55);
	backdrop-filter: blur(2px);
}

.cs-modal__box {
	position: relative;
	width: 100%;
	max-width: 440px;
	background: #fff;
	border-radius: 20px;
	padding: 34px 30px 26px;
	text-align: center;
	box-shadow: 0 24px 60px rgba(28, 26, 23, .22);
	animation: cs-pop .22s var(--ease);
}

@keyframes cs-pop {
	from { opacity: 0; transform: translateY(10px) scale(.98); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.cs-modal__box {
		animation: none;
	}
}

.cs-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--muted);
	cursor: pointer;
}

.cs-modal__close svg {
	width: 18px;
	height: 18px;
}

.cs-modal__close:hover {
	background: var(--pearl);
	color: var(--ink);
}

.cs-modal__ic {
	display: grid;
	place-items: center;
	width: 54px;
	height: 54px;
	margin: 0 auto 12px;
	border-radius: 50%;
	background: var(--pearl);
	color: var(--pounamu);
}

.cs-modal__ic svg {
	width: 26px;
	height: 26px;
}

.cs-modal__title {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 1.75rem;
	font-weight: 600;
	color: var(--ink);
	margin: 0 0 8px;
	line-height: 1.2;
}

.cs-modal__text {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--muted);
}

.cs-modal__form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cs-modal__form input {
	width: 100%;
	min-height: 50px;
	padding: 0 16px;
	font-family: inherit;
	font-size: 16px;
	color: var(--ink);
	background: #fff;
	border: 1.5px solid var(--line);
	border-radius: 12px;
	text-align: center;
}

.cs-modal__form input::placeholder {
	color: var(--muted);
	opacity: 1;
}

.cs-modal__form input:focus {
	outline: none;
	border-color: var(--pounamu);
	box-shadow: 0 0 0 3px rgba(33, 80, 61, .10);
}

.cs-modal__submit {
	min-height: 50px;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--pounamu);
	color: var(--ivory);
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background .18s var(--ease), opacity .18s var(--ease);
}

.cs-modal__submit:hover:not(:disabled) {
	background: #1a4031;
}

.cs-modal__submit:disabled {
	opacity: .55;
	cursor: not-allowed;
}

.cs-modal__msg {
	margin: 12px 0 0;
	font-size: 13px;
	font-weight: 600;
	min-height: 1em;
}

.cs-modal__msg:empty {
	display: none;
}

.cs-modal__msg.is-ok {
	color: var(--pounamu);
}

.cs-modal__msg.is-error {
	color: var(--garnet);
}

.cs-modal__dismiss {
	display: inline-block;
	margin: 16px auto 0;
	padding: 6px 4px;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--ink);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.cs-modal__dismiss:hover {
	color: var(--pounamu);
}

.cs-modal__fine {
	margin: 14px 0 0;
	font-size: 11.5px;
	color: var(--muted);
	line-height: 1.45;
}

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

@media (max-width: 420px) {
	.cs-modal__box {
		padding: 30px 20px 22px;
	}

	.cs-modal__title {
		font-size: 1.5rem;
	}
}

/* ------------------------------------------------------- drawer footer bits */

.cart-drawer__line {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 4px 0 14px;
	font-size: 13.5px;
	color: var(--muted);
}

.cart-drawer__calc {
	font-weight: 600;
	color: var(--pounamu);
}

/*
 * The drawer CTA carries the amount.
 *
 * Seeing the total on the button itself is what stops the "wait, how much?"
 * pause between the drawer and the checkout.
 */
.cart-drawer__checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	min-height: 52px;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--pounamu);
	color: var(--ivory);
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	text-align: center;
	transition: background .18s var(--ease);
}

.cart-drawer__checkout:hover {
	background: #1a4031;
	color: var(--ivory);
}

.cart-drawer__checkout .icon {
	width: 16px;
	height: 16px;
	flex: none;
}

.cart-drawer__checkout-total:not(:empty)::before {
	content: "·";
	margin: 0 7px 0 2px;
	opacity: .65;
}

.cart-drawer__continue {
	display: block;
	width: 100%;
	min-height: 48px;
	margin-top: 10px;
	border: 1.5px solid var(--line);
	border-radius: 999px;
	background: #fff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	color: var(--ink);
	cursor: pointer;
	transition: border-color .18s var(--ease), color .18s var(--ease);
}

.cart-drawer__continue:hover {
	border-color: var(--pounamu);
	color: var(--pounamu);
}

/*
 * Remove control: the red bin, matching the checkout summary.
 *
 * A faint grey cross reads as "dismiss this notice"; a red bin reads as
 * "delete this item", which is what it does. Overrides the muted style the
 * drawer previously used.
 */
.cart-drawer .drawer-item__remove {
	opacity: 1;
	width: 30px;
	height: 30px;
	display: inline-grid;
	place-items: center;
	padding: 0;
	border-radius: 8px;
	color: var(--garnet);
	transition: color .18s var(--ease), background .18s var(--ease);
}

.cart-drawer .drawer-item__remove svg {
	width: 15px;
	height: 15px;
	stroke-width: 1.8;
}

.cart-drawer .drawer-item__remove:hover {
	color: #fff;
	background: var(--garnet);
}

/* The drawer CTA owns its colour; nothing upstream should tint it. */
.cart-drawer .cart-drawer__foot .cart-drawer__checkout {
	background: var(--pounamu);
	color: #fff;
	opacity: 1;
	text-transform: none;
	letter-spacing: 0;
	border-radius: 999px;
	padding: 0 20px;
	min-height: 52px;
	font-size: 15px;
}

.cart-drawer .cart-drawer__foot .cart-drawer__checkout:hover {
	background: #1a4031;
	color: #fff;
}

.cart-drawer .cart-drawer__foot .cart-drawer__continue {
	opacity: 1;
	color: var(--ink);
}

/* ===========================================================================
 * Cart page
 * ======================================================================== */

.cart-item__stock {
	display: inline-block;
	margin: 6px 0 4px;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.cart-item__stock.is-in {
	color: var(--pounamu);
	background: #EDF5F1;
}

.cart-item__stock.is-out {
	color: var(--garnet);
	background: #F8EDEE;
}

/* Remove: the red bin, consistent with the drawer and checkout summary. */
.cart-page .cart-item__remove,
.cart-item__remove {
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 9px;
	background: none;
	color: var(--garnet);
	cursor: pointer;
	opacity: 1;
	transition: color .18s var(--ease), background .18s var(--ease);
}

.cart-item__remove svg {
	width: 16px;
	height: 16px;
}

.cart-item__remove:hover {
	color: #fff;
	background: var(--garnet);
}

/*
 * Summary CTA.
 *
 * Green, full width and pill-shaped, matching the drawer and the checkout so
 * the primary action looks the same at every step of the journey.
 */
.summary .summary__checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	min-height: 54px;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--pounamu);
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: none;
	transition: background .18s var(--ease);
}

.summary .summary__checkout:hover {
	background: #1a4031;
	color: #fff;
}

.summary .summary__checkout .icon {
	width: 16px;
	height: 16px;
	flex: none;
}

/* Unsubscribe confirmation banner. Generic for every outcome. */
.stonex-unsub {
	background: #EDF5F1;
	border-bottom: 1px solid var(--line);
	color: var(--pounamu);
	text-align: center;
	font-size: 14px;
	font-weight: 600;
}

.stonex-unsub p {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 12px 22px;
}
