/*
 * BD Cart & Checkout design (extras), all sites:
 *  - the coupon option as a large pink bar so customers cannot miss it;
 *  - "Continue shopping" / "Return to cart" buttons in the page heading.
 * CSS only on WooCommerce's block markup; cart, coupon and checkout behaviour is untouched.
 * Rules carry :not(#bdccd) so they outrank the base design and WooCommerce's block styles.
 */

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) {
	--bdccd-pink: #ec4899;
	--bdccd-pink-strong: #db2777;
	--bdccd-pink-deep: #be185d;
	--bdccd-pink-soft: #fdf2f8;
	--bdccd-pink-line: #f9a8d4;
	--bdccd-ink: #0f1117;
}

/* ------------------------------------------------------------ Coupon */

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-wrapper:has(> .wc-block-components-totals-coupon) {
	padding-top: 16px;
	padding-bottom: 16px;
	border-top: 0;
}

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-coupon.wc-block-components-panel {
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 2px solid var(--bdccd-pink);
	border-radius: 16px;
	background: var(--bdccd-pink-soft);
	box-shadow: 0 10px 26px rgba(219, 39, 119, 0.22);
}

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-coupon .wc-block-components-panel__button {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 62px;
	margin: 0;
	padding: 16px 54px 16px 18px;
	font-family: inherit;
	background: linear-gradient(135deg, var(--bdccd-pink) 0%, var(--bdccd-pink-strong) 100%);
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.01em;
	text-align: left;
	cursor: pointer;
	transition: filter 0.2s ease;
}

/* Coupon-tag icon */
:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-coupon .wc-block-components-panel__button::before {
	content: "";
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	background: center / 26px 26px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41 13.42 20.58a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z'/%3E%3Ccircle cx='7' cy='7' r='1.5' fill='%23fff'/%3E%3C/svg%3E");
}

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-coupon .wc-block-components-panel__button:hover {
	filter: brightness(1.06);
}

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-coupon .wc-block-components-panel__button:focus-visible {
	outline: 3px solid var(--bdccd-pink-deep);
	outline-offset: -5px;
}

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-coupon .wc-block-components-panel__button-icon {
	position: absolute;
	top: 50%;
	right: 16px;
	width: 26px;
	height: 26px;
	margin: 0;
	transform: translateY(-50%);
	fill: #fff;
}

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-coupon .wc-block-components-panel__content {
	padding: 16px 18px 18px;
	background: var(--bdccd-pink-soft);
}

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-coupon .wc-block-components-text-input input {
	border: 2px solid var(--bdccd-pink-line);
	border-radius: 12px;
	background: #fff;
}

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-coupon .wc-block-components-text-input input:focus {
	border-color: var(--bdccd-pink-strong);
	box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
	outline: none;
}

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-coupon .wc-block-components-totals-coupon__button {
	min-height: 48px;
	padding: 0 22px;
	border: 0;
	border-radius: 999px;
	background: var(--bdccd-pink-strong);
	color: #fff;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-coupon .wc-block-components-totals-coupon__button:hover:not(:disabled) {
	background: var(--bdccd-pink-deep);
}

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-coupon .wc-block-components-totals-coupon__button .wc-block-components-button__text {
	color: inherit;
}

/* Applied coupon chips */
:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-discount .wc-block-components-chip {
	border-radius: 999px;
	background: var(--bdccd-pink-soft);
	border: 1px solid var(--bdccd-pink-line);
	color: var(--bdccd-pink-deep);
	font-weight: 700;
}

/* --------------------------------------- Continue shopping / Return to cart */

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .site-main > .page-header.bdccd-has-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 24px;
}

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) a.bdccd-nav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 50px;
	padding: 12px 24px;
	border: 1.5px solid rgba(15, 17, 23, 0.22);
	border-radius: 999px;
	background: #fff;
	color: var(--bdccd-ink);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.05em;
	line-height: 1.2;
	text-decoration: none;
	text-transform: uppercase;
	transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) a.bdccd-nav-btn:hover {
	border-color: var(--bdccd-pink-strong);
	color: var(--bdccd-pink-deep);
	transform: translateY(-1px);
}

:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) a.bdccd-nav-btn:focus-visible {
	outline: 3px solid var(--bdccd-pink-deep);
	outline-offset: 2px;
}

@media (max-width: 600px) {
	:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) a.bdccd-nav-btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) a.bdccd-nav-btn,
	:is(body.woocommerce-cart, body.woocommerce-checkout):not(#bdccd) .wc-block-components-totals-coupon .wc-block-components-panel__button {
		transition: none;
		transform: none;
	}
}
