/**
 * TS Printify - Carrello B2B (tema verde)
 */
.ts-cart-b2b {
	--ts-cart-primary: #2f4a15;
	--ts-cart-primary-bg: #97b04e;
	--ts-cart-border: #d8e7bb;
	--ts-cart-bg: #f8fbef;
	--ts-cart-danger: #b42318;
	--ts-cart-text: #333;
	--ts-cart-muted: #666;
	max-width: 1400px;
	margin: 0 auto;
	padding: 20px;
}

/* Barra azioni */
.ts-cart-b2b-actions-bar {
	margin-bottom: 20px;
	padding: 12px 18px;
	background: var(--ts-cart-bg);
	border: 1px solid var(--ts-cart-border);
	border-radius: 8px;
}
.ts-cart-b2b-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* Colonne layout */
.ts-cart-b2b-columns {
	display: grid;
	grid-template-columns: 1fr 380px;
	gap: 24px;
	align-items: flex-start;
}
@media (max-width: 1024px) {
	.ts-cart-b2b-columns {
		grid-template-columns: 1fr;
	}
}

/* Colonna principale */
.ts-cart-b2b-main {
	min-width: 0;
}

/* Articoli */
.ts-cart-b2b-items {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Card articolo */
.ts-cart-b2b-item {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	overflow: visible;
	padding: 0;
	position: relative;
	z-index: 1;
}
.ts-cart-b2b-item:hover {
	z-index: 100100;
}
.ts-cart-b2b-item-header {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	flex-wrap: wrap;
	margin-bottom: 14px;
}
.ts-cart-b2b-item-img {
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	border-radius: 8px;
	overflow: hidden;
	background: #f5f5f5;
}
.ts-cart-b2b-item-img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.ts-cart-b2b-item-info {
	flex: 1;
	min-width: 180px;
}
.ts-cart-b2b-item-name {
	margin: 0 0 6px 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--ts-cart-primary);
}
.ts-cart-b2b-item-name a {
	color: inherit;
	text-decoration: none;
}
.ts-cart-b2b-item-name a:hover {
	text-decoration: underline;
}
.ts-cart-b2b-item-sku {
	margin: 0 0 6px 0;
	font-size: 12px;
	color: var(--ts-cart-muted);
}
.ts-cart-b2b-item-pers {
	font-size: 12px;
	line-height: 1.4;
	color: var(--ts-cart-text);
	margin-top: 8px;
}
.ts-cart-b2b-item-pers .pp-cart-pers-row {
	margin-bottom: 4px;
}
.ts-cart-b2b-item-thumbs {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 10px;
}
.ts-cart-b2b-item-subtotal {
	font-size: 16px;
	font-weight: 700;
	color: var(--ts-cart-primary);
	flex-shrink: 0;
}

/* Tabella varianti */
.ts-cart-b2b-variants-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
.ts-cart-b2b-variants-table th {
	text-align: left;
	padding: 10px 14px;
	background: var(--ts-cart-bg);
	border-bottom: 1px solid var(--ts-cart-border);
	font-weight: 600;
	font-size: 12px;
	color: var(--ts-cart-primary);
}
.ts-cart-b2b-variants-table td {
	padding: 10px 14px;
	font-size: 13px;
	border-bottom: 1px solid #eee;
}
.ts-cart-b2b-variants-table .ts-cart-color-swatch {
	display: inline-block;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 1px solid #ccc;
	vertical-align: middle;
	margin-right: 6px;
}
.ts-cart-b2b-variants-table .ts-cart-b2b-variant-qty {
	min-width: 100px;
}
.ts-cart-b2b-variants-table .ts-cart-b2b-variant-qty .quantity {
	display: inline-flex;
	align-items: center;
	margin: 0;
}
.ts-cart-b2b-variants-table .ts-cart-b2b-variant-qty .quantity input.qty {
	width: 56px;
	min-width: 56px;
	text-align: center;
	padding: 6px 8px;
	font-weight: 600;
}
/* Totale pezzi sotto colonna Quantità */
.ts-cart-b2b-qty-total-row td {
	background: var(--ts-cart-bg);
	padding: 10px 14px;
	border-top: 2px solid var(--ts-cart-border);
	font-size: 13px;
}
.ts-cart-b2b-qty-total-cell {
	font-weight: 600;
	color: var(--ts-cart-primary);
}

.ts-cart-b2b-item-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #eee;
}

/* Articolo default (singolo) */
.ts-cart-b2b-item-default .ts-cart-b2b-item-qty-price {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}
.ts-cart-b2b-item-qty-price .quantity {
	margin: 0;
}
.ts-cart-b2b-item-qty-price .quantity input {
	width: 60px;
	text-align: center;
	padding: 6px 8px;
}
.ts-cart-b2b-item-actions-single {
	flex-shrink: 0;
}

