/*
 * Cart page — mobile first. Loaded only on the cart page (inc/cart-layout.php).
 * Base styles are the phone layout; 640px and 1024px add room.
 */

.ttg-cart {
	--ttg-ink: #17394f;
	--ttg-muted: #566876;
	--ttg-line: #dde6ec;
	--ttg-soft: #f4f7f9;
	--ttg-accent: #0370af;
	--ttg-accent-dark: #075b89;
	--ttg-navy: #3b4684;
	--ttg-navy-dark: #2e376a;
	--ttg-ok: #157a3a;
	--ttg-danger: #b42318;
	--ttg-radius: 14px;
	--ttg-focus: 0 0 0 3px #fff, 0 0 0 5px var(--ttg-accent);

	color: var(--ttg-ink);
	font-size: 15px;
	line-height: 1.45;
}
.ttg-cart *, .ttg-cart *::before, .ttg-cart *::after { box-sizing: border-box; }
.ttg-cart .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
.ttg-cart__default-submit {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; border: 0;
	opacity: 0;
	pointer-events: none;
}
.ttg-icon { flex: none; width: 18px; height: 18px; }

/* Focus: one visible ring for every control. */
.ttg-cart a:focus-visible,
.ttg-cart button:focus-visible,
.ttg-cart summary:focus-visible,
.ttg-cart input:focus-visible,
.ttg-cart .checkout-button:focus-visible {
	outline: none;
	box-shadow: var(--ttg-focus);
	border-radius: 10px;
}

/* ---------- Header ---------- */
.ttg-cart__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin: 0 0 18px;
}
.ttg-cart .ttg-cart__title {
	margin: 0;
	color: var(--ttg-ink);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
}
.ttg-cart__count {
	padding: 4px 11px;
	border-radius: 999px;
	background: #e9eff3;
	color: var(--ttg-ink);
	font-size: 14px;
	font-weight: 600;
}
.ttg-cart__continue {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-basis: 100%;
	min-height: 44px;
	color: var(--ttg-accent);
	font-weight: 600;
	text-decoration: none;
}
.ttg-cart__continue:hover { color: var(--ttg-accent-dark); text-decoration: underline; }

/* ---------- Layout ---------- */
.ttg-cart__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.ttg-cart .ttg-cart__body > .woocommerce-cart-form,
.ttg-cart .ttg-cart__body > .cart-collaterals,
.ttg-cart .ttg-cart__body > .cart-collaterals .cart_totals {
	float: none;
	width: auto;
	max-width: none;
	margin: 0;
	padding: 0;
}
.ttg-cart .ttg-cart__body > .cart-collaterals .cart_totals.ttg-summary { padding: 18px; }
.ttg-cart .ttg-cart__form { position: relative; min-width: 0; }

