/* WC Terugkerende Orders – Frontend */

.wcro-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.5em;
}

.wcro-status-header {
	margin: 1.6em 0 0.6em;
	padding-left: 10px;
	font-size: 0.95em;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #555;
	border-left: 4px solid #ccc;
}
.wcro-status-header.wcro-status-active { border-color: #46a35e; }
.wcro-status-header.wcro-status-paused { border-color: #d4a017; }
.wcro-status-header.wcro-status-ended  { border-color: #c0392b; }

/* Statuslabel (badge) – alleen op .wcro-status, niet op de sectiekop */
.wcro-status {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 0.7em;
	font-weight: 600;
	text-transform: uppercase;
	vertical-align: middle;
}
.wcro-status.wcro-status-active  { background: #d4edda; color: #155724; }
.wcro-status.wcro-status-paused  { background: #fff3cd; color: #856404; }
.wcro-status.wcro-status-ended   { background: #f8d7da; color: #721c24; }

.wcro-empty {
	padding: 2em;
	text-align: center;
	color: #888;
}

/* Overzichtstabel – sluit aan op de WooCommerce "Bestellingen"-tabel */
.wcro-orders-table th.woocommerce-orders-table__header-actions,
.wcro-orders-table td.woocommerce-orders-table__cell-actions {
	text-align: right;
	white-space: nowrap;
}

.wcro-actions .wcro-btn {
	margin: 2px 0 2px 6px;
}

/* Formulieren */
.wcro-form-wrap,
.wcro-detail-wrap {
	max-width: 780px;
}

.wcro-form-wrap fieldset,
.wcro-detail-wrap fieldset {
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 1em 1.2em;
	margin-bottom: 1.5em;
}

.wcro-form-wrap legend,
.wcro-detail-wrap legend {
	padding: 0 6px;
	font-weight: 600;
}

.wcro-item-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.wcro-product-name {
	flex: 1;
	font-weight: 500;
}

.wcro-remove-item {
	color: #c0392b;
	font-size: 1.2em;
	line-height: 1;
	cursor: pointer;
}

.wcro-form-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

.wcro-meta {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 4px 16px;
	margin-bottom: 1.5em;
}
.wcro-meta dt { font-weight: 600; }

.wcro-add-product-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}

/* Accordion */
.wcro-accordion {
	margin-bottom: 1.5em;
}

.wcro-acc-item {
	border: 1px solid #ddd;
	border-radius: 4px;
	margin-bottom: 10px;
	overflow: hidden;
}

.wcro-acc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 14px 16px;
	background: #f7f7f7;
	border: 0;
	font-size: 1em;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}
.wcro-acc-header:hover { background: #efefef; }

.wcro-acc-icon {
	transition: transform 0.2s ease;
}
.wcro-acc-open > .wcro-acc-header .wcro-acc-icon {
	transform: rotate(180deg);
}

.wcro-acc-body {
	display: none;
	padding: 16px;
}
.wcro-acc-open > .wcro-acc-body {
	display: block;
}

.wcro-acc-body fieldset {
	border: 0;
	padding: 0;
	margin: 0 0 1em;
}
.wcro-acc-body legend {
	padding: 0;
}

/* Bulk productselectie (à la B2BKing bulkorder) */
.wcro-bulk-picker {
	margin-bottom: 10px;
}

.wcro-picker-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}
.wcro-picker-cat {
	flex: 0 0 auto;
	max-width: 220px;
}
.wcro-picker-search {
	flex: 1 1 180px;
	min-width: 140px;
}

.wcro-product-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 10px;
	border: 1px solid #e3e3e3;
	border-radius: 5px;
	overflow: hidden;
}
.wcro-product-table thead th {
	background: #f7f7f7;
	font-size: 0.8em;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #555;
}
.wcro-product-table th,
.wcro-product-table td {
	padding: 8px 10px;
	border-bottom: 1px solid #eee;
	text-align: left;
	vertical-align: middle;
}
.wcro-product-table tbody tr:last-child td {
	border-bottom: 0;
}
.wcro-product-table tbody tr:hover {
	background: #fafafa;
}
.wcro-product-table .wcro-col-check { width: 32px; }
.wcro-product-table .wcro-col-qty   { width: 120px; }
.wcro-product-table .wcro-col-sub   { width: 110px; text-align: right; }
.wcro-product-empty td {
	color: #888;
	font-style: italic;
	text-align: center;
}

/* Productcel: thumbnail + naam/sku/prijs */
.wcro-prod-cell {
	display: flex;
	align-items: center;
	gap: 10px;
}
.wcro-prod-thumb {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border: 1px solid #e3e3e3;
	border-radius: 4px;
	flex: 0 0 auto;
}
.wcro-prod-info {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}
.wcro-row-name { font-weight: 500; }
.wcro-row-sku {
	color: #999;
	font-size: 0.8em;
}
.wcro-row-price {
	color: #555;
	font-size: 0.85em;
}

/* Aantal-stepper (− input +) */
.wcro-stepper {
	display: inline-flex;
	align-items: stretch;
	border: 0;
	border-radius: 10px;
	overflow: hidden;
}
.wcro-stepper .wcro-step {
	width: 28px;
	border: 0;
	background: #3a4a35;
	color: #fff;
	font-size: 1.1em;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}
.wcro-stepper .wcro-step:hover { background: #c0392b; }
.wcro-stepper .wcro-pick-qty {
	width: 48px;
	border: 0;
	text-align: center;
	padding: 4px 0;
	background: #f3f3f3;
	-moz-appearance: textfield;
}
.wcro-stepper .wcro-pick-qty::-webkit-outer-spin-button,
.wcro-stepper .wcro-pick-qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.wcro-pick-sub {
	font-weight: 500;
	color: #333;
}

.wcro-picker-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}

.wcro-selected-title {
	margin: 1.2em 0 0.5em;
}
.wcro-no-items {
	color: #888;
	font-style: italic;
}

.wcro-item-row .wcro-subtotal {
	min-width: 90px;
	text-align: right;
	color: #333;
}

.wcro-shipping-hint {
	color: #555;
	font-style: italic;
}
#wcro-shipping-status {
	margin-left: 8px;
	font-style: italic;
}

/* Scrollbare productlijst i.p.v. eindeloos uitklappen */
.wcro-table-scroll {
	max-height: 360px;
	overflow-y: auto;
	border: 1px solid #e3e3e3;
	border-radius: 5px;
}
.wcro-table-scroll .wcro-product-table {
	border: 0;
	margin-bottom: 0;
}
.wcro-table-scroll thead th {
	position: sticky;
	top: 0;
	z-index: 1;
}

/* ====================================================================== */
/* Design-review aanpassingen                                             */
/* ====================================================================== */

/* --- Knoppen: uniform groen, rode hover, 10px radius, geen rand --- */
.wcro-form-wrap .button,
.wcro-detail-wrap .button,
.wcro-orders-table .button,
.wcro-action-btn,
.wcro-btn-cancel {
	background: #3a4a35 !important;
	border: 0 !important;
	border-radius: 10px !important;
	color: #fff !important;
	box-shadow: none !important;
}
.wcro-form-wrap .button:hover,
.wcro-detail-wrap .button:hover,
.wcro-orders-table .button:hover,
.wcro-action-btn:hover,
.wcro-btn-cancel:hover {
	background: #c0392b !important;
	border: 0 !important;
	color: #fff !important;
}

/* --- Accordion: samenvatting + sterkere sectiekoppen --- */
.wcro-acc-header > span:first-child {
	font-size: 1.05em;
	font-weight: 700;
}
.wcro-acc-summary {
	flex: 1;
	margin: 0 12px;
	color: #777;
	font-weight: 400;
	font-size: 0.9em;
	text-align: right;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.wcro-acc-open > .wcro-acc-header .wcro-acc-summary {
	visibility: hidden;
}

/* --- Consistente inputstyling --- */
.wcro-form-wrap input[type="text"],
.wcro-form-wrap input[type="date"],
.wcro-form-wrap input[type="number"],
.wcro-form-wrap select,
.wcro-detail-wrap input[type="text"],
.wcro-detail-wrap input[type="date"],
.wcro-detail-wrap input[type="number"],
.wcro-detail-wrap select,
.wcro-picker-search {
	border: 1px solid #ccc;
	border-radius: 4px;
	padding: 8px 10px;
	line-height: 1.3;
}

/* --- Logische veldbreedtes voor korte velden --- */
.wcro-form-wrap input[name$="[postcode]"],
.wcro-detail-wrap input[name$="[postcode]"] {
	max-width: 140px;
}
.wcro-form-wrap input[name$="[country]"],
.wcro-detail-wrap input[name$="[country]"] {
	max-width: 240px;
}
.wcro-form-wrap input[type="date"],
.wcro-detail-wrap input[type="date"] {
	max-width: 220px;
}
/* De stepper-input houdt zijn eigen compacte breedte */
.wcro-stepper .wcro-pick-qty,
.wcro-item-row .wcro-qty-input {
	max-width: 70px;
}
/* Stepper-invoer: geen rand/radius (overschrijft de algemene inputstijl) */
.wcro-form-wrap .wcro-stepper .wcro-pick-qty,
.wcro-detail-wrap .wcro-stepper .wcro-pick-qty {
	border: 0;
	border-radius: 0;
	padding: 4px 0;
}

/* --- Waarschuwingsbanner: leesbaar contrast --- */
.wcro-detail-wrap .woocommerce-info,
.wcro-form-wrap .woocommerce-info {
	color: #2a2a2a;
}
.wcro-detail-wrap .woocommerce-info::before,
.wcro-form-wrap .woocommerce-info::before {
	color: #2a2a2a;
}

/* --- Checkbox: factuuradres = leveradres --- */
.wcro-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 500;
	cursor: pointer;
}
.wcro-same-address-row {
	margin-bottom: 12px;
}

/* ====================================================================== */
/* Mobiel                                                                 */
/* ====================================================================== */
@media (max-width: 768px) {
	/* "Nieuwe terugkerende bestelling"-knop onder de titel plaatsen */
	.wcro-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}
	.wcro-header .wcro-btn-new {
		align-self: flex-start;
	}

	/* Gekozen producten: aantal, prijs en verwijderen onder de naam,
	   met duidelijke scheiding tussen de producten */
	.wcro-item-row {
		flex-wrap: wrap;
		align-items: center;
		gap: 10px;
		padding-bottom: 14px;
		margin-bottom: 14px;
		border-bottom: 1px solid #e6e6e6;
	}
	.wcro-item-row:last-child {
		border-bottom: 0;
		margin-bottom: 0;
	}
	.wcro-item-row .wcro-product-name {
		flex: 1 0 100%;   /* naam op eigen regel → de rest valt eronder */
		margin-bottom: 2px;
	}
	.wcro-item-row .wcro-subtotal {
		min-width: 0;
		text-align: left;
		margin-right: auto;   /* duwt de verwijderknop naar rechts */
		font-weight: 500;
	}
}

/* -------------------------------------------------------------------------
   Laadindicator (overlay + spinner) bij navigatie naar nieuw/beheer
   ------------------------------------------------------------------------- */
.wcro-loading-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;            /* JS zet 'flex' bij klik */
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.72);
}

.wcro-loading-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 26px 34px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 6px 28px rgba(0, 0, 0, 0.16);
}

.wcro-spinner {
	width: 38px;
	height: 38px;
	border: 4px solid #e3e3e3;
	border-top-color: #3a4a35;
	border-radius: 50%;
	animation: wcro-spin 0.8s linear infinite;
}

@keyframes wcro-spin {
	to { transform: rotate(360deg); }
}

.wcro-loading-text {
	font-size: 14px;
	color: #2a2a2a;
	font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
	.wcro-spinner { animation-duration: 1.6s; }
}
