/* ELSUP Stock — front table (no .wpDataTable) */

.elsup-stock {
	--elsup-border: #c8c8c8;
	--elsup-bg: #fff;
	--elsup-muted: #555;
	--elsup-accent: #1e73be;
	margin: 1.25rem 0;
	font-size: 15px;
	line-height: 1.4;
	color: #222;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

/* Elementor / flex parents: prevent column blowout at ~390px */
.elementor-widget-container .elsup-stock,
.elementor-shortcode .elsup-stock,
.elementor-column .elsup-stock {
	min-width: 0;
	max-width: 100%;
}

.elsup-stock *,
.elsup-stock *::before,
.elsup-stock *::after {
	box-sizing: border-box;
}

.elsup-stock__toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
	align-items: center;
	margin-bottom: 0.75rem;
}

.elsup-stock__search {
	min-width: min(100%, 22rem);
	max-width: 100%;
	padding: 0.45rem 0.65rem;
	border: 1px solid var(--elsup-border);
	background: var(--elsup-bg);
}

.elsup-stock__per-page {
	margin-left: 0.35rem;
	padding: 0.35rem 0.5rem;
}

.elsup-stock__status {
	min-height: 1.25em;
	margin-bottom: 0.5rem;
	color: var(--elsup-muted);
}

.elsup-stock__toolbar,
.elsup-stock__search-label,
.elsup-stock__pager {
	min-width: 0;
	max-width: 100%;
}

.elsup-stock__table-wrap {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.elsup-stock-table {
	width: 100%;
	min-width: 36rem;
	border-collapse: collapse;
	background: var(--elsup-bg);
	table-layout: auto;
}

.elsup-howto {
	margin: 1rem 0 1.25rem;
	max-width: 100%;
	min-width: 0;
	padding: 0.75rem 0;
	font-size: 15px;
	line-height: 1.5;
	color: #222;
	word-break: break-word;
	overflow-wrap: anywhere;
}

.elsup-howto h3 {
	margin: 0 0 0.65rem;
	font-size: 1.15rem;
}

.elsup-howto ol {
	margin: 0 0 0.75rem;
	padding-left: 1.35rem;
}

.elsup-howto li {
	margin-bottom: 0.45rem;
}

.elsup-howto p {
	margin: 0.5rem 0 0;
}

.elsup-stock-table th,
.elsup-stock-table td {
	border: 1px solid var(--elsup-border);
	padding: 0.4rem 0.55rem;
	text-align: left;
	vertical-align: middle;
	word-break: break-word;
	overflow-wrap: anywhere;
}

.elsup-stock-table thead th {
	background: #f0f4f8;
	font-weight: 600;
	white-space: nowrap;
	user-select: none;
	overflow-wrap: normal;
	word-break: normal;
}

.elsup-stock-table tbody tr:nth-child(even) {
	background: #fafafa;
}

.elsup-stock__action {
	white-space: nowrap;
	overflow-wrap: normal;
	word-break: normal;
	min-width: 10rem;
}

.elsup-stock__qty-input {
	width: 4rem;
	max-width: 30%;
	margin-right: 0.4rem;
	padding: 0.25rem 0.35rem;
	border: 1px solid var(--elsup-border);
	vertical-align: middle;
}

.elsup-stock__add {
	display: inline-block;
	padding: 0.3rem 0.65rem;
	border: 1px solid #111;
	background: #fff;
	color: #111;
	cursor: pointer;
	font: inherit;
	vertical-align: middle;
	white-space: nowrap;
}

.elsup-stock__add:hover {
	background: #f3f3f3;
}

.elsup-stock__pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.85rem;
}

/* Pagination: visible default state (WCAG AA contrast vs white page) */
.elsup-stock__prev,
.elsup-stock__next,
.elsup-stock__page-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	min-width: 36px;
	padding: 6px 14px;
	border: 1px solid #8a94a6;
	border-radius: 4px;
	background: #f1f4f8 !important; /* beat theme/Elementor white btn */
	color: #1f2937 !important;
	cursor: pointer;
	font: inherit;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.elsup-stock__prev:hover:not(:disabled):not([aria-disabled='true']),
.elsup-stock__next:hover:not(:disabled):not([aria-disabled='true']),
.elsup-stock__page-btn:hover:not([aria-current='page']) {
	background: #1e5aa8 !important;
	border-color: #1e5aa8;
	color: #fff !important;
}

.elsup-stock__prev:focus-visible,
.elsup-stock__next:focus-visible,
.elsup-stock__page-btn:focus-visible {
	outline: 2px solid #1e5aa8;
	outline-offset: 2px;
}

.elsup-stock__page-btn[aria-current='page'] {
	background: #1e5aa8 !important;
	border-color: #1e5aa8;
	color: #fff !important;
}

