/* ==========================================================================
   EBB WooCommerce Cart (EBB) — responsive layouts
   Mobile-first base + 3 desktop layouts. All colors/spacing are overridable
   by the Elementor style controls; values here are sensible defaults.
   ========================================================================== */

.ebb-cart {
	width: 100%;
	box-sizing: border-box;
}
.ebb-cart *,
.ebb-cart *::before,
.ebb-cart *::after {
	box-sizing: border-box;
}

.ebb-cart-form {
	margin: 0;
}

/* Loading state while an AJAX cart action is in-flight */
.ebb-cart-main {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 30px;
	transition: opacity 0.2s ease;
}
.ebb-cart.is-loading .ebb-cart-main {
	opacity: 0.55;
	pointer-events: none;
}

/* Native "Update cart" fallback button is hidden — quantities update via AJAX.
   It stays in the DOM so no-JS visitors still get a working cart. */
.ebb-cart-form > input[name="update_cart"] {
	display: none;
}

/* ----- Notices ----------------------------------------------------------- */
.ebb-cart-notices:empty {
	display: none;
}
.ebb-cart-notices .woocommerce-message,
.ebb-cart-notices .woocommerce-info,
.ebb-cart-notices .woocommerce-error {
	margin: 0 0 24px;
	border-radius: 8px;
}

/* ----- Column header ----------------------------------------------------- */
.ebb-cart-items-head {
	display: none;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.65;
}

/* ----- Items list -------------------------------------------------------- */
.ebb-cart-items {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* Mobile-first item card */
.ebb-cart-item {
	display: grid;
	grid-template-columns: auto 1fr auto;
	grid-template-areas:
		"media info remove"
		"media qty  subtotal";
	align-items: center;
	column-gap: 14px;
	row-gap: 12px;
	padding: 16px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 12px;
	background: transparent;
}

.ebb-cart-item-media { grid-area: media; align-self: start; }
.ebb-cart-item-media a { display: block; line-height: 0; }
.ebb-cart-item-media img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 8px;
	display: block;
}

.ebb-cart-item-info { grid-area: info; min-width: 0; }
.ebb-cart-item-title {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 4px;
}
.ebb-cart-item-title a { text-decoration: none; color: inherit; }
.ebb-cart-item-meta {
	font-size: 12px;
	opacity: 0.7;
	line-height: 1.4;
}
.ebb-cart-item-meta p { margin: 0; }

/* Two price nodes exist: an inline one for compact layouts, a column one for
   the table layout. Show the inline one by default, hide the column one. */
.ebb-cart-item-price.is-mobile {
	display: block;
	margin-top: 4px;
	font-size: 14px;
	font-weight: 600;
}
.ebb-cart-item-price:not(.is-mobile) { display: none; }

.ebb-cart-item-qty { grid-area: qty; }
.ebb-cart-item-subtotal {
	grid-area: subtotal;
	text-align: right;
	font-weight: 700;
	font-size: 15px;
	white-space: nowrap;
}

.ebb-cart-item-remove { grid-area: remove; align-self: start; text-align: right; }
.ebb-cart-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	text-decoration: none;
	color: #c0392b;
	transition: background 0.2s ease, color 0.2s ease;
}
.ebb-cart-remove:hover {
	background: rgba(192, 57, 43, 0.1);
	color: #c0392b;
}

/* ----- Quantity stepper -------------------------------------------------- */
.ebb-cart-qty-stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	height: 38px;
}
.ebb-cart-qty-btn {
	width: 34px;
	height: 100%;
	border: 0;
	background: transparent;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}
.ebb-cart-qty-btn:hover { background: rgba(0, 0, 0, 0.05); }
.ebb-cart-qty-input {
	width: 40px;
	height: 100%;
	border: 0;
	text-align: center;
	background: transparent;
	font-size: 14px;
	font-weight: 600;
	color: #222;
	-moz-appearance: textfield;
	appearance: textfield;
	padding: 0;
}
.ebb-cart-qty-input::-webkit-outer-spin-button,
.ebb-cart-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ----- Summary / totals -------------------------------------------------- */
.ebb-cart-summary {
	padding: 24px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.02);
}
.ebb-cart-summary-title {
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 700;
}
.ebb-cart-summary-rows { margin-bottom: 18px; }
.ebb-cart-summary-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	font-size: 14px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}
.ebb-cart-summary-row .value { font-weight: 600; text-align: right; }
.ebb-cart-summary-row.is-total {
	border-bottom: 0;
	padding-top: 14px;
	font-size: 17px;
	font-weight: 700;
}
.ebb-cart-summary-row.is-total .value { font-weight: 800; }
.ebb-cart-summary-row .woocommerce-remove-coupon {
	font-size: 11px;
	margin-left: 8px;
	text-decoration: underline;
}

/* Coupon */
.ebb-cart-coupon {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
}
.ebb-cart-coupon-input {
	flex: 1;
	min-width: 0;
	height: 44px;
	padding: 0 14px;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	font-size: 14px;
}
.ebb-cart-coupon-btn {
	flex: 0 0 auto;
	height: 44px;
	padding: 0 18px;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	background: #2c3e50;
	color: #fff;
}

/* Checkout button */
.ebb-cart-checkout-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 15px 20px;
	border: 0;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	text-decoration: none;
	text-align: center;
	cursor: pointer;
	transition: filter 0.2s ease, background 0.2s ease;
}

/* ----- Empty state ------------------------------------------------------- */
.ebb-cart-empty {
	text-align: center;
	padding: 50px 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}
