/* Desktop: bleibt klein */
.mobile-full-btn {
	margin: 2px;
	padding: 5px 10px;
	font-size: 0.9rem;
}

/* Mobile Ansicht */
@media (max-width: 992px) {
	.mobile-full-btn {
		display: block;
		width: calc(100% - 30px); /* volle Breite minus Rand */
		margin: 15px; /* rundherum Abstand */
		padding: 12px;
		text-align: center;
		font-size: 1rem;
		border-radius: 8px;
	}
}

/*###############################################################*/
/* --- Grundlayout (Desktop) --- */
.responsive-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed; /* feste Breiten nutzen */
	font-size: 0.95rem;
}

.responsive-table th,
.responsive-table td {
	padding: 12px 14px;
	text-align: left;
	vertical-align: middle;
	border-bottom: 1px solid #ddd;
	word-wrap: break-word; /* lange Inhalte umbrechen */
}

/* Kopfzeilen */
.responsive-table th {
	font-weight: 600;
	background: #f8f9fa;
	color: #222;
}

/* Standardtext */
.responsive-table td p {
	margin: 0;
	font-weight: 400;
	color: #333;
}

/* Hervorgehobene Werte */
.responsive-table td p.value {
	font-weight: 500;
	color: #111;
}

/* --- Spaltenbreiten in px --- */
.responsive-table th:nth-child(1),
.responsive-table td:nth-child(1) {
	width: 400px;
} /* Button */
.responsive-table th:nth-child(2),
.responsive-table td:nth-child(2) {
	width: 120px;
} /* Auftrag */
.responsive-table th:nth-child(3),
.responsive-table td:nth-child(3) {
	width: 140px;
} /* Variante-ID */
.responsive-table th:nth-child(4),
.responsive-table td:nth-child(4) {
	width: 300px;
} /* Name */
.responsive-table th:nth-child(5),
.responsive-table td:nth-child(5) {
	width: 160px;
} /* Menge */

/* --- Mobile Ansicht als Cards --- */
@media (max-width: 768px) {
	.responsive-table thead {
		display: none; /* Header ausblenden */
	}

	.responsive-table,
	.responsive-table tbody,
	.responsive-table tr,
	.responsive-table td {
		display: block;
		width: 100%;
	}

	.responsive-table tr {
		background: #fff;
		margin-bottom: 12px;
		border: 1px solid #ddd;
		border-radius: 8px;
		padding: 8px;
	}

	.responsive-table td {
		border: none;
		padding: 6px 0;
		font-size: 0.95rem;
	}

	.responsive-table td::before {
		content: attr(data-label) ': ';
		font-weight: bold;
		display: inline-block;
		min-width: 90px;
		color: #333;
	}

	/* Inputs mobil: volle Breite */
	.compact-input,
	.wide-input {
		width: 100%;
		min-width: unset;
	}

	/* Minus-Button mobil: volle Breite mit Rand */
	.mobile-full-btn {
		display: block;
		width: calc(100% - 20px);
		margin: 10px auto;
		padding: 10px;
		text-align: center;
		font-size: 1rem;
		border-radius: 6px;
	}
}

/*################################################################*/
/* =============================== */
/* ========== DESKTOP ============ */
/* =============================== */
#artikel table {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#artikel thead {
	background-color: #f7f7f7;
}

#artikel th {
	text-align: left;
	padding: 12px 16px;
	font-weight: 600;
	font-size: 0.95rem;
	color: #333;
	border-bottom: 1px solid #e0e0e0;
}

#artikel td {
	padding: 10px 16px;
	font-size: 0.9rem;
	color: #222;
	border-bottom: 1px solid #f0f0f0;
	vertical-align: middle;
	white-space: nowrap; /* keine Umbrüche in engen Spalten */
}

#artikel tr:hover {
	background-color: #fafafa;
}

/* Erste Spalte (Button) kompakter */
#artikel td:first-child,
#artikel th:first-child {
	width: 1%;
	white-space: nowrap;
}

#artikel button {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	height: 32px;
	padding: 0 12px;
	font-size: 0.85rem;
	line-height: 1;
	border-radius: 6px;
}

/* Tabelle responsiv scrollbar, falls zu breit */
#artikel {
	overflow-x: auto;
}

/* =============================== */
/* ========== MOBILE ============= */
/* =============================== */
@media (max-width: 992px) {
	#artikel table,
	#artikel thead,
	#artikel tbody,
	#artikel th,
	#artikel td,
	#artikel tr {
		display: block !important;
		width: 100% !important;
		border: none !important;
	}

	#artikel thead {
		display: none !important;
	}

	#artikel tr {
		margin-bottom: 0.8rem;
		padding: 10px 12px;
		border-radius: 8px;
		box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
		background: #fff;
	}

	#artikel td {
		display: flex;
		flex-direction: column;
		padding: 8px 0;
		border-bottom: 1px solid #f0f0f0;
	}

	#artikel td:last-child {
		border-bottom: none;
	}

	/* Label über Wert */
	#artikel td::before {
		content: attr(data-label);
		font-size: 0.8rem;
		font-weight: 600;
		color: #666;
		margin-bottom: 3px;
		text-transform: uppercase;
		letter-spacing: 0.5px;
	}

	#artikel td p {
		margin: 0;
		font-size: 1rem;
		font-weight: 500;
		color: #111;
	}

	/* Buttonfeld (ohne Label) */
	#artikel td:first-child::before {
		content: '';
	}

	#artikel td:first-child {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		border-bottom: none;
		padding-top: 0;
	}

	#artikel td:first-child button {
		width: 100%;
		height: 36px;
		font-size: 0.9rem;
		border-radius: 6px;
	}
}

@media (max-width: 992px) {
	#artikel td:first-child button {
		width: 100%; /* nimmt gesamte Breite ein */
		height: 40px; /* etwas größer, damit gut antippbar */
		font-size: 0.95rem;
		border-radius: 6px;
		display: flex;
		justify-content: center;
		align-items: center;
	}
}

#variantenbearbeiten.full-width-btn {
	display: block;
	margin: 20px 15px 10px 15px; /* oben | rechts | unten | links */
	width: auto;
}

/* nur für Mobile Ansicht */
@media (max-width: 992px) {
	#variantenbearbeiten.full-width-btn {
		width: calc(100% - 30px); /* volle Breite minus Seitenabstand */
		padding: 12px;
		text-align: center;
		white-space: normal; /* langer Text darf umbrechen */
		font-size: 1rem;
	}
}
