.cardis-cart-delivery {
	margin: 32px 0;
	padding: 24px;
	border: 1px solid #d8d8d8;
	border-radius: 12px;
	background: #fff;
}

.cardis-cart-delivery__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}

.cardis-cart-delivery__title {
	margin: 0 0 6px;
	font-size: 22px;
	line-height: 1.2;
}

.cardis-cart-delivery__subtitle,
.cardis-cart-delivery__notice {
	margin: 0;
	color: #5f5f5f;
}

.cardis-cart-delivery__unavailable {
	margin: 0;
	padding: 16px 20px;
	border: 1px solid #c62828;
	background: #fff5f5;
	color: #c62828;
	font-weight: 500;
	text-align: center;
}

.cardis-cart-delivery__phone {
	color: inherit;
	text-decoration: underline;
}

.wc-proceed-to-checkout--disabled {
	position: relative;
}

.wc-proceed-to-checkout--disabled .checkout-button,
.wc-proceed-to-checkout--disabled a.button {
	opacity: 0.5;
	pointer-events: none;
	cursor: not-allowed;
}

.wc-proceed-to-checkout__note {
	display: block;
	width: 100%;
	margin: 10px 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: #c62828;
	font-family: inherit;
	font-size: 14px;
	text-align: center;
	text-decoration: underline;
	cursor: pointer;
}

.wc-proceed-to-checkout__note:hover,
.wc-proceed-to-checkout__note:focus {
	color: #a31515;
}

.cardis-cart-delivery__notice {
	margin-bottom: 16px;
	font-size: 14px;
}

.cardis-cart-delivery__zip-button {
	padding: 12px 16px;
	border: 1px solid #0f4c81;
	border-radius: 999px;
	background: #fff;
	color: #0f4c81;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.cardis-cart-delivery__methods {
	display: grid;
	gap: 12px;
}

.cardis-cart-delivery__method {
	display: flex;
	gap: 14px;
	padding: 16px;
	border: 1px solid #d8d8d8;
	border-radius: 12px;
	cursor: pointer;
	transition: opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cardis-cart-delivery__method:has(input:checked),
.cardis-cart-delivery__method--selected {
	border-color: #0f4c81;
	box-shadow: 0 0 0 2px rgba(15, 76, 129, 0.12);
}

.cardis-cart-delivery__method input {
	margin-top: 3px;
}

.cardis-cart-delivery__method--loading {
	opacity: 0.65;
	pointer-events: none;
}

.cardis-cart-delivery__method-body {
	display: grid;
	gap: 6px;
	flex: 1;
}

.cardis-cart-delivery__method-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.cardis-cart-delivery__method-title,
.cardis-cart-delivery__method-price {
	font-weight: 700;
}

.cardis-cart-delivery__method-date,
.cardis-cart-delivery__method-description {
	color: #5f5f5f;
	font-size: 14px;
}

.cardis-delivery-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(17, 17, 17, 0.55);
}

.cardis-delivery-modal__dialog {
	width: min(100%, 420px);
	padding: 28px;
	background: #fff;
	box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
}

.cardis-delivery-modal__title {
	margin: 0 0 10px;
	font-size: 24px;
}

.cardis-delivery-modal__text {
	margin: 0 0 18px;
	color: #5f5f5f;
}

.cardis-delivery-modal__form {
	display: grid;
	gap: 14px;
}

.cardis-delivery-modal__input {
	width: 100%;
	padding: 14px 16px;
	border: 1px solid #cfcfcf;
	border-radius: 10px;
	font: inherit;
}

.cardis-delivery-modal__error {
	margin: 0;
	color: #b42318;
	font-size: 14px;
}