.ebb-cart-empty-icon { font-size: 54px; opacity: 0.4; }
.ebb-cart-empty-text { font-size: 16px; font-weight: 600; opacity: 0.8; margin: 0; }
.ebb-cart-empty .ebb-cart-checkout-btn { width: auto; padding: 12px 28px; }

/* ==========================================================================
   DESKTOP (>= 768px)
   ========================================================================== */
@media (min-width: 768px) {

	/* ---------- Layout 1 — Modern Table ---------- */
	.ebb-cart--layout-1 .ebb-cart-items-head {
		display: grid;
		grid-template-columns: 72px minmax(0, 2.2fr) 1fr 1.4fr 1fr 44px;
		align-items: center;
		gap: 16px;
		padding: 0 16px 12px;
	}
	.ebb-cart--layout-1 .ebb-cart-items-head .col-product { grid-column: 1 / 3; }
	.ebb-cart--layout-1 .ebb-cart-items-head .col-price { text-align: left; }
	.ebb-cart--layout-1 .ebb-cart-items-head .col-qty { text-align: center; }
	.ebb-cart--layout-1 .ebb-cart-items-head .col-subtotal { text-align: right; }

	.ebb-cart--layout-1 .ebb-cart-item {
		grid-template-columns: 72px minmax(0, 2.2fr) 1fr 1.4fr 1fr 44px;
		grid-template-areas: "media info price qty subtotal remove";
		column-gap: 16px;
		row-gap: 0;
	}
	.ebb-cart--layout-1 .ebb-cart-item-media { grid-area: media; align-self: center; }
	.ebb-cart--layout-1 .ebb-cart-item-info { grid-area: info; }
	.ebb-cart--layout-1 .ebb-cart-item-price:not(.is-mobile) {
		grid-area: price;
		display: block;
		font-weight: 600;
	}
	.ebb-cart--layout-1 .ebb-cart-item-price.is-mobile { display: none; }
	.ebb-cart--layout-1 .ebb-cart-item-qty { grid-area: qty; display: flex; justify-content: center; }
	.ebb-cart--layout-1 .ebb-cart-item-subtotal { grid-area: subtotal; }
	.ebb-cart--layout-1 .ebb-cart-item-remove { grid-area: remove; align-self: center; }
	.ebb-cart--layout-1 .ebb-cart-summary { max-width: 420px; margin-left: auto; }

	/* ---------- Layout 2 — Two Column (summary sidebar) ---------- */
	.ebb-cart--layout-2 .ebb-cart-main {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 350px;
		align-items: start;
		gap: 40px;
	}
	.ebb-cart--layout-2 .ebb-cart-items-head { display: none; }
	.ebb-cart--layout-2 .ebb-cart-item {
		grid-template-columns: 72px minmax(0, 1fr) auto auto 44px;
		grid-template-areas: "media info qty subtotal remove";
		align-items: center;
		column-gap: 18px;
		row-gap: 0;
		border: 0;
		border-bottom: 1px solid rgba(0, 0, 0, 0.08);
		border-radius: 0;
		padding: 18px 4px;
	}
	.ebb-cart--layout-2 .ebb-cart-items { gap: 0; }
	.ebb-cart--layout-2 .ebb-cart-item-info { grid-area: info; }
	.ebb-cart--layout-2 .ebb-cart-item-qty { grid-area: qty; }
	.ebb-cart--layout-2 .ebb-cart-item-subtotal { grid-area: subtotal; min-width: 84px; }
	.ebb-cart--layout-2 .ebb-cart-item-remove { grid-area: remove; align-self: center; }
	.ebb-cart--layout-2 .ebb-cart-summary.is-sticky {
		position: sticky;
		top: 30px;
	}

	/* ---------- Layout 3 — Modern Cards ---------- */
	.ebb-cart--layout-3 .ebb-cart-items-head { display: none; }
	.ebb-cart--layout-3 .ebb-cart-items { gap: 16px; }
	.ebb-cart--layout-3 .ebb-cart-item {
		grid-template-columns: 88px minmax(0, 2fr) 1.2fr auto 44px;
		grid-template-areas: "media info qty subtotal remove";
		align-items: center;
		column-gap: 20px;
		row-gap: 0;
		padding: 18px 22px;
		border: 1px solid rgba(0, 0, 0, 0.06);
		border-radius: 16px;
		box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
		background: #fff;
	}
	.ebb-cart--layout-3 .ebb-cart-item-media img { width: 88px; height: 88px; }
	.ebb-cart--layout-3 .ebb-cart-item-info { grid-area: info; }
	.ebb-cart--layout-3 .ebb-cart-item-qty { grid-area: qty; display: flex; justify-content: center; }
	.ebb-cart--layout-3 .ebb-cart-item-subtotal { grid-area: subtotal; min-width: 84px; }
	.ebb-cart--layout-3 .ebb-cart-item-remove { grid-area: remove; align-self: center; }
	/* Rounded pill stepper to match the card aesthetic */
	.ebb-cart--layout-3 .ebb-cart-qty-stepper { border-radius: 40px; height: 40px; }
	.ebb-cart--layout-3 .ebb-cart-summary {
		max-width: 460px;
		margin-left: auto;
	}
}

/* Larger tablets refine the single-column layouts a touch */
@media (min-width: 768px) and (max-width: 1024px) {
	.ebb-cart--layout-2 .ebb-cart-main {
		grid-template-columns: minmax(0, 1fr) 300px;
		gap: 28px;
	}
}
