/* =========================================================
   dd-theme — Cart page styles
   Ported from mockup cart-checkout.jsx Cart component.
   Uses design tokens from variables.css.
   ========================================================= */

/* ---------------------------------------------------------
   Layout: 2-column grid (items + sidebar)
   --------------------------------------------------------- */

.dd-cart {
	display: grid;
	grid-template-columns: 1.6fr 1fr;
	gap: 40px;
	padding-top: 20px;
	padding-bottom: 60px;
}

/* ---------------------------------------------------------
   Cart header (breadcrumb + heading)
   --------------------------------------------------------- */

.dd-cart-breadcrumb {
	font-size: 12.5px;
	color: var(--muted);
	margin-bottom: 14px;
}

.dd-cart-breadcrumb strong {
	color: var(--ink-1);
	font-weight: 600;
}

.dd-cart-title {
	font-family: var(--serif);
	font-weight: 500;
	color: var(--ink-1);
	margin: 0;
}

.dd-cart-subtitle {
	margin-top: 8px;
	color: var(--ink-soft);
	font-size: 15px;
}

/* ---------------------------------------------------------
   Cart items container
   --------------------------------------------------------- */

.dd-cart-items {
	margin-top: 24px;
	border: 1px solid var(--hair);
	border-radius: var(--radius);
	background: var(--cream);
	overflow: hidden;
}

/* ---------------------------------------------------------
   Individual cart item
   --------------------------------------------------------- */

.dd-cart-item {
	display: grid;
	grid-template-columns: 140px 1fr auto;
	gap: 20px;
	padding: 18px 22px;
	border-top: 1px solid var(--hair);
	align-items: center;
}

.dd-cart-item.dd-cart-item--first {
	border-top: 0;
}

/* Thumbnail */
.dd-cart-item-thumb {
	border-radius: var(--radius-s);
	overflow: hidden;
	position: relative;
	aspect-ratio: 4 / 3;
}

.dd-cart-item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.dd-cart-item-thumb a {
	display: block;
}

/* Details */
.dd-cart-item-details {
	min-width: 0;
}

.dd-cart-item-name {
	margin: 4px 0 0;
	font-size: 17px;
	font-weight: 700;
	color: var(--ink);
	line-height: 1.3;
}

.dd-cart-item-name a {
	color: inherit;
	text-decoration: none;
}

.dd-cart-item-name a:hover {
	color: var(--ink-1);
}

/* Price column */
.dd-cart-item-price {
	text-align: right;
	white-space: nowrap;
}

.dd-cart-item-price .woocommerce-Price-amount {
	font-family: var(--sans);
	font-weight: 800;
	font-size: 22px;
	color: var(--ink-1);
}

.dd-cart-item-original {
	display: block;
	color: var(--muted-2);
	font-size: 13px;
	margin-top: 2px;
}

/* Remove link */
.dd-cart-remove {
	margin-top: 10px;
}

.dd-cart-remove-link {
	background: none;
	border: 0;
	color: var(--muted);
	font-size: 13px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	transition: color 0.2s ease;
}

.dd-cart-remove-link:hover {
	color: var(--danger);
}

.dd-cart-remove-link svg {
	flex-shrink: 0;
}

/* Cart actions (hidden update button + nonce) */
.dd-cart-actions {
	padding: 12px 22px;
}

/* ---------------------------------------------------------
   Cart summary sidebar
   --------------------------------------------------------- */

.dd-cart-sidebar-sticky {
	position: sticky;
	top: 160px;
}

.dd-cart-summary {
	padding: 28px;
	border: 1px solid var(--hair);
	border-radius: var(--radius);
	background: var(--cream);
}

.dd-cart-summary-heading {
	font-family: var(--serif);
	font-weight: 500;
	font-size: 24px;
	color: var(--ink-1);
	margin: 0;
}

.dd-cart-summary-rows {
	margin-top: 20px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	font-size: 14px;
}

.dd-cart-summary-row {
	display: flex;
	justify-content: space-between;
	color: var(--ink-soft);
}

.dd-cart-summary-discount {
	color: var(--terracotta);
}

.dd-cart-summary-iva {
	color: var(--ink-soft);
}

.dd-cart-summary-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding-top: 14px;
	border-top: 1px solid var(--hair);
}

.dd-cart-summary-total .dd-cart-summary-label {
	font-weight: 700;
	color: var(--ink);
}