.cardis-delivery-modal__actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.cardis-delivery-modal__button {
	padding: 12px 18px;
	border-radius: 999px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.cardis-delivery-modal__button--secondary {
	border: 1px solid #cfcfcf;
	background: #fff;
	color: #1f1f1f;
}

.cardis-delivery-modal__button--primary {
	border: 0;
	background: #0f4c81;
	color: #fff;
}

.cardis-delivery-modal__button[disabled] {
	opacity: 0.7;
	cursor: not-allowed;
}

.cardis-delivery-modal__button-label {
	display: inline-block;
}

.cardis-delivery-modal__spinner {
	display: none;
	width: 14px;
	height: 14px;
	margin-left: 8px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	vertical-align: -2px;
	animation: cardis-spin 0.7s linear infinite;
}

.cardis-delivery-modal__button--loading .cardis-delivery-modal__spinner {
	display: inline-block;
}

/* Hide +/- buttons on cart quantity inputs — keep only the number box */
.woocommerce-cart .product-quantity .cardis-qty__btn {
	display: none;
}

.woocommerce-cart .product-quantity .cardis-qty-wrap input[type="number"] {
	color: #222;
	width: 4em;
}

.woocommerce-cart .cart_totals .shipping .woocommerce-shipping-methods,
.woocommerce-cart .cart_totals .shipping .shipping-calculator-button,
.woocommerce-cart .cart_totals .shipping .shipping-calculator-form {
	display: none;
}

.cardis-cart-shipping-summary {
	display: grid;
	gap: 4px;
}

.cardis-cart-shipping-summary__method {
	font-weight: 600;
}

.cardis-cart-shipping-summary__cost {
}

.cardis-cart-shipping-summary__zip {
	color: #5f5f5f;
	font-size: 13px;
}

/* Cart totals loading overlay */
.cart_totals {
	position: relative;
}

.cart_totals--loading::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.7);
	border-radius: inherit;
}

.cart_totals--loading::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 11;
	width: 32px;
	height: 32px;
	margin: -16px 0 0 -16px;
	border: 3px solid #d8d8d8;
	border-top-color: #0f4c81;
	border-radius: 50%;
	animation: cardis-spin 0.7s linear infinite;
}

@keyframes cardis-spin {
	to { transform: rotate(360deg); }
}


/* Strikethrough pricing on cart line items — Subtotal column only. The Price
   column shows just the discounted unit price in the normal cart font (see
   cardis_cart_item_price_strikethrough, now disabled). */
.woocommerce-cart .shop_table td.product-subtotal del {
	color: #767676;
	font-weight: 400;
	margin-right: 0.4em;
}

.woocommerce-cart .shop_table td.product-subtotal ins {
	color: #1f73b7;
	background: #fff;
	font-weight: 600;
	text-decoration: none;
}

/* Product name links in cart — inherit text color, no underline */
.woocommerce-cart .shop_table td.product-name a {
	color: inherit;
	text-decoration: none;
}

.woocommerce-cart .shop_table td.product-name a:hover,
.woocommerce-cart .shop_table td.product-name a:focus {
	color: inherit;
	text-decoration: none;
}

/* ==========================================================================
   Mattress Removal
   ========================================================================== */

.cardis-mattress-removal {
	margin: 32px 0;
	padding: 24px 0;
	border-top: 1px solid #d8d8d8;
}

.cardis-mattress-removal__title {
	margin: 0 0 16px;
	font-size: 22px;
	line-height: 1.2;
}

.cardis-mattress-removal__row {
	display: flex;
	align-items: center;
	gap: 16px;
}

/* Qty dropdown styled to match the cart line-item quantity box. */
.cardis-mattress-removal__qty {
	width: 4.631em;
	padding: 6px 4px;
	border: 1px solid #cfcfcf;
	border-radius: 0;
	background: #fff;
	text-align: center;
	text-align-last: center;
	color: #222;
	font: inherit;
	cursor: pointer;
}

.cardis-mattress-removal__description {
	margin: 14px 0 0;
	color: #5f5f5f;
	font-size: 14px;
	max-width: 540px;
}

/* Icon-only info trigger, sits superscript-style after the section heading. */
.cardis-mattress-removal__more {
	display: inline-flex;
	align-items: center;
	margin: 0 0 0 6px;
	padding: 0;
	border: 0;
	background: none;
	color: #0f4c81;
	line-height: 1;
	cursor: pointer;
	position: relative;
	top: -6px;
}

.cardis-mattress-removal__more:hover,
.cardis-mattress-removal__more:focus {
	color: #0a3a64;
}

.cardis-mattress-removal__info-icon {
	flex: 0 0 auto;
}

/* Info modal — reuses the .cardis-delivery-modal overlay. */
.cardis-delivery-modal__dialog--info {
	width: min(100%, 560px);
	max-height: 85vh;
	overflow-y: auto;
}

