/* =========================================================================
   SERAPHELLÈ — Cart page  ·  v1.1

   Scoped by ID (#srph-cart / #srph-crosssells / #srph-banner) rather than by
   class. Single-class selectors lose to common theme rules such as
   .entry-content h2 or .woocommerce button.button; an ID prefix beats those
   without needing !important on every declaration.

   Order matters: the reset layer runs first, component rules restore what they
   need with equal-or-higher specificity.
   ========================================================================= */

/* Design tokens live in srph-tokens.css, enqueued as a dependency. */

/* =========================================================================
   0. Width unlock
   The theme wraps page content in a narrow container. Nothing inside can widen
   itself, so the wrappers are released on the cart page only. The body class is
   added by PHP and can be switched off with:
       add_filter( 'srph_cart_unlock_width', '__return_false' );
   ========================================================================= */

body.srph-cart-fullwidth .site-main,
body.srph-cart-fullwidth .site-content,
body.srph-cart-fullwidth .content-area,
body.srph-cart-fullwidth .entry-content,
body.srph-cart-fullwidth .page-content,
body.srph-cart-fullwidth .wp-block-post-content,
body.srph-cart-fullwidth main.wp-block-group,
body.srph-cart-fullwidth article.page,
body.srph-cart-fullwidth .woocommerce,
body.srph-cart-fullwidth .woocommerce-page .woocommerce {
	max-width: none !important;
	width: auto !important;
	float: none !important;
}

/* Block themes constrain direct children of the post content. */
body.srph-cart-fullwidth .wp-block-post-content > *,
body.srph-cart-fullwidth .entry-content > * {
	max-width: none !important;
}

/* Elementor and page-builder containers. */
body.srph-cart-fullwidth .elementor-section .elementor-container,
body.srph-cart-fullwidth .e-con-inner {
	max-width: none !important;
}

/* =========================================================================
   1. Reset layer
   ========================================================================= */

#srph-cart,
#srph-crosssells,
#srph-banner {
	font-family: var(--srph-body);
	font-size: 15px;
	line-height: 1.5;
	color: var(--srph-ink);
	max-width: 1240px;
	margin-inline: auto;
	padding-inline: 24px;
	box-sizing: border-box;
}

#srph-cart *,
#srph-crosssells *,
#srph-banner * { box-sizing: border-box; }

/* Headings and text: strip inherited theme typography. */
#srph-cart h1, #srph-cart h2, #srph-cart h3,
#srph-cart p, #srph-cart small, #srph-cart span,
#srph-cart ul, #srph-cart ol, #srph-cart li,
#srph-cart dl, #srph-cart dt, #srph-cart dd,
#srph-crosssells h2, #srph-crosssells h3, #srph-crosssells p,
#srph-banner h2, #srph-banner p {
	margin: 0;
	padding: 0;
	font-family: var(--srph-body);
	font-weight: 400;
	font-style: normal;
	letter-spacing: normal;
	text-transform: none;
	line-height: 1.45;
	color: inherit;
}

#srph-cart ul, #srph-cart ol,
#srph-crosssells ul { list-style: none; }

/* Buttons and inputs: strip theme button skins. */
#srph-cart button,
#srph-cart input,
#srph-cart a.button,
#srph-cart .button,
#srph-crosssells button {
	font-family: var(--srph-body);
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	box-shadow: none;
	background: transparent;
	background-image: none;
	color: inherit;
	border: 0;
	border-radius: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
	min-height: 0;
	width: auto;
	height: auto;
	line-height: normal;
	-webkit-appearance: none;
	appearance: none;
}

#srph-cart table,
#srph-cart tbody,
#srph-cart tr,
#srph-cart td { display: revert; border: 0; }

/* =========================================================================
   2. Page head
   ========================================================================= */

#srph-cart { padding-top: 40px; }

#srph-cart .srph-cart__head {
	text-align: center;
	margin-bottom: 28px;
}

#srph-cart .srph-cart__title {
	font-family: var(--srph-display) !important;
	font-size: clamp(34px, 5vw, 52px) !important;
	font-weight: 400;
	letter-spacing: .14em;
	text-transform: uppercase;
	margin: 0 0 6px;
	line-height: 1.1;
}

#srph-cart .srph-cart__count {
	font-size: 14px;
	color: var(--srph-ink-soft);
	letter-spacing: .02em;
}