.dd-cart-summary-total-amount {
	font-weight: 800;
	font-size: 32px;
	color: var(--ink-1);
	letter-spacing: -0.02em;
}

.dd-cart-summary-total-amount .woocommerce-Price-amount {
	font-weight: 800;
	font-size: 32px;
}

/* Coupon input */
.dd-cart-coupon {
	display: flex;
	gap: 8px;
	margin-top: 20px;
}

.dd-cart-coupon .input {
	flex: 1;
	font-size: 13px;
}

/* Checkout CTA */
.dd-cart-checkout-btn {
	width: 100%;
	margin-top: 18px;
	justify-content: center;
	text-decoration: none;
}

/* Trust signals */
.dd-cart-trust {
	border-top: 1px solid var(--hair);
	margin-top: 20px;
	padding-top: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 12.5px;
	color: var(--muted);
}

.dd-cart-trust-item {
	display: flex;
	gap: 8px;
	align-items: flex-start;
}

.dd-cart-trust-icon {
	flex-shrink: 0;
	color: var(--ink-1);
}

.dd-cart-trust-icon--success {
	color: var(--success);
}

/* Hide WC default proceed button (we have our own styled one) */
.dd-cart-summary .wc-proceed-to-checkout .checkout-button {
	display: none;
}

/* ---------------------------------------------------------
   Empty cart
   --------------------------------------------------------- */

.dd-cart-empty {
	max-width: 680px;
	margin: 0 auto;
	text-align: center;
	padding: 60px 20px;
}

.dd-cart-empty-heading {
	margin-top: 14px;
	font-family: var(--serif);
	font-weight: 500;
	color: var(--ink-1);
}

.dd-cart-empty-text {
	margin-top: 14px;
	color: var(--ink-soft);
	line-height: 1.6;
}

.dd-cart-empty-cta {
	margin-top: 24px;
	display: inline-flex;
	text-decoration: none;
}

/* ---------------------------------------------------------
   Recommended courses
   Direct child of the .dd-cart grid (moved out of .dd-cart-main
   so it can be reordered below the checkout button on mobile).
   On desktop it stays in the left column, row 2 — the grid gap
   provides the separation, so no extra margin-top is needed.
   --------------------------------------------------------- */

.dd-cart-recommended {
	grid-column: 1;
}

.dd-cart-recommended-heading {
	font-family: var(--serif);
	font-weight: 500;
	font-size: 24px;
	color: var(--ink-1);
	margin: 0 0 18px;
}

.dd-cart-recommended-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

/* ---------------------------------------------------------
   Responsive: tablet (<=820px)
   --------------------------------------------------------- */

@media (max-width: 820px) {
	.dd-cart {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.dd-cart-sidebar-sticky {
		position: static;
	}

	/* Reorder the single-column stack so the checkout button (sidebar)
	   comes right after the cart items and BEFORE the recommended
	   courses: items → Finalizar compra → recomendados. */
	.dd-cart-main {
		order: 1;
	}

	.dd-cart-sidebar {
		order: 2;
	}

	.dd-cart-recommended {
		order: 3;
		grid-column: auto;
		margin-top: 8px;
	}

	.dd-cart-recommended-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}

/* ---------------------------------------------------------
   Responsive: small mobile (<=540px)
   --------------------------------------------------------- */

@media (max-width: 540px) {
	.dd-cart-item {
		grid-template-columns: 1fr auto;
		gap: 12px;
	}

	.dd-cart-item-thumb {
		display: none;
	}

	.dd-cart-summary {
		padding: 20px;
	}

	.dd-cart-summary-total-amount,
	.dd-cart-summary-total-amount .woocommerce-Price-amount {
		font-size: 26px;
	}
}

/* ---------------------------------------------------------
   Remove link — neutralize WooCommerce core a.remove glyph
   --------------------------------------------------------- */

/* WC core styles a.remove as a small round red "×" button. That leaks into our
   editorial remove link and breaks its layout. Scope an override to our link so
   the .dd-cart-remove-link editorial look wins (WC core uses !important on some
   of these, so we match it). */
.dd-cart-item a.remove.dd-cart-remove-link {
	width: auto !important;
	height: auto !important;
	line-height: 1 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	color: var(--muted) !important;
	font-size: 13px !important;
	font-weight: 400 !important;
	text-align: left !important;
	text-decoration: none !important;
}
.dd-cart-item a.remove.dd-cart-remove-link:hover {
	background: none !important;
	color: var(--danger) !important;
}

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

.dd-cart-coupon-label {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--ink);
}