/* Pulsanti */
.ts-cart-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	border-radius: 6px;
	cursor: pointer;
	text-decoration: none;
	border: 1px solid transparent;
	transition: background 0.2s, color 0.2s;
}
.ts-cart-btn-primary {
	background: var(--ts-cart-primary-bg);
	color: #fff;
	border-color: var(--ts-cart-primary);
}
.ts-cart-btn-primary:hover {
	background: var(--ts-cart-primary);
	color: #fff;
}
.ts-cart-btn-secondary {
	background: #fff;
	color: var(--ts-cart-primary);
	border-color: var(--ts-cart-border);
}
.ts-cart-btn-secondary:hover {
	background: var(--ts-cart-bg);
}
.ts-cart-btn-danger {
	background: #fff5f5;
	color: var(--ts-cart-danger);
	border-color: #e3b1b1;
}
.ts-cart-btn-danger:hover {
	background: #ffebeb;
	color: #8a1c1c;
}
.ts-cart-btn-sm {
	padding: 6px 12px;
	font-size: 12px;
}

/* Sidebar */
.ts-cart-b2b-sidebar {
	position: sticky;
	top: 20px;
}
.ts-cart-b2b-sidebar-inner {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	padding: 20px;
}
.ts-cart-b2b-totals {
	margin-bottom: 18px;
}
.ts-cart-b2b-totals .cart_totals {
	padding: 0;
}
.ts-cart-b2b-totals .cart_totals h2 {
	margin: 0 0 12px 0;
	font-size: 15px;
}
.ts-cart-b2b-totals .cart_totals table {
	font-size: 14px;
}
.ts-cart-b2b-totals .cart_totals th,
.ts-cart-b2b-totals .cart_totals td {
	padding: 8px 0;
}
.ts-cart-b2b-totals .order-total th,
.ts-cart-b2b-totals .order-total td {
	font-size: 17px;
	padding: 12px 0 0 0;
}

/* Box Fatturare a / Data consegna */
.ts-cart-b2b-box {
	margin-bottom: 18px;
	padding-bottom: 18px;
	border-bottom: 1px solid #eee;
}
.ts-cart-b2b-box:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}
.ts-cart-b2b-box-title {
	margin: 0 0 10px 0;
	font-size: 14px;
	font-weight: 700;
	color: var(--ts-cart-primary);
}
.ts-cart-b2b-billing-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.ts-cart-b2b-radio {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 13px;
	color: var(--ts-cart-text);
}
.ts-cart-b2b-radio input {
	margin: 0;
}
.ts-cart-b2b-date-input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
}

/* ===== Layout Mishirto (screenshot) ===== */
.ts-cart-mishirto-card {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 0;
	overflow: hidden;
}

.ts-cart-mishirto-body {
	display: grid;
	grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.5fr) minmax(140px, 1fr);
	gap: 0;
	padding: 24px;
}
@media (max-width: 900px) {
	.ts-cart-mishirto-body {
		grid-template-columns: 1fr;
	}
}

.ts-cart-mishirto-col {
	padding: 0 20px;
	border-right: 1px solid #eee;
}
.ts-cart-mishirto-col:last-child {
	border-right: none;
}
@media (max-width: 900px) {
	.ts-cart-mishirto-col {
		border-right: none;
		border-bottom: 1px solid #eee;
		padding: 16px 0;
	}
	.ts-cart-mishirto-col:last-child {
		border-bottom: none;
	}
}

.ts-cart-mishirto-col-title {
	margin: 0 0 12px 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--ts-cart-primary);
}

.ts-cart-mishirto-img {
	margin-bottom: 12px;
	width: 120px;
	border-radius: 8px;
	overflow: hidden;
	background: #f5f5f5;
}
.ts-cart-mishirto-img img {
	width: 100%;
	height: auto;
	display: block;
}
.ts-cart-mishirto-name {
	margin: 0 0 6px 0;
	font-size: 15px;
	font-weight: 700;
	color: #333;
	line-height: 1.3;
}
.ts-cart-mishirto-name a {
	color: inherit;
	text-decoration: none;
}
.ts-cart-mishirto-name a:hover {
	text-decoration: underline;
}
.ts-cart-mishirto-codice {
	margin: 0 0 12px 0;
	font-size: 12px;
	color: var(--ts-cart-muted);
}
.ts-cart-mishirto-col-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.ts-cart-mishirto-link {
	font-size: 13px;
	color: var(--ts-cart-primary-bg);
	text-decoration: none;
}
.ts-cart-mishirto-link:hover {
	text-decoration: underline;
}

.ts-cart-mishirto-color-list,
.ts-cart-mishirto-pers-list {
	margin: 0 0 12px 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
	color: #333;
}
.ts-cart-mishirto-color-list li,
.ts-cart-mishirto-pers-list li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}
.ts-cart-mishirto-swatch {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 3px;
	border: 1px solid #ddd;
	flex-shrink: 0;
}
.ts-cart-mishirto-hr {
	margin: 16px 0;
	border: none;
	border-top: 1px solid #eee;
}
.ts-cart-mishirto-imballo {
	margin: 0;
	font-size: 13px;
	color: #333;
}
.ts-cart-mishirto-unit-price,
.ts-cart-mishirto-qty,
.ts-cart-mishirto-totale {
	margin: 0 0 4px 0;
	font-size: 14px;
	color: #333;
}
.ts-cart-mishirto-totale {
	font-size: 18px;
	font-weight: 700;
	color: var(--ts-cart-primary);
}
.ts-cart-mishirto-dim-retro {
	margin: 0;
	font-size: 13px;
	color: #333;
}