/* ---------- Free shipping progress ---------- */

#srph-cart .srph-freeship {
	max-width: 460px;
	margin: 0 auto 32px;
	text-align: center;
}

#srph-cart .srph-freeship__text,
#srph-cart .srph-freeship__done {
	margin-bottom: 10px;
	font-size: 13px;
	letter-spacing: .04em;
	color: var(--srph-ink-soft);
}

#srph-cart .srph-freeship__done { color: var(--srph-accent); }

#srph-cart .srph-freeship__text strong,
#srph-cart .srph-freeship__text .woocommerce-Price-amount {
	color: var(--srph-ink);
	font-weight: 500;
}

#srph-cart .srph-freeship__track {
	height: 3px;
	background: var(--srph-line);
	border-radius: 999px;
	overflow: hidden;
}

#srph-cart .srph-freeship__track span {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--srph-tan), var(--srph-accent));
	transition: width .45s ease;
}

/* =========================================================================
   3. Layout
   ========================================================================= */

#srph-cart .srph-cart__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 380px;
	gap: 28px;
	align-items: start;
}

#srph-cart .srph-cart__main { min-width: 0; }
#srph-cart .srph-cart__aside { position: sticky; top: 24px; }
#srph-cart .woocommerce-cart-form { margin: 0; }

/* ---------- Items panel ---------- */

#srph-cart .srph-panel {
	background: var(--srph-surface);
	border-radius: var(--srph-radius-lg);
	box-shadow: var(--srph-shadow);
	padding: 8px 32px 0;
}

#srph-cart .srph-panel__head,
#srph-cart .srph-item {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr) 88px 116px 88px 32px;
	align-items: center;
	gap: 18px;
}

#srph-cart .srph-panel__head {
	padding: 24px 0 16px;
	border-bottom: 1px solid var(--srph-line);
	font-size: 11px;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--srph-ink-soft);
}

#srph-cart .srph-panel__head .srph-col--product { grid-column: 1 / span 2; }
#srph-cart .srph-panel__head .srph-col--price,
#srph-cart .srph-panel__head .srph-col--qty,
#srph-cart .srph-panel__head .srph-col--total { text-align: center; }

/* ---------- Line item ---------- */

#srph-cart .srph-item {
	position: relative;
	padding: 24px 0;
	border-bottom: 1px solid var(--srph-line);
	transition: opacity .2s ease;
}

#srph-cart .srph-item:last-child { border-bottom: 0; }
#srph-cart .srph-item.is-busy { opacity: .45; pointer-events: none; }

#srph-cart .srph-item__loader { position: absolute; inset: 0; display: none; }
#srph-cart .srph-item.is-busy .srph-item__loader { display: block; }

#srph-cart .srph-item__media { min-width: 0; }

#srph-cart .srph-item__media img {
	width: 88px;
	height: 88px;
	max-width: none;
	object-fit: cover;
	border-radius: 10px;
	display: block;
	background: var(--srph-surface-warm);
}

#srph-cart .srph-item__info { min-width: 0; }

#srph-cart .srph-item__name,
#srph-cart .srph-item__name a {
	font-family: var(--srph-body) !important;
	font-size: 16px !important;
	font-weight: 500;
	letter-spacing: .01em;
	line-height: 1.35;
	text-transform: none;
	color: var(--srph-ink);
	text-decoration: none;
}

#srph-cart .srph-item__name { margin-bottom: 4px; }
#srph-cart .srph-item__name a:hover { color: var(--srph-ink-soft); }

#srph-cart .srph-item__info .variation,
#srph-cart .srph-item__info dl.variation {
	font-size: 13px;
	color: var(--srph-ink-soft);
	line-height: 1.6;
	display: block;
}

#srph-cart .srph-item__info dl.variation dt,
#srph-cart .srph-item__info dl.variation dd {
	display: inline;
	font-weight: 400;
	font-size: 13px;
}

#srph-cart .srph-item__info dl.variation dd { color: var(--srph-ink-faint); }
#srph-cart .srph-item__info dl.variation dd p { display: inline; }
#srph-cart .srph-item__info dl.variation dd::after { content: ""; display: block; }

