/*
 * Premium Cart Widget for WooCommerce + Elementor
 * All rules are scoped to .wccw-cart — nothing global, no Astra overrides
 * outside the widget. Elementor controls use one extra class level
 * ({{WRAPPER}} .wccw-cart ...) so they always win over these defaults.
 */

/* ---------- Design tokens (overridable from Style > Global Colors) ---------- */
.wccw-cart {
	--wccw-text: #1f4e2c;
	--wccw-heading: #1f4e2c;
	--wccw-muted: #4f6455;
	--wccw-border: rgba(31, 78, 44, 0.14);
	--wccw-soft: #e2ebcf;
	--wccw-summary-bg: #e6eed8;
	--wccw-accent: #f7931e;
	--wccw-accent-hover: #e8820c;
	--wccw-accent-text: #1f4e2c;
	--wccw-progress-bg: #ffffff;
	--wccw-progress-fill: #1f4e2c;
	--wccw-icon: currentColor;
	--wccw-left-w: minmax(0, 1fr);
	--wccw-right-w: minmax(0, 360px);
	--wccw-qty-col: 140px;
	--wccw-total-col: 76px;
	--wccw-btn-lift: 0px;

	position: relative;
	width: 100%;
	box-sizing: border-box;
	color: var(--wccw-text);
	font-size: 16px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
}

.wccw-cart *,
.wccw-cart *::before,
.wccw-cart *::after {
	box-sizing: border-box;
}

.wccw-cart .wccw-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wccw-cart .wccw-icon {
	display: inline-block;
	width: 1em;
	height: 1em;
	flex: 0 0 auto;
	vertical-align: middle;
}

/* Button reset — beats Astra / Elementor kit button styles inside the widget only */
.wccw-cart button.wccw-btn-reset {
	-webkit-appearance: none;
	appearance: none;
	font: inherit;
	letter-spacing: inherit;
	text-transform: none;
	text-shadow: none;
	line-height: inherit;
	margin: 0;
	padding: 0;
	min-height: 0;
	width: auto;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: inherit;
	cursor: pointer;
}

.wccw-cart button.wccw-btn-reset:focus:not(:focus-visible) {
	outline: none;
}

.wccw-cart a:focus-visible,
.wccw-cart button:focus-visible,
.wccw-cart input:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---------- Layout ---------- */
.wccw-cart .wccw-grid {
	display: grid;
	grid-template-columns: var(--wccw-left-w) var(--wccw-right-w);
	column-gap: 28px;
	row-gap: 28px;
	align-items: start;
}

.wccw-cart .wccw-main {
	min-width: 0;
	container-type: inline-size;
	container-name: wccw-main;
}

.wccw-cart .wccw-side {
	min-width: 0;
}

@media (min-width: 1025px) {
	.wccw-sticky-yes .wccw-cart .wccw-side {
		position: sticky;
		top: var(--wccw-sticky-top, 24px);
	}
}

.wccw-cart .wccw-heading {
	margin: 0 0 18px;
	color: var(--wccw-heading);
	font-size: 32px;
	font-weight: 800;
	line-height: 1.15;
}

/* ---------- Table ---------- */
.wccw-cart .wccw-thead,
.wccw-cart .wccw-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--wccw-qty-col) var(--wccw-total-col);
	column-gap: 16px;
	align-items: center;
}

.wccw-cart .wccw-thead {
	padding: 12px 16px;
	border-radius: 12px;
	background-color: var(--wccw-soft);
}

.wccw-cart .wccw-th {
	color: var(--wccw-heading);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.wccw-cart .wccw-th--qty,
.wccw-cart .wccw-item-qty {
	text-align: center;
}

.wccw-cart .wccw-th--total,
.wccw-cart .wccw-item-total {
	text-align: right;
}

.wccw-cart .wccw-items {
	display: flex;
	flex-direction: column;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0;
}

.wccw-cart .wccw-item {
	margin: 0;
	padding: 22px 16px;
	border-bottom: 1px solid var(--wccw-border);
	transition: opacity 0.2s ease, background-color 0.2s ease;
}

.wccw-cart .wccw-item:last-child {
	border-bottom-style: none;
}

.wccw-cart .wccw-item.is-updating .wccw-item-total {
	opacity: 0.45;
}

.wccw-cart .wccw-item.is-removing {
	opacity: 0.4;
	pointer-events: none;
}

.wccw-cart .wccw-item-product {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
}

.wccw-cart .wccw-thumb {
	display: block;
	flex: 0 0 auto;
	width: 84px;
	height: 96px;
	overflow: hidden;
	border-radius: 8px;
	text-decoration: none;
}

.wccw-cart .wccw-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: contain;
	border-radius: 0;
	box-shadow: none;
}