/* ---------- Line cards ---------- */
.ttg-cart .ttg-cart__items {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ttg-cart .ttg-line { margin: 0; padding: 0; list-style: none; }
.ttg-cart .ttg-line::before { content: none; }
.ttg-line__card {
	display: grid;
	grid-template-columns: 104px minmax(0, 1fr);
	grid-template-areas:
		"media head"
		"specs specs"
		"proofs proofs"
		"actions actions";
	gap: 14px 14px;
	padding: 14px;
	border: 1px solid var(--ttg-line);
	border-radius: var(--ttg-radius);
	background: #fff;
	box-shadow: 0 1px 2px rgba(23, 57, 79, 0.05);
	transition: opacity 0.2s;
}
.ttg-line.is-updating .ttg-line__card { opacity: 0.55; }

.ttg-line__media { grid-area: media; }
.ttg-line__media a { display: block; }
.ttg-line__media img {
	display: block;
	width: 100% !important;
	height: auto !important;
	max-width: none;
	aspect-ratio: 1;
	margin: 0;
	padding: 4px;
	border: 1px solid var(--ttg-line);
	border-radius: 10px;
	background: var(--ttg-soft);
	object-fit: contain;
}

.ttg-line__head { grid-area: head; min-width: 0; }
.ttg-cart .ttg-line__name {
	margin: 0 0 4px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	overflow-wrap: anywhere;
}
.ttg-cart .ttg-line__name a { color: var(--ttg-ink); text-decoration: none; }
.ttg-cart .ttg-line__name a:hover { color: var(--ttg-accent); text-decoration: underline; }
.ttg-cart .ttg-line__price { display: flex; flex-direction: column; margin: 0; }
.ttg-line__total { font-size: 19px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.ttg-line__qty-summary { color: var(--ttg-muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* Options: label/value rows on phones, flowing chips when there is room. */
.ttg-cart .ttg-specs {
	grid-area: specs;
	display: grid;
	gap: 7px;
	margin: 0;
	padding: 0;
}
.ttg-spec {
	display: grid;
	grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
	gap: 10px;
	align-items: start;
}
.ttg-cart .ttg-spec dt {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	color: var(--ttg-muted);
	font-size: 14px;
	font-weight: 400;
}
.ttg-cart .ttg-spec dt .ttg-icon { color: var(--ttg-accent); }
.ttg-cart .ttg-spec dd {
	margin: 0;
	color: var(--ttg-ink);
	font-size: 14px;
	font-weight: 600;
	overflow-wrap: anywhere;
}

/* Approved proofs row */
.ttg-line__proofs {
	grid-area: proofs;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding: 12px;
	border-radius: 12px;
	background: var(--ttg-soft);
}
.ttg-cart .ttg-proof-customer--cart {
	--ttg-proof-customer-thumb-size: 42px;
	display: flex;
	flex: 1 1 100%;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 12px;
	margin: 0;
	font-size: 13px;
}
.ttg-cart .ttg-proof-customer--cart .ttg-proof-customer__title {
	display: inline-flex;
	flex: 1 1 100%;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: var(--ttg-ink);
	font-size: 14px;
	font-weight: 700;
}
.ttg-cart .ttg-proof-customer--cart .ttg-proof-customer__title::before {
	content: "";
	flex: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--ttg-ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5.8 10.3 2.7 2.7 5.7-6' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.ttg-cart .ttg-proof-customer--cart .ttg-proof-customer__list { flex: 1 1 100%; flex-wrap: nowrap; gap: 10px; }
.ttg-cart .ttg-proof-customer--cart .ttg-proof-customer__item { flex: 1 1 0; min-width: 0; }
.ttg-cart .ttg-proof-customer--cart .ttg-proof-customer__link {
	gap: 9px;
	min-height: 52px;
	padding: 4px 10px 4px 4px;
	border: 1px solid var(--ttg-line);
	border-radius: 10px;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.ttg-cart .ttg-proof-customer--cart .ttg-proof-customer__link:hover { border-color: #a9c1d1; box-shadow: 0 2px 6px rgba(23, 57, 79, 0.08); }
.ttg-cart .ttg-proof-customer--cart .ttg-proof-customer__thumbnail { border-color: var(--ttg-line); border-radius: 7px; background: #fff; }
.ttg-cart .ttg-proof-customer--cart .ttg-proof-customer__meta { gap: 1px; }
.ttg-cart .ttg-proof-customer--cart .ttg-proof-customer__side { color: var(--ttg-ink); font-size: 14px; }
.ttg-cart .ttg-proof-customer--cart .ttg-proof-customer__state {
	overflow: hidden;
	color: var(--ttg-ok);
	font-size: 12.5px;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.ttg-cart .ttg-proof-customer--cart .ttg-proof-customer__state.is-awaiting { color: #a14b08; }
.ttg-cart .ttg-proof-customer--cart .ttg-proof-customer__filename { display: none; }

/* ---------- Buttons ---------- */
.ttg-cart .ttg-btn,
.ttg-cart .ttg-cart-proof-download {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 44px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid #c3d4e0;
	border-radius: 10px;
	background: #fff;
	box-shadow: none;
	color: var(--ttg-accent);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ttg-cart .ttg-btn:hover,
.ttg-cart .ttg-cart-proof-download:hover { border-color: var(--ttg-accent); background: #eef6fb; color: var(--ttg-accent-dark); }
.ttg-cart .ttg-cart-proof-download { flex: 1 1 100%; }
.ttg-cart .ttg-cart-proof-download svg { width: 18px; height: 18px; }
.ttg-cart .ttg-line__proofs .ttg-cart-proof-download { font-size: 15px; }
.ttg-cart .woocommerce-cart-form .product-remove a.remove {
	display: inline-flex;
	width: 100%;
	height: auto;
	color: var(--ttg-muted) !important;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
}
.ttg-cart .woocommerce-cart-form .product-remove a.remove:hover {
	border-color: #e7b4ae;
	background: #fff3f1;
	color: var(--ttg-danger) !important;
}

/* ---------- Actions: stepper, edit, remove ---------- */
.ttg-line__actions {
	grid-area: actions;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	padding-top: 14px;
	border-top: 1px solid var(--ttg-line);
}
.ttg-line__qty { grid-column: 1 / -1; display: flex; }
.ttg-line__qty.is-static { display: none; }
.ttg-qty-static { display: none; }
.ttg-line__actions > .ttg-btn--edit { width: 100%; }
.ttg-line__actions > .product-remove { display: flex; }
.ttg-line__actions > .product-remove:nth-child(2) { grid-column: 1 / -1; }

.ttg-qty {
	display: inline-flex;
	align-items: stretch;
	width: 100%;
	border: 1px solid #c3d4e0;
	border-radius: 10px;
	background: #fff;
	overflow: hidden;
}
.ttg-cart .ttg-qty__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 52px;
	min-height: 46px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: #fff;
	color: var(--ttg-accent);
	cursor: pointer;
}
.ttg-cart .ttg-qty__btn:hover:not([disabled]) { background: #eef6fb; }
.ttg-cart .ttg-qty__btn:focus-visible { border-radius: 0; box-shadow: inset 0 0 0 3px var(--ttg-accent); }
.ttg-cart .ttg-qty__btn[disabled] { color: #a7b4be; cursor: not-allowed; }
.ttg-qty__value {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	min-width: 76px;
	padding: 0 8px;
	border-inline: 1px solid var(--ttg-line);
	color: var(--ttg-ink);
	font-size: 17px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.ttg-cart .ttg-line__qty .quantity { display: flex; width: 100%; margin: 0; }
.ttg-cart .ttg-line__qty .quantity .qty {
	width: 100%;
	min-height: 46px;
	border: 1px solid #c3d4e0;
	border-radius: 10px;
	text-align: center;
	font-size: 16px;
}

/* ---------- Coupon / update ---------- */
.ttg-cart__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 10px;
	margin-top: 16px;
}
.ttg-coupon { flex: 1 1 100%; }
.ttg-coupon > summary { list-style: none; width: 100%; }
.ttg-coupon > summary::-webkit-details-marker { display: none; }
.ttg-coupon[open] > summary { border-color: var(--ttg-accent); background: #eef6fb; }
.ttg-cart .ttg-coupon .coupon {
	float: none;
	margin: 10px 0 0;
	padding: 14px;
	border: 1px solid var(--ttg-line);
	border-radius: 12px;
	background: #fff;
}
.ttg-cart .ttg-coupon label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.ttg-coupon__row { display: flex; gap: 8px; }
.ttg-cart .ttg-coupon .input-text {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	min-height: 44px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid #b7c8d4;
	border-radius: 10px;
	background: #fff;
	font-size: 16px;
}
.ttg-cart .ttg-btn--secondary { flex: none; }
.ttg-cart__foot > .ttg-btn--secondary { flex: 1 1 100%; }

/* ---------- Order Summary ---------- */
.ttg-cart .ttg-summary {
	padding: 18px;
	border: 1px solid var(--ttg-line);
	border-radius: var(--ttg-radius);
	background: #fff;
	box-shadow: 0 1px 2px rgba(23, 57, 79, 0.05);
}
.ttg-cart .ttg-summary__title {
	margin: 0 0 6px;
	color: var(--ttg-ink);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
}
.ttg-cart table.ttg-summary__table {
	display: block;
	width: 100%;
	margin: 0 0 16px;
	border: 0;
	border-radius: 0;
	background: transparent;
}
.ttg-cart .ttg-summary__table tbody { display: block; }
.ttg-cart .ttg-summary__table tr {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--ttg-line);
	background: transparent !important;
}
.ttg-cart .ttg-summary__table th,
.ttg-cart .ttg-summary__table td {
	display: block;
	width: auto;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	color: var(--ttg-ink);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.45;
	text-align: left;
}
.ttg-cart .ttg-summary__table td { text-align: right; font-variant-numeric: tabular-nums; }
.ttg-cart .ttg-summary__table td::before { content: none !important; display: none !important; }
.ttg-summary__muted { color: var(--ttg-muted); }
.ttg-cart .ttg-summary__table .includes_tax { display: block; color: var(--ttg-muted); font-size: 13px; }
.ttg-cart .ttg-summary--tax-row .order-total .includes_tax { display: none; }
.ttg-cart .ttg-summary__tax-included th,
.ttg-cart .ttg-summary__tax-included td { color: var(--ttg-muted); font-size: 14px; }

/* Shipping / pickup: label row, then methods and calculator full width. */
.ttg-cart .ttg-summary__table tr.shipping td,
.ttg-cart .ttg-summary__table tr.woocommerce-shipping-totals td { flex: 1 1 100%; text-align: left; }
.ttg-cart .ttg-summary__table .woocommerce-shipping-methods { margin: 0 0 6px; padding: 0; list-style: none; }
.ttg-cart .ttg-summary__table .woocommerce-shipping-methods li { margin: 0 0 4px; padding: 0; font-weight: 600; }
.ttg-cart .ttg-summary__table .woocommerce-shipping-methods li::before { content: none; }
.ttg-cart .ttg-summary__table .woocommerce-shipping-destination,
.ttg-cart .ttg-summary__table .woocommerce-shipping-contents { margin: 0 0 8px; color: var(--ttg-muted); font-size: 14px; }
.ttg-cart .ttg-summary__table .woocommerce-shipping-calculator { margin: 0; }
.ttg-cart .ttg-summary__table .shipping-calculator-button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid #c3d4e0;
	border-radius: 10px;
	background: #fff !important;
	color: var(--ttg-accent) !important;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}
.ttg-cart .ttg-summary__table .shipping-calculator-button:hover { border-color: var(--ttg-accent); background: #eef6fb !important; }
.ttg-cart .ttg-summary__table .shipping-calculator-form { padding-top: 10px; }
.ttg-cart .ttg-summary__table .shipping-calculator-form .input-text,
.ttg-cart .ttg-summary__table .shipping-calculator-form select { min-height: 44px; font-size: 16px; }

.ttg-cart .ttg-summary__table tr.order-total { padding-top: 16px; border-bottom: 0; }
.ttg-cart .ttg-summary__table .order-total th { font-size: 19px; font-weight: 700; }
.ttg-cart .ttg-summary__table .order-total td,
.ttg-cart .ttg-summary__table .order-total td strong { font-size: 22px; font-weight: 700; }
.ttg-cart .ttg-summary__table .order-total td .includes_tax,
.ttg-cart .ttg-summary__table .order-total td .includes_tax .amount { font-size: 13px; font-weight: 400; }

.ttg-cart .wc-proceed-to-checkout { margin: 0; padding: 0; }
.ttg-cart .wc-proceed-to-checkout a.checkout-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 54px;
	margin: 0 0 12px;
	padding: 0 20px;
	border: 0;
	border-radius: 12px;
	background: var(--ttg-navy);
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	text-transform: none;
	transition: background 0.15s;
}
.ttg-cart .wc-proceed-to-checkout a.checkout-button::after {
	content: "";
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ttg-cart .wc-proceed-to-checkout a.checkout-button:hover { background: var(--ttg-navy-dark); color: #fff; }

.ttg-cart .ttg-assure {
	display: grid;
	gap: 14px;
	margin: 6px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid var(--ttg-line);
	list-style: none;
}
.ttg-cart .ttg-assure li { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 0; }
.ttg-cart .ttg-assure li::before { content: none; }
.ttg-assure .ttg-icon { width: 26px; height: 26px; color: var(--ttg-accent); }
.ttg-assure span { display: flex; flex-direction: column; color: var(--ttg-muted); font-size: 14px; line-height: 1.4; }
.ttg-assure strong { color: var(--ttg-ink); font-size: 15px; font-weight: 700; }
.ttg-cart .ttg-assure a { align-self: flex-start; color: var(--ttg-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ttg-cart .ttg-assure a:hover { color: var(--ttg-accent-dark); }

/* ---------- Proof thumbnail carousel ---------- */
.ttg-proofs { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.ttg-proofs__frame { position: relative; }
.ttg-cart .ttg-proofs__open {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 1px solid var(--ttg-line);
	border-radius: 12px;
	background: var(--ttg-soft);
	cursor: zoom-in;
	overflow: hidden;
	touch-action: pan-y;
}
.ttg-cart .ttg-proofs__open img {
	display: block;
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 1;
	margin: 0;
	padding: 6px;
	border: 0;
	border-radius: 0;
	background: transparent;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
}
.ttg-cart .ttg-proofs__open img[hidden] { display: none; }
.ttg-cart .ttg-proofs__open:hover { border-color: #a9c1d1; }
.ttg-proofs__badge {
	position: absolute;
	top: 6px;
	right: 6px;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--ttg-ok);
	color: #fff;
	pointer-events: none;
}
.ttg-proofs__badge .ttg-icon { width: 13px; height: 13px; stroke-width: 3; }
.ttg-cart .ttg-proofs__nav {
	position: absolute;
	top: 50%;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	margin: -15px 0 0;
	padding: 0;
	border: 1px solid rgba(23, 57, 79, 0.18);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.94);
	box-shadow: 0 1px 4px rgba(23, 57, 79, 0.18);
	color: var(--ttg-ink);
	cursor: pointer;
}
.ttg-cart .ttg-proofs__nav::after { content: ""; position: absolute; inset: -7px; }
.ttg-cart .ttg-proofs__nav--prev { left: 4px; }
.ttg-cart .ttg-proofs__nav--next { right: 4px; }
.ttg-cart .ttg-proofs__nav:hover { background: #fff; color: var(--ttg-accent); }
.ttg-cart .ttg-proofs__nav .ttg-icon { width: 16px; height: 16px; stroke-width: 2.4; }
.ttg-cart .ttg-proofs__nav:focus-visible { border-radius: 50%; }
.ttg-proofs__side {
	position: absolute;
	left: 50%;
	bottom: 6px;
	transform: translateX(-50%);
	padding: 2px 8px;
	border-radius: 999px;
	background: rgba(23, 57, 79, 0.82);
	color: #fff;
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
	pointer-events: none;
}
.ttg-cart .ttg-proofs__download {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	min-height: 32px;
	color: var(--ttg-accent);
	font-size: 13px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}
.ttg-cart .ttg-proofs__download .ttg-icon { width: 15px; height: 15px; }
.ttg-cart .ttg-proofs__download:hover { color: var(--ttg-accent-dark); }

/* ---------- Proof viewer dialog (appended to <body>) ---------- */
html.ttg-viewer-open { overflow: hidden; }
.ttg-viewer {
	--v-ink: #17394f;
	--v-accent: #0370af;
	position: fixed;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: #0f1d27;
	color: #fff;
	font-family: inherit;
	overflow: hidden;
}
.ttg-viewer *, .ttg-viewer *::before, .ttg-viewer *::after { box-sizing: border-box; }
.ttg-viewer [hidden] { display: none !important; }
.ttg-viewer::backdrop { background: rgba(10, 20, 28, 0.72); }
.ttg-viewer[open] { display: flex; flex-direction: column; }
.ttg-viewer .ttg-icon { width: 22px; height: 22px; }
.ttg-viewer__bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: max(10px, env(safe-area-inset-top)) 12px 10px 16px;
	background: #fff;
	color: var(--v-ink);
}
.ttg-viewer__heading { flex: 1 1 auto; min-width: 0; }
.ttg-viewer__title { margin: 0; overflow: hidden; color: var(--v-ink); font-size: 16px; font-weight: 700; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.ttg-viewer__label { margin: 0; color: #157a3a; font-size: 13px; font-weight: 600; }
.ttg-viewer button {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0 10px;
	border: 1px solid #c3d4e0;
	border-radius: 10px;
	background: #fff;
	color: var(--v-ink);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.ttg-viewer button:hover:not([disabled]) { border-color: var(--v-accent); color: var(--v-accent); }
.ttg-viewer button[disabled] { opacity: 0.4; cursor: not-allowed; }
.ttg-viewer button:focus-visible,
.ttg-viewer__stage:focus-visible { outline: 3px solid #7cc4f2; outline-offset: 2px; }
.ttg-viewer__stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	touch-action: none;
	cursor: grab;
	user-select: none;
}
.ttg-viewer__stage.is-dragging { cursor: grabbing; }
.ttg-viewer__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	padding: 12px;
	object-fit: contain;
	transform-origin: 0 0;
	will-change: transform;
	-webkit-user-drag: none;
	pointer-events: none;
}
.ttg-viewer__tools {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 12px max(10px, env(safe-area-inset-bottom));
	background: #fff;
	color: var(--v-ink);
}
.ttg-viewer__zoom { min-width: 52px; text-align: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ttg-viewer__spacer { flex: 1 1 auto; }
@media (pointer: coarse) { .ttg-viewer__keys { display: none; } }
.ttg-viewer__hint { margin: 0; padding: 0 16px 8px; background: #fff; color: #566876; font-size: 12.5px; text-align: center; }

/* ---------- 640px+: roomier cards, chips for options ---------- */
@media (min-width: 640px) {
	.ttg-cart__continue { flex-basis: auto; margin-left: auto; }
	.ttg-cart .ttg-cart__title { font-size: 34px; }

	.ttg-line__card {
		grid-template-columns: 120px minmax(0, 1fr);
		grid-template-areas:
			"media head"
			"media specs"
			"proofs proofs"
			"actions actions";
		gap: 12px 18px;
		padding: 18px;
	}
	.ttg-line__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
	.ttg-cart .ttg-line__name { margin: 2px 0 0; font-size: 19px; }
	.ttg-cart .ttg-line__price { flex: none; align-items: flex-end; text-align: right; }
	.ttg-line__total { font-size: 21px; }

	.ttg-cart .ttg-specs { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px 20px; }
	.ttg-spec { display: inline-flex; align-items: center; gap: 6px; }
	.ttg-cart .ttg-spec dt span::after { content: ":"; }

	.ttg-cart .ttg-proof-customer--cart { flex: 0 1 auto; }
	.ttg-line__proofs { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
	.ttg-cart .ttg-line__proofs > :only-child { grid-column: 1 / -1; }
	.ttg-cart .ttg-proof-customer--cart .ttg-proof-customer__list { flex: 0 1 auto; }
	.ttg-cart .ttg-proof-customer--cart .ttg-proof-customer__item { flex: 0 0 auto; }
	.ttg-cart .ttg-cart-proof-download { flex: 0 0 auto; margin-left: auto; }

	.ttg-line__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
	.ttg-line__qty { flex: 0 0 auto; margin-right: auto; }
	.ttg-qty { width: auto; }
	.ttg-line__actions > .ttg-btn--edit { width: auto; }
	.ttg-line__actions > .product-remove { display: inline-flex; }
	.ttg-cart .woocommerce-cart-form .product-remove a.remove { width: auto; }

	.ttg-cart__foot { justify-content: space-between; }
	.ttg-coupon { flex: 0 1 420px; }
	.ttg-coupon > summary { width: auto; display: inline-flex; }
	.ttg-cart__foot > .ttg-btn--secondary { flex: 0 0 auto; }
}

/* ---------- 1024px+: two columns, summary follows the scroll ---------- */
@media (min-width: 768px) {
	.ttg-viewer {
		inset: auto;
		top: 50%;
		left: 50%;
		width: min(92vw, 1100px);
		height: min(90vh, 900px);
		border-radius: 16px;
		transform: translate(-50%, -50%);
		box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	}
	.ttg-viewer__bar { padding: 12px 12px 12px 20px; }
}

@media (min-width: 1024px) {
	.ttg-cart__body { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
	.ttg-cart .ttg-cart__body > .cart-collaterals .cart_totals.ttg-summary { padding: 22px; }
	.ttg-line__card { grid-template-columns: 128px minmax(0, 1fr); }
}
@media (min-width: 1024px) and (min-height: 760px) {
	.ttg-cart__summary { position: sticky; top: 96px; }
}
@media (min-width: 1280px) {
	.ttg-cart__body { grid-template-columns: minmax(0, 1fr) 360px; }
}

@media (prefers-reduced-motion: reduce) {
	.ttg-cart *, .ttg-cart *::before, .ttg-cart *::after { transition: none !important; }
}