#srph-cart .srph-item__price,
#srph-cart .srph-item__total {
	text-align: center;
	font-size: 15px;
	letter-spacing: .01em;
	white-space: nowrap;
}

#srph-cart .srph-item__total { font-weight: 500; }

/* ---------- Quantity stepper ---------- */

#srph-cart .srph-item__qty { display: flex; justify-content: center; }

#srph-cart .srph-qty {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	border: 1px solid var(--srph-line);
	border-radius: 999px;
	height: 40px;
	width: 116px;
	padding: 0 4px;
	background: transparent;
}

#srph-cart .srph-qty .quantity {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	display: flex;
	float: none;
	width: auto;
}

#srph-cart .srph-qty button.srph-qty__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 32px !important;
	height: 32px !important;
	min-width: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	color: var(--srph-ink-soft) !important;
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}

#srph-cart .srph-qty button.srph-qty__btn:hover:not(:disabled) {
	background: var(--srph-surface-warm) !important;
	color: var(--srph-ink) !important;
}

#srph-cart .srph-qty button.srph-qty__btn:disabled { opacity: .3; cursor: not-allowed; }
#srph-cart .srph-qty button.srph-qty__btn:focus-visible { outline: 2px solid var(--srph-accent); outline-offset: 2px; }

#srph-cart .srph-qty input.qty {
	width: 40px !important;
	height: auto;
	min-height: 0;
	border: 0 !important;
	background: transparent !important;
	text-align: center;
	font-family: inherit;
	font-size: 15px;
	color: var(--srph-ink);
	padding: 0 !important;
	box-shadow: none;
	-moz-appearance: textfield;
}

#srph-cart .srph-qty input.qty::-webkit-outer-spin-button,
#srph-cart .srph-qty input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#srph-cart .srph-qty input.qty:focus { outline: none; }

/* ---------- Remove ---------- */

#srph-cart .srph-item__remove { text-align: right; }

#srph-cart .srph-item__remove a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: transparent !important;
	color: var(--srph-ink-faint) !important;
	font-size: 18px;
	font-weight: 400;
	line-height: 1;
	text-decoration: none;
	transition: background .15s ease, color .15s ease;
}

#srph-cart .srph-item__remove a.remove:hover {
	background: var(--srph-surface-warm) !important;
	color: var(--srph-ink) !important;
}

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

#srph-cart .srph-cart__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 22px;
}

#srph-cart .srph-coupon {
	display: flex;
	gap: 8px;
	width: 100%;
	max-width: 340px;
}

#srph-cart .srph-coupon input.input-text {
	flex: 1;
	height: 44px;
	border: 1px solid var(--srph-line) !important;
	border-radius: 999px !important;
	padding: 0 18px !important;
	font-family: inherit;
	font-size: 14px;
	background: transparent;
	color: var(--srph-ink);
	box-shadow: none;
}

#srph-cart .srph-coupon input.input-text::placeholder { color: var(--srph-ink-faint); letter-spacing: .04em; }
#srph-cart .srph-coupon input.input-text:focus { outline: none; border-color: var(--srph-ink-faint) !important; }

#srph-cart button.srph-coupon__apply {
	height: 44px;
	padding: 0 22px !important;
	border: 1px solid var(--srph-ink) !important;
	border-radius: 999px !important;
	background: transparent !important;
	color: var(--srph-ink) !important;
	font-size: 12px;
	letter-spacing: .14em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background .18s ease, color .18s ease;
}

#srph-cart button.srph-coupon__apply:hover {
	background: var(--srph-ink) !important;
	color: #fff !important;
}

/* Native update button kept for no-JS, hidden visually. */
#srph-cart .srph-update-cart {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Trust strip ---------- */

#srph-cart .srph-trust {
	padding: 22px 0 26px;
	border-top: 1px solid var(--srph-line);
	display: grid;
	grid-template-columns: repeat(3, 1fr);
}

#srph-cart .srph-trust__item {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 4px 12px;
	border-right: 1px solid var(--srph-line);
}

#srph-cart .srph-trust__item:last-child { border-right: 0; }

#srph-cart .srph-trust__icon svg {
	width: 26px;
	height: 26px;
	color: var(--srph-ink-soft);
	display: block;
}

#srph-cart .srph-trust__copy { display: flex; flex-direction: column; line-height: 1.45; }

#srph-cart .srph-trust__copy strong {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--srph-ink);
}

