/**
 * MobilePay Subscription Express — button + modal extras.
 *
 * The product-page BUTTON and the fly-cart/cart-page SLOT button are
 * self-contained here. The MODAL reuses the enkeltkøb
 * SHELL (overlay, head, appnote, newsletter/terms checkboxes, trust band styled
 * by mobilepay-express.css) — this file styles what is unique to the
 * subscription modal: the fixed item block, the compact gift rows, the payment
 * schedule (Betales i dag / Løbende betaling) and the dual terms
 * reader views. The confirm PAGE has its own inline CSS (subx-confirm-page.php).
 * @package calio-mobilepay-sub-express
 */

/* ------------------------------------------------ product-page button + "eller" */
.calio-subx-wrap {
	margin-top: 12px;
	width: 100%;
}
.calio-subx-or {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 14px auto 12px;
	max-width: 360px;
}
.calio-subx-or::before,
.calio-subx-or::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: #e9eee8;
}
.calio-subx-or span {
	color: #7a7a7a;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
}

.calio-subx-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 52px;
	padding: 12px 22px;
	border-radius: 30px;
	background: #5a78ff;
	color: #fff;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	box-sizing: border-box;
	transition: background 0.15s ease, transform 0.15s ease;
}
.calio-subx-btn:hover,
.calio-subx-btn:focus {
	background: #4a66e8;
	color: #fff;
	transform: translateY(-1px);
}
.calio-subx-btn-prefix {
	color: #fff;
	font-weight: 500;
	font-size: 17px;
	line-height: 1.2;
	white-space: nowrap;
}
.calio-subx-btn-logo {
	display: block;
	height: 17px !important;
	width: auto !important;
	max-width: none !important;
	min-height: 0 !important;
	margin: 0 !important;
	flex: 0 0 auto;
	align-self: center;
}
@media ( min-width: 601px ) {
	.calio-subx-wrap .calio-subx-btn {
		max-width: 360px;
		margin-left: auto;
		margin-right: auto;
	}
}
.calio-subx-msg {
	margin-top: 8px;
	font-size: 14px;
	color: #b00020;
	text-align: center;
}

/* ------------------------------------------------ fly-cart / cart-page slot */

/* Mirrors the enkeltkøb slot's placement (its CSS handles the shared flex
   containers); at most one of the two slots ever holds a button. */
.calio-subx-slot { width: 100%; }
.calio-subx-slot:empty { display: none; }
.calio-subx-slot .calio-subx-btn { min-height: 48px; }
.calio-subx-slot .calio-subx-btn-prefix { font-size: 15.5px; }
.calio-subx-slot .calio-subx-btn-logo { height: 15px !important; }

.woocommerce-cart .wc-proceed-to-checkout .calio-subx-slot {
	flex-basis: 100%;
	width: 100%;
	order: 10;
	margin-top: 8px;
}
@media (max-width: 768px) {
	.woocommerce-cart .wc-proceed-to-checkout .calio-subx-slot { order: 1; margin-top: 8px; }
}
.fly-cart-footer .calio-subx-slot {
	flex-basis: 100%;
	margin-top: 0;
	margin-bottom: 14px;
}

/* ---- loading spinner (product button + modal continue) ---- */
.calio-subx-btn.is-loading,
.calio-subx-continue.is-loading {
	position: relative;
	pointer-events: none;
}
.calio-subx-btn.is-loading > *,
.calio-subx-continue.is-loading > * {
	visibility: hidden;
}
.calio-subx-btn.is-loading::after,
.calio-subx-continue.is-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2.5px solid rgba( 255, 255, 255, 0.45 );
	border-top-color: #fff;
	border-radius: 50%;
	animation: calio-subx-spin 0.7s linear infinite;
}
@keyframes calio-subx-spin {
	to { transform: rotate( 360deg ); }
}

/* ------------------------------------------------ modal: item block */