.wccw-cart .wccw-item-info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	min-width: 0;
}

.wccw-cart .wccw-item-name {
	margin: 0;
	color: var(--wccw-heading);
	font-size: 19px;
	font-weight: 700;
	line-height: 1.25;
	word-break: break-word;
}

.wccw-cart .wccw-item-name a {
	color: inherit;
	text-decoration: none;
}

.wccw-cart .wccw-item-name a:hover {
	color: inherit;
	text-decoration: underline;
}

.wccw-cart .wccw-item-meta,
.wccw-cart .wccw-item-desc {
	margin: 0;
	color: var(--wccw-muted);
	font-size: 14px;
	line-height: 1.4;
}

.wccw-cart .wccw-item-desc {
	margin-top: 2px;
}

.wccw-cart .wccw-meta-sep {
	margin: 0 0.35em;
}

.wccw-cart .wccw-item-price {
	margin-top: 4px;
	color: var(--wccw-heading);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.wccw-cart .wccw-item-price del {
	opacity: 0.6;
	font-weight: 500;
	margin-right: 4px;
}

.wccw-cart .wccw-item-price ins {
	text-decoration: none;
	background: none;
}

.wccw-cart button.wccw-remove {
	margin-top: 2px;
	color: var(--wccw-text);
	font-size: 14px;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wccw-cart button.wccw-remove:hover {
	color: var(--wccw-text);
	background: transparent;
	text-decoration-thickness: 2px;
}

.wccw-cart .wccw-item-total {
	color: var(--wccw-heading);
	font-size: 17px;
	font-weight: 700;
	white-space: nowrap;
}

/* ---------- Quantity ---------- */
.wccw-cart .wccw-qty {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 2px;
	height: 40px;
	padding: 4px;
	border-radius: 999px;
	background-color: var(--wccw-soft);
	vertical-align: middle;
}

.wccw-cart button.wccw-qty-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wccw-qty-btn, 32px);
	height: var(--wccw-qty-btn, 32px);
	border-radius: 999px;
	color: var(--wccw-text);
	font-size: 15px;
	transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.wccw-cart button.wccw-qty-btn:hover,
.wccw-cart button.wccw-qty-btn:focus-visible {
	background-color: rgba(31, 78, 44, 0.1);
	color: var(--wccw-text);
}

.wccw-cart button.wccw-qty-btn:active {
	background-color: rgba(31, 78, 44, 0.18);
}

.wccw-cart button.wccw-qty-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	background-color: transparent;
}

.wccw-cart input.wccw-qty-input {
	-webkit-appearance: none;
	-moz-appearance: textfield;
	appearance: textfield;
	width: 32px;
	height: 32px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--wccw-text);
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 32px;
	text-align: center;
}

.wccw-cart input.wccw-qty-input:focus {
	border: 0;
	background: transparent;
	box-shadow: none;
}

.wccw-cart input.wccw-qty-input::-webkit-outer-spin-button,
.wccw-cart input.wccw-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ---------- Continue shopping ---------- */
.wccw-cart .wccw-continue-wrap {
	margin-top: 18px;
}

.wccw-cart .wccw-continue {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--wccw-text);
	font-size: 16px;
	font-weight: 500;
	text-decoration: none;
}