#srph-cart .srph-trust__copy span,
#srph-cart .srph-trust__copy .woocommerce-Price-amount {
	font-size: 12px;
	color: var(--srph-ink-soft);
}

/* =========================================================================
   4. Order summary
   ========================================================================= */

#srph-cart .srph-summary {
	background: var(--srph-surface-warm);
	border-radius: var(--srph-radius-lg);
	padding: 30px 28px 26px;
	box-shadow: var(--srph-shadow);
}

#srph-cart .srph-summary__title {
	font-family: var(--srph-body) !important;
	font-size: 15px !important;
	font-weight: 500;
	letter-spacing: .16em;
	text-transform: uppercase;
	margin-bottom: 20px;
	padding-bottom: 18px;
	border-bottom: 1px solid rgba(34, 29, 26, .1);
	line-height: 1.3;
}

#srph-cart .srph-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 9px 0;
	font-size: 15px;
}

#srph-cart .srph-row__label { color: var(--srph-ink); flex: 1 1 auto; }
#srph-cart .srph-row__value { text-align: right; flex: 0 0 auto; }

#srph-cart .srph-row__value--muted,
#srph-cart .srph-shipping__note {
	display: block;
	font-size: 12px;
	color: var(--srph-ink-faint);
	margin-top: 2px;
}

#srph-cart .srph-row--total {
	margin-top: 12px;
	padding-top: 18px;
	border-top: 1px solid rgba(34, 29, 26, .1);
	font-size: 19px;
}

#srph-cart .srph-row--total .srph-row__label,
#srph-cart .srph-row--total .srph-row__value { font-weight: 500; }
#srph-cart .srph-row--coupon .srph-row__value { color: var(--srph-accent); }

#srph-cart .srph-shipping__methods {
	font-size: 14px;
	text-align: right;
}

#srph-cart .srph-shipping__methods li { padding: 2px 0; }
#srph-cart .srph-shipping__methods label { cursor: pointer; font-size: 14px; }
#srph-cart .srph-shipping__methods input[type="radio"] { -webkit-appearance: radio; appearance: radio; margin-right: 6px; }

#srph-cart .srph-summary__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 22px;
}

/* Checkout button — !important because Woo and most themes ship an
   a.button.alt colour rule that would otherwise win. */
#srph-cart .srph-summary__actions a.checkout-button,
#srph-cart .srph-summary__actions a.button.alt,
#srph-cart .srph-summary__actions .checkout-button {
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 54px;
	padding: 0 20px !important;
	border: 0 !important;
	border-radius: 10px !important;
	background: var(--srph-black) !important;
	background-image: none !important;
	color: #fff !important;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: .18em;
	text-transform: uppercase;
	text-decoration: none;
	transition: opacity .18s ease, transform .18s ease;
}

#srph-cart .srph-summary__actions a.checkout-button::after { content: "\2192"; font-size: 15px; letter-spacing: 0; }
#srph-cart .srph-summary__actions a.checkout-button:hover { opacity: .88; }
#srph-cart .srph-summary__actions a.checkout-button:active { transform: translateY(1px); }

/* Express wallets — left alone visually; gateways control their own branding. */
#srph-cart .srph-express {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#srph-cart .srph-express > * { border-radius: 10px; overflow: hidden; }
#srph-cart .srph-express .ppc-button-wrapper,
#srph-cart .srph-express .wcpay-payment-request-wrapper,
#srph-cart .srph-express #wc-stripe-payment-request-wrapper { margin: 0 !important; }
#srph-cart .srph-express .ppcp-messages,
#srph-cart .srph-express .ppc-button-wrapper + div { font-size: 12px; }

#srph-cart .srph-summary__secure {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	margin-top: 18px;
	font-size: 12px;
	color: var(--srph-ink-soft);
}

#srph-cart .srph-summary__secure svg { width: 14px; height: 14px; flex: 0 0 auto; }

/* =========================================================================
   6. Footer banner
   ========================================================================= */

#srph-banner {
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr) auto;
	align-items: center;
	gap: 24px;
	margin-top: 48px;
	margin-bottom: 64px;
	padding: 26px 34px;
	background: var(--srph-surface-warm);
	border-radius: var(--srph-radius-lg);
	max-width: 1192px;
}