.elsup-stock__prev:disabled,
.elsup-stock__next:disabled,
.elsup-stock__prev[aria-disabled='true'],
.elsup-stock__next[aria-disabled='true'] {
	background: #e5e7eb !important;
	border-color: #9ca3af;
	color: #6b7280 !important;
	cursor: not-allowed;
	opacity: 1;
}

.elsup-stock__prev:disabled:hover,
.elsup-stock__next:disabled:hover,
.elsup-stock__prev[aria-disabled='true']:hover,
.elsup-stock__next[aria-disabled='true']:hover {
	background: #e5e7eb !important;
	color: #6b7280 !important;
}

.elsup-stock__page-info {
	color: var(--elsup-muted);
}

.elsup-stock__part-link {
	color: #1e5aa8;
	text-decoration: underline;
}

.elsup-stock__card-badge {
	font-size: 0.85em;
	opacity: 0.85;
}

.elsup-stock__catalog-link {
	margin-top: 0.75rem;
}

@media (max-width: 720px) {
	/* Elementor-container protection */
	.elementor-widget:has(> .elementor-widget-container > .elsup-stock),
	.elementor-widget:has(> .elsup-stock) {
		max-width: 100% !important;
		width: 100% !important;
		--container-widget-width: 100% !important;
	}

	.elsup-stock {
		margin: 0.5rem 0 1rem;
	}

	.elsup-stock__status:empty {
		display: none;
	}

	.elsup-stock__search {
		font-size: 16px;
		min-height: 44px;
	}

	.elsup-stock__per-page {
		min-height: 40px;
	}

	.elsup-stock,
	.elsup-stock__table-wrap {
		min-width: 0;
		max-width: 100%;
	}

	.elsup-stock-table {
		min-width: 0;
		width: 100%;
	}

	.elsup-stock-table thead {
		display: none;
	}

	.elsup-stock-table,
	.elsup-stock-table tbody,
	.elsup-stock-table tr,
	.elsup-stock-table td {
		display: block;
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}

	.elsup-stock-table tr {
		border: 1px solid var(--elsup-border);
		margin-bottom: 0.75rem;
		padding: 0.25rem 0;
		box-sizing: border-box;
	}

	.elsup-stock-table tbody tr:nth-child(even) {
		background: #fafafa;
	}

	.elsup-stock-table td {
		border: none;
		border-bottom: 1px solid #eee;
		display: grid;
		grid-template-columns: minmax(6.5rem, 40%) minmax(0, 1fr);
		column-gap: 0.75rem;
		align-items: baseline;
		padding: 0.45rem 0.75rem;
		word-break: normal;
		overflow-wrap: normal;
	}

	.elsup-stock-table td::before {
		content: attr(data-label);
		font-weight: 600;
		color: var(--elsup-muted);
		overflow-wrap: normal;
		word-break: normal;
	}

	.elsup-stock-table td:last-child {
		border-bottom: none;
	}

	.elsup-stock__val {
		text-align: right;
		min-width: 0;
		overflow-wrap: anywhere;
		word-break: break-word;
	}

	.elsup-stock__action {
		display: grid;
		grid-template-columns: minmax(6.5rem, 40%) minmax(0, 1fr);
		column-gap: 0.75rem;
		align-items: baseline;
		white-space: normal;
		min-width: 0;
	}

	.elsup-stock__action::before {
		font-weight: 600;
		color: var(--elsup-muted);
	}

	.elsup-stock__qty-input {
		width: 100%;
		max-width: 7rem;
		justify-self: end;
		height: 40px;
		font-size: 16px;
		margin: 0;
		padding: 0.35rem 0.5rem;
		border: 1px solid var(--elsup-border);
		box-sizing: border-box;
	}

	.elsup-stock__add {
		grid-column: 1 / -1;
		width: 100%;
		min-height: 44px;
		margin-top: 0.5rem;
		padding: 0.5rem 0.75rem;
	}

	.elsup-stock__toolbar {
		flex-direction: column;
		align-items: stretch;
		gap: 0.5rem;
	}

	.elsup-stock__search-label {
		display: block;
		width: 100%;
		flex: 1 1 100%;
	}

	.elsup-stock__search {
		min-width: 0;
		width: 100%;
	}

	.elsup-stock__per-page-label {
		display: block;
	}

	.elsup-howto {
		padding-left: 0;
		padding-right: 0;
	}

	.elsup-stock__prev,
	.elsup-stock__next,
	.elsup-stock__page-btn {
		min-height: 44px;
		min-width: 44px;
		padding: 10px 16px;
	}
}

@media (max-width: 480px) {
	.elsup-stock__prev,
	.elsup-stock__next,
	.elsup-stock__page-btn {
		min-height: 44px;
		min-width: 44px;
	}
}