.wccw-cart .wccw-continue-text {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.wccw-cart .wccw-continue:hover {
	color: var(--wccw-text);
}

.wccw-cart .wccw-continue:hover .wccw-continue-text {
	text-decoration-thickness: 2px;
}

.wccw-cart .wccw-continue .wccw-icon,
.wccw-cart .wccw-secure .wccw-icon,
.wccw-cart .wccw-coupon-icon,
.wccw-cart .wccw-empty-icon {
	color: var(--wccw-icon);
}

/* ---------- Order summary ---------- */
.wccw-cart .wccw-summary {
	padding: 22px 20px 20px;
	border-radius: 16px;
	background-color: var(--wccw-summary-bg);
}

.wccw-cart .wccw-summary-title {
	margin: 0 0 18px;
	color: var(--wccw-heading);
	font-size: 30px;
	font-weight: 800;
	line-height: 1.1;
}

.wccw-cart .wccw-rows {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 0 0 16px;
	border-bottom: 1px solid var(--wccw-border);
}

.wccw-cart .wccw-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.wccw-cart .wccw-row-label {
	font-size: 15px;
	line-height: 1.35;
}

.wccw-cart .wccw-row-value {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	text-align: right;
}

.wccw-cart .wccw-delivery-value {
	max-width: 9.5em;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.3;
}

.wccw-cart .wccw-before,
.wccw-cart .wccw-total-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.wccw-cart .wccw-before {
	padding: 16px 0 18px;
}

.wccw-cart .wccw-before-label {
	max-width: 10em;
	color: var(--wccw-heading);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
}

.wccw-cart .wccw-before-value {
	color: var(--wccw-heading);
	font-size: 26px;
	font-weight: 800;
	line-height: 1.1;
	white-space: nowrap;
}

.wccw-cart .wccw-total-row {
	margin: -6px 0 18px;
	font-size: 17px;
	font-weight: 700;
}

/* ---------- Free delivery ---------- */
.wccw-cart .wccw-free {
	margin: 0 0 20px;
}

.wccw-cart .wccw-free-msg {
	margin: 0 0 12px;
	font-size: 16px;
	line-height: 1.4;
}

.wccw-cart .wccw-progress {
	height: 14px;
	overflow: hidden;
	border-radius: 999px;
	background-color: var(--wccw-progress-bg);
}

.wccw-cart .wccw-progress-fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background-color: var(--wccw-progress-fill);
	transition: width 0.45s ease;
}

/* ---------- Checkout button ---------- */
.wccw-cart .wccw-checkout-wrap {
	display: flex;
	justify-content: center;
}

.wccw-cart a.wccw-checkout-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 50px;
	padding: 12px 24px;
	border: 0 solid transparent;
	border-radius: 999px;
	background-color: var(--wccw-accent);
	color: var(--wccw-accent-text);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transform: translateY(0);
	transition-property: background-color, color, border-color, box-shadow, transform;
	transition-duration: 0.2s;
	transition-timing-function: ease;
}

.wccw-cart a.wccw-checkout-btn:hover,
.wccw-cart a.wccw-checkout-btn:focus-visible {
	background-color: var(--wccw-accent-hover);
	color: var(--wccw-accent-text);
	transform: translateY(var(--wccw-btn-lift));
}

.wccw-cart a.wccw-checkout-btn:active {
	transform: translateY(0);
}

.wccw-cart .wccw-checkout-btn .wccw-icon {
	font-size: 18px;
}

.wccw-cart .wccw-secure {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 16px 0 0;
	font-size: 15px;
	line-height: 1.3;
}

.wccw-cart .wccw-secure .wccw-icon {
	font-size: 18px;
}

/* ---------- Discount code ---------- */
.wccw-cart .wccw-coupon {
	margin-top: 16px;
	overflow: hidden;
	border: 1.5px solid rgba(31, 78, 44, 0.28);
	border-radius: 14px;
	background-color: transparent;
}

.wccw-cart button.wccw-coupon-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 16px 18px;
	color: var(--wccw-heading);
	text-align: left;
}

.wccw-cart button.wccw-coupon-toggle:hover {
	color: var(--wccw-heading);
	background: transparent;
}