.cardis-mattress-info-modal__body {
	color: #3a3a3a;
	font-size: 14px;
	line-height: 1.55;
}

.cardis-mattress-info__title {
	margin: 0 0 12px;
	font-size: 22px;
}

.cardis-mattress-info-modal__body p {
	margin: 0 0 12px;
}

/* Close button uses the brand light blue (fallback: cart pages don't load the
   product stylesheet where --cardis-blue-light is defined). Scoped to the info
   modal so the shared --secondary button (zip modal Cancel) is unaffected. */
.cardis-mattress-info-modal .cardis-delivery-modal__button--secondary {
	border-color: var(--cardis-blue-light, #1768B2);
	background: var(--cardis-blue-light, #1768B2);
	color: #fff;
}


@media (max-width: 767px) {
	.cardis-cart-delivery {
		padding: 18px;
	}

	.cardis-cart-delivery__header,
	.cardis-cart-delivery__method-head,
	.cardis-delivery-modal__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.cardis-mattress-removal__row {
		flex-wrap: wrap;
	}
}

/* Per-line-item full-width rows beneath each cart product row:
   "Offer details" disclosure and "Protected by" plan label. */
.cardis-cart-item-promo-row td,
.cardis-cart-item-protected-row td {
	padding-top: 0;
	text-align: left;
}

/* shop_table_responsive injects a data-title pseudo-label on mobile; suppress it here. */
.cardis-cart-item-promo-row td::before,
.cardis-cart-item-protected-row td::before {
	content: none !important;
}

/* Pull the "Protected by" and "Offer details" rows up against the row above
   them (.cardis-has-* marks the row an add-on row follows). Specificity must
   beat woocommerce-general's `.woocommerce table.shop_table td` padding. */
.woocommerce table.shop_table tr.cardis-has-protection td,
.woocommerce table.shop_table tr.cardis-has-promo td {
	padding-bottom: 0;
}

.woocommerce table.shop_table .cardis-cart-item-protected-row td,
.woocommerce table.shop_table .cardis-cart-item-promo-row td {
	padding-top: 0;
}

/* The thumbnail's rowspan makes the browser distribute a tall image's extra
   height across both spanned rows, which pushes the "Protected by" row away
   from the product name. Constraining the product row's height sends all the
   slack to the (unconstrained) protected row instead; its cells are
   top-aligned, so the label stays right under the name. */
.woocommerce table.shop_table tr.cardis-has-protection {
	height: 1px;
}

.cardis-offer {
	width: 100%;
}

.cardis-offer__summary {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	list-style: none;
}

.cardis-offer__summary--right {
	display: flex;
	justify-content: flex-end;
}

.cardis-offer__summary::-webkit-details-marker {
	display: none;
}

.cardis-offer__link {
	font-size: 12px;
	font-weight: 600;
	color: #0065AE;
	text-decoration: underline;
	white-space: nowrap;
}

.cardis-offer__link::after {
	content: " \25B8"; /* ▸ */
	text-decoration: none;
	display: inline-block;
}

.cardis-offer[open] .cardis-offer__link::after {
	content: " \25BE"; /* ▾ */
}

.cardis-offer__body {
	margin-top: 8px;
	padding: 10px 12px;
	background: #f3f7fb;
	border: 1px solid #d6ebff;
	border-radius: 8px;
	text-align: left;
}

.cardis-offer__item + .cardis-offer__item {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #d6ebff;
}

.cardis-offer__heading {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.cardis-offer__title {
	display: block;
	font-size: 13px;
	color: #1a2b5f;
}

/* Discount amount (e.g. "-$250.00") sits on the same line as the offer title,
   right-aligned, matching the title's font and color. */
.cardis-offer__amount {
	margin-left: auto;
	white-space: nowrap;
	text-align: right;
	font-size: 16px;
	color: var(--light-blue);
}

.cardis-offer__message {
	font-size: 13px;
	color: #333;
}

.cardis-offer__message p {
	margin: 4px 0 0;
}

.cardis-offer__disclaimer {
	display: block;
	margin-top: 6px;
	font-size: 11px;
	line-height: 1.4;
	color: #5f5f5f;
}

/* Cart is submitting a quantity auto-update (full round-trip). */
.cardis-cart-form--updating {
	opacity: 0.55;
	pointer-events: none;
}