.calio-subx-items {
	border-top: 1px solid #e9eee8;
	padding-top: 12px;
	margin-bottom: 12px;
}
.calio-subx-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}
.calio-subx-item-img { flex: 0 0 56px; }
.calio-subx-item-img img {
	display: block;
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 12px;
	background: #faf9f7;
}
.calio-subx-item-info {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
}
.calio-subx-item-name {
	font-weight: 600;
	font-size: 14.5px;
	line-height: 1.3;
}
/* The quantity/cadence is the key fact — the store's cart pill (bc-frequency
   look): grey chip, dark-green text, GREEN quantity. Explicit line-height so
   theme span rules can't inflate the row. */
.calio-subx-item-cadence {
	display: inline-block;
	margin: 4px 0 2px;
	padding: 3px 8px;
	border-radius: 6px;
	background: #f2f2f2;
	color: #17554b;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
}
.calio-subx-item-cadence b {
	color: #25ae91;
	font-weight: 600;
}
.calio-subx-item-size {
	margin-top: 3px;
	font-size: 12.5px;
	line-height: 1.35;
	color: #7a7a7a;
}
.calio-subx-item-price {
	flex: 0 0 auto;
	align-self: center;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	line-height: 1.25;
	white-space: nowrap;
}
.calio-subx-item-price del {
	font-size: 12.5px;
	color: #7a7a7a;
}
.calio-subx-item-price ins {
	text-decoration: none;
	font-weight: 600;
	font-size: 14.5px;
}

/* compact free-gift rows */
.calio-subx-gift {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px dashed #e9eee8;
	font-size: 13px;
}
.calio-subx-gift-img { flex: 0 0 32px; }
.calio-subx-gift-img img {
	display: block;
	width: 32px;
	height: 32px;
	object-fit: cover;
	border-radius: 8px;
	background: #faf9f7;
}
.calio-subx-gift-name {
	flex: 1 1 auto;
	min-width: 0;
	line-height: 1.3;
}
.calio-subx-gift-price {
	flex: 0 0 auto;
	font-size: 13px;
	white-space: nowrap;
}

/* ------------------------------------------------ modal: payment schedule */

/* Soft rounded box, but the rows keep the DEFAULT text color (no grey labels);
   only "Betales i dag" is bold. Explicit font-size/weight/line-height so theme
   span/price rules can't restyle it. */
.calio-subx-schedule {
	margin: 12px 0 10px;
	padding: 11px 14px;
	background: #faf9f7;
	border-radius: 14px;
}
.calio-subx-srow {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 2px 0;
}
.calio-subx-srow > span {
	font-size: 13.5px;
	font-weight: 400;
	line-height: 1.5;
	color: inherit;
}
.calio-subx-srow-free {
	color: #55b607 !important;
	font-weight: 500 !important;
}
.calio-subx-srow-today > span {
	font-size: 15.5px;
	font-weight: 600;
}
/* ------------------------------------------------ modal: no-binding trust line */

.calio-subx-nobind {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	margin-top: 11px;
	font-size: 12.5px;
	line-height: 1.4;
}
.calio-subx-nobind svg {
	flex: 0 0 auto;
	color: #55b607;
	display: block;
}

/* ------------------------------------------------ modal: dual terms reader */

/* Reading terms: the modal heading disappears — the reader (with its Tilbage
   pill) takes the full modal. */
.calio-mpx-viewing-terms .calio-mpx-head {
	display: none;
}

/* Same pill as the enkeltkøb reader's back button (own class: the shared
   .calio-mpx-terms-back handler only knows ONE terms view). */
.calio-subx-terms-back {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 16px;
	padding: 9px 18px;
	border-radius: 30px;
	background: var( --e-global-color-ec74859, #18564B );
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.calio-subx-terms-back:hover {
	background: #123f37;
	color: #fff;
}

/* ------------------------------------------------ modal: actions */

.calio-subx-continue {
	width: 100%;
	margin-top: 18px;
}