.wccw-cart .wccw-coupon-heading {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

.wccw-cart .wccw-coupon-icon {
	display: inline-flex;
	font-size: 22px;
}

.wccw-cart .wccw-coupon-icon .wccw-plus-v {
	transform-box: fill-box;
	transform-origin: center;
	transition: transform 0.25s ease;
}

.wccw-cart .wccw-coupon.is-open .wccw-coupon-icon .wccw-plus-v {
	transform: scaleY(0);
}

.wccw-cart .wccw-coupon-panel {
	display: grid;
	grid-template-rows: 0fr;
	visibility: hidden;
	transition: grid-template-rows 0.25s ease, visibility 0s linear 0.25s;
}

.wccw-cart .wccw-coupon.is-open .wccw-coupon-panel {
	grid-template-rows: 1fr;
	visibility: visible;
	transition: grid-template-rows 0.25s ease, visibility 0s linear 0s;
}

.wccw-cart .wccw-coupon.no-anim .wccw-coupon-panel,
.wccw-cart .wccw-coupon.no-anim .wccw-plus-v {
	transition: none;
}

.wccw-cart .wccw-coupon-panel-inner {
	min-height: 0;
	overflow: hidden;
}

.wccw-cart .wccw-coupon-body {
	padding: 0 18px 18px;
}

.wccw-cart .wccw-coupon-form {
	display: flex;
	gap: 8px;
	margin: 0;
}

.wccw-cart input.wccw-coupon-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0 14px;
	border: 1.5px solid rgba(31, 78, 44, 0.28);
	border-radius: 10px;
	background-color: #ffffff;
	box-shadow: none;
	color: var(--wccw-text);
	font: inherit;
	font-size: 15px;
	line-height: normal;
}

.wccw-cart input.wccw-coupon-input:focus {
	border-color: var(--wccw-text);
	background-color: #ffffff;
	box-shadow: none;
	outline: none;
}

.wccw-cart input.wccw-coupon-input::placeholder {
	color: var(--wccw-muted);
	opacity: 0.8;
}

.wccw-cart button.wccw-coupon-apply {
	flex: 0 0 auto;
	height: 44px;
	padding: 0 18px;
	border: 1.5px solid var(--wccw-heading);
	border-radius: 10px;
	background-color: var(--wccw-heading);
	color: #ffffff;
	font-size: 15px;
	font-weight: 700;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.wccw-cart button.wccw-coupon-apply:focus {
	background-color: var(--wccw-heading);
	color: #ffffff;
}

.wccw-cart button.wccw-coupon-apply:hover,
.wccw-cart button.wccw-coupon-apply:focus-visible {
	background-color: transparent;
	color: var(--wccw-heading);
}

.wccw-cart .wccw-coupon-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
}

.wccw-cart .wccw-coupon-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 5px 8px 5px 12px;
	border-radius: 999px;
	background-color: var(--wccw-soft);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.wccw-cart button.wccw-coupon-remove {
	display: inline-flex;
	padding: 2px;
	border-radius: 999px;
	font-size: 14px;
}

.wccw-cart button.wccw-coupon-remove:hover {
	background-color: rgba(31, 78, 44, 0.12);
	color: inherit;
}

/* ---------- Notices ---------- */
.wccw-cart .wccw-notices:empty {
	display: none;
}

.wccw-cart .wccw-notices {
	margin-bottom: 16px;
}

.wccw-cart .wccw-notice {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 8px;
	padding: 12px 14px;
	border: 1px solid;
	border-radius: 10px;
	font-size: 15px;
	line-height: 1.4;
}

.wccw-cart .wccw-notice--success {
	background-color: #eaf5e4;
	border-color: #b9dcae;
	color: #1f4e2c;
}

.wccw-cart .wccw-notice--error {
	background-color: #fdecea;
	border-color: #f1bdb5;
	color: #8a1c12;
}

.wccw-cart .wccw-notice--info {
	background-color: #eef3fb;
	border-color: #c6d4ee;
	color: #1d3c6e;
}

.wccw-cart .wccw-notice a,
.wccw-cart button.wccw-undo {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
}

.wccw-cart button.wccw-undo:hover {
	color: inherit;
	background: transparent;
}

.wccw-cart button.wccw-notice-close {
	display: inline-flex;
	flex: 0 0 auto;
	padding: 2px;
	font-size: 16px;
	opacity: 0.7;
}