#srph-banner .srph-banner__mark svg { width: 88px; height: auto; color: rgba(34, 29, 26, .22); }

#srph-banner .srph-banner__copy h2 {
	font-family: var(--srph-display) !important;
	font-size: 26px !important;
	font-weight: 400;
	margin-bottom: 4px;
	letter-spacing: .01em;
}

#srph-banner .srph-banner__copy p { font-size: 14px; color: var(--srph-ink-soft); }

#srph-banner a.srph-banner__link {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	height: 52px;
	padding: 0 34px !important;
	border: 1px solid var(--srph-ink) !important;
	border-radius: 8px !important;
	background: transparent !important;
	color: var(--srph-ink) !important;
	font-size: 12px;
	letter-spacing: .16em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background .18s ease, color .18s ease;
}

#srph-banner a.srph-banner__link:hover {
	background: var(--srph-ink) !important;
	color: #fff !important;
}

/* =========================================================================
   7. Toast
   ========================================================================= */

body .srph-toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	transform: translate(-50%, 20px);
	background: var(--srph-black);
	color: #fff;
	padding: 13px 22px;
	border-radius: 999px;
	font-family: var(--srph-body);
	font-size: 13px;
	letter-spacing: .03em;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
	z-index: 99999;
}

body .srph-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================================
   8. Responsive
   ========================================================================= */

@media (max-width: 1180px) {
	#srph-cart .srph-cart__layout { grid-template-columns: minmax(0, 1fr) 330px; }
	#srph-cart .srph-panel { padding-inline: 22px; }
	#srph-cart .srph-panel__head,
	#srph-cart .srph-item { grid-template-columns: 76px minmax(0, 1fr) 76px 108px 76px 28px; gap: 14px; }
	#srph-cart .srph-item__media img { width: 76px; height: 76px; }
}

@media (max-width: 980px) {
	#srph-cart .srph-cart__layout { grid-template-columns: 1fr; }
	#srph-cart .srph-cart__aside { position: static; }
	#srph-cart .srph-summary { max-width: 480px; margin-inline: auto; }
}

@media (max-width: 640px) {
	#srph-cart, #srph-crosssells, #srph-banner { padding-inline: 16px; }

	#srph-cart .srph-panel__head { display: none; }
	#srph-cart .srph-panel { padding-inline: 16px; }

	#srph-cart .srph-item {
		grid-template-columns: 72px minmax(0, 1fr) 28px;
		grid-template-areas:
			"media info remove"
			"media price price"
			"media qty   total";
		gap: 6px 14px;
		align-items: start;
	}

	#srph-cart .srph-item__media  { grid-area: media; }
	#srph-cart .srph-item__info   { grid-area: info; }
	#srph-cart .srph-item__price  { grid-area: price; text-align: left; font-size: 14px; color: var(--srph-ink-soft); }
	#srph-cart .srph-item__qty    { grid-area: qty; justify-content: flex-start; margin-top: 6px; }
	#srph-cart .srph-item__total  { grid-area: total; text-align: right; align-self: center; margin-top: 6px; }
	#srph-cart .srph-item__remove { grid-area: remove; }

	#srph-cart .srph-item__media img { width: 72px; height: 72px; }

	#srph-cart .srph-trust { grid-template-columns: 1fr; }
	#srph-cart .srph-trust__item {
		border-right: 0;
		border-bottom: 1px solid var(--srph-line);
		justify-content: flex-start;
		padding: 12px 0;
	}
	#srph-cart .srph-trust__item:last-child { border-bottom: 0; }

	#srph-cart .srph-cart__actions { flex-direction: column; align-items: stretch; }
	#srph-cart .srph-coupon { max-width: none; }

	#srph-banner {
		grid-template-columns: 1fr;
		text-align: center;
		justify-items: center;
		padding: 24px 20px;
	}
	#srph-banner .srph-banner__mark { display: none; }
}

/* =========================================================================
   9. Motion / focus
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
	#srph-cart *, #srph-crosssells *, #srph-banner * {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
	}
}

#srph-cart a:focus-visible,
#srph-cart button:focus-visible,
#srph-crosssells a:focus-visible,
#srph-crosssells button:focus-visible,
#srph-banner a:focus-visible {
	outline: 2px solid var(--srph-accent);
	outline-offset: 3px;
}