.ts-cart-mishirto-pers-template {
	margin-bottom: 8px;
}
.ts-cart-mishirto-pers-meta {
	font-size: 12px;
	color: var(--ts-cart-muted);
	margin-bottom: 8px;
}
.ts-cart-mishirto-pers-meta .pp-cart-pers-row {
	margin-bottom: 2px;
}
.ts-cart-mishirto-pers-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 8px;
}
.ts-cart-mishirto-pers-thumbs .pp-cart-template-thumb-wrap {
	flex-shrink: 0;
}

/* Popup modifica taglie */
.ts-cart-size-popup-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100101;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}
.ts-cart-size-popup-backdrop.ts-cart-size-popup-visible {
	opacity: 1;
	visibility: visible;
}
.ts-cart-size-popup-box {
	background: #fff;
	border-radius: 10px;
	max-width: 90vw;
	max-height: 90vh;
	overflow: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	margin: 20px;
	transform: scale(0.95);
	transition: transform 0.2s ease;
}
.ts-cart-size-popup-visible .ts-cart-size-popup-box {
	transform: scale(1);
}
.ts-cart-size-popup-inner {
	padding: 24px;
}
.ts-cart-size-editor-popup-content {
	display: block !important;
	min-width: 300px;
}
body.ts-cart-size-popup-open {
	overflow: hidden;
}

/* ========== TS PP Cart Card (prodotto + varianti + personalizzazione + optional) ========== */
.ts-pp-cart-card {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 16px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.ts-pp-cart-section {
	padding: 16px 20px;
	border-bottom: 1px solid #eee;
}
.ts-pp-cart-section:last-child {
	border-bottom: none;
}
.ts-pp-cart-section-title {
	margin: 0 0 12px 0;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ts-cart-primary, #2a7d5e);
}

/* Prodotto principale */
.ts-pp-cart-product .ts-pp-cart-product-inner {
	display: flex;
	gap: 16px;
	align-items: flex-start;
}
.ts-pp-cart-product-img {
	flex-shrink: 0;
	width: 80px;
	border-radius: 8px;
	overflow: hidden;
	background: #f5f5f5;
}
.ts-pp-cart-product-img img {
	width: 100%;
	height: auto;
	display: block;
}
.ts-pp-cart-product-name {
	margin: 0 0 6px 0;
	font-size: 16px;
	font-weight: 700;
	color: #333;
	line-height: 1.35;
}
.ts-pp-cart-product-name a {
	color: inherit;
	text-decoration: none;
}
.ts-pp-cart-product-name a:hover {
	text-decoration: underline;
}
.ts-pp-cart-job,
.ts-pp-cart-sku {
	margin: 0 0 4px 0;
	font-size: 12px;
	color: var(--ts-cart-muted, #666);
}
.ts-pp-cart-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 12px;
}
.ts-pp-cart-link {
	font-size: 13px;
	color: var(--ts-cart-primary-bg, #2a7d5e);
	text-decoration: none;
}
.ts-pp-cart-link:hover {
	text-decoration: underline;
}
.ts-pp-cart-link.ts-cart-remove {
	color: #b33;
}

/* Varianti tabella */
.ts-pp-cart-variants-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
.ts-pp-cart-variants-table th,
.ts-pp-cart-variants-table td {
	padding: 10px 14px;
	text-align: left;
	border-bottom: 1px solid #eee;
}
.ts-pp-cart-variants-table th.num,
.ts-pp-cart-variants-table td.num {
	text-align: right;
}
.ts-pp-cart-variants-table tfoot td {
	border-bottom: none;
	padding-top: 12px;
	font-size: 14px;
}
.ts-pp-cart-swatch {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 3px;
	border: 1px solid #ddd;
	margin-right: 8px;
	vertical-align: middle;
}
.ts-pp-cart-variants-total td {
	color: var(--ts-cart-primary, #2a7d5e);
}

/* Personalizzazione */
.ts-pp-cart-pers-areas {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-bottom: 12px;
}
.ts-pp-cart-pers-area {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}
.ts-pp-cart-pers-area-name {
	font-size: 12px;
	font-weight: 600;
	color: #555;
}
.ts-pp-cart-pers-thumb {
	width: 64px;
	height: 64px;
	border-radius: 6px;
	overflow: hidden;
	background: #f5f5f5;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ts-pp-cart-pers-thumb img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}
.ts-pp-cart-pers-thumb-bg {
	width: 100%;
	height: 100%;
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
}
.ts-pp-cart-pers-tech {
	font-size: 11px;
	color: var(--ts-cart-muted, #888);
}

/* Optional */
.ts-pp-cart-optional-list {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
	color: #555;
}
.ts-pp-cart-optional-list li {
	padding: 6px 0;
	border-bottom: 1px dashed #eee;
}
.ts-pp-cart-optional-list li:last-child {
	border-bottom: none;
}