.wccw-cart button.wccw-notice-close:hover {
	opacity: 1;
	color: inherit;
	background: transparent;
}

/* ---------- Empty cart ---------- */
.wccw-cart .wccw-empty {
	padding: 56px 24px;
	border-radius: 16px;
	background-color: var(--wccw-summary-bg);
	text-align: center;
}

.wccw-cart .wccw-empty-icon {
	display: inline-flex;
	margin-bottom: 14px;
	font-size: 60px;
}

.wccw-cart .wccw-empty-title {
	margin: 0 0 8px;
	color: var(--wccw-heading);
	font-size: 28px;
	font-weight: 800;
	line-height: 1.2;
}

.wccw-cart .wccw-empty-text {
	margin: 0 0 22px;
	color: var(--wccw-muted);
}

.wccw-cart .wccw-empty-text p {
	margin: 0;
}

.wccw-cart a.wccw-empty-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 30px;
	border: 0 solid transparent;
	border-radius: 999px;
	background-color: var(--wccw-accent);
	color: var(--wccw-accent-text);
	font-weight: 700;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wccw-cart a.wccw-empty-btn:hover,
.wccw-cart a.wccw-empty-btn:focus-visible {
	background-color: var(--wccw-accent-hover);
	color: var(--wccw-accent-text);
}

.wccw-cart .wccw-unavailable {
	margin: 0;
}

/* ---------- Loading ---------- */
.wccw-cart .wccw-loader {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.35);
	border-radius: inherit;
}

.wccw-cart.is-loading .wccw-loader {
	display: flex;
}

.wccw-cart.is-loading .wccw-inner {
	pointer-events: none;
}

.wccw-cart .wccw-spinner {
	width: 30px;
	height: 30px;
	border: 3px solid rgba(31, 78, 44, 0.18);
	border-top-color: var(--wccw-text);
	border-radius: 50%;
	animation: wccw-spin 0.7s linear infinite;
}

@keyframes wccw-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- Responsive ---------- */

/* Fallback if Elementor's generated CSS is missing: stack below desktop. */
@media (max-width: 1024px) {
	.wccw-cart .wccw-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/*
 * Product rows re-arrange based on the width of the cart column itself
 * (works inside any Elementor column width), with a viewport fallback.
 */
@container wccw-main (max-width: 560px) {
	.wccw-cart .wccw-thead {
		display: none;
	}

	.wccw-cart .wccw-item {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"product product"
			"qty total";
		row-gap: 14px;
		padding-left: 0;
		padding-right: 0;
	}

	.wccw-cart .wccw-item-product {
		grid-area: product;
		align-items: flex-start;
	}

	.wccw-cart .wccw-item-qty {
		grid-area: qty;
		text-align: left;
	}

	.wccw-cart .wccw-item-total {
		grid-area: total;
		text-align: right;
	}

	.wccw-cart .wccw-thumb {
		width: 72px;
		height: 84px;
	}

	.wccw-cart .wccw-item-name {
		font-size: 17px;
	}
}

@supports not (container-type: inline-size) {
	@media (max-width: 600px) {
		.wccw-cart .wccw-thead {
			display: none;
		}

		.wccw-cart .wccw-item {
			grid-template-columns: minmax(0, 1fr) auto;
			grid-template-areas:
				"product product"
				"qty total";
			row-gap: 14px;
			padding-left: 0;
			padding-right: 0;
		}

		.wccw-cart .wccw-item-product {
			grid-area: product;
		}

		.wccw-cart .wccw-item-qty {
			grid-area: qty;
			text-align: left;
		}

		.wccw-cart .wccw-item-total {
			grid-area: total;
		}
	}
}

@media (max-width: 480px) {
	.wccw-cart .wccw-summary {
		padding: 18px 16px;
	}

	.wccw-cart .wccw-summary-title {
		font-size: 26px;
	}

	.wccw-cart .wccw-before-value {
		font-size: 22px;
	}

	.wccw-cart .wccw-coupon-form {
		flex-wrap: wrap;
	}

	.wccw-cart button.wccw-coupon-apply {
		flex: 1 1 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wccw-cart *,
	.wccw-cart *::before,
	.wccw-cart *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}