/* HW Recesso 54-bis — front-end (layout via flex/grid). */

.hw-ocr-wrap {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.hw-ocr-legal-title {
	margin: 0;
}

.hw-ocr-notice {
	padding: 12px 16px;
	border-radius: 6px;
	border: 1px solid #d0d0d0;
	background: #f6f6f6;
}
.hw-ocr-notice--success { border-color: #46b450; background: #ecf7ed; }
.hw-ocr-notice--error { border-color: #dc3232; background: #fbeaea; }

.hw-ocr-order-list,
.hw-ocr-items,
.hw-ocr-summary,
.hw-ocr-events {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.hw-ocr-order-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
}

.hw-ocr-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 12px;
	border: 1px solid #e6e6e6;
	border-radius: 6px;
}
.hw-ocr-item.is-ineligible {
	opacity: 0.6;
}
.hw-ocr-item-main {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1 1 auto;
}
.hw-ocr-item-qty {
	display: flex;
	align-items: center;
	gap: 6px;
}
.hw-ocr-item-qty input {
	width: 4em;
}
.hw-ocr-item-reason {
	margin-left: auto;
	font-size: 0.9em;
	color: #a00;
}

.hw-ocr-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.hw-ocr-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.hw-ocr-hp {
	position: absolute;
	left: -9999px;
}

.hw-ocr-declaration-preview,
.hw-ocr-declaration .hw-ocr-declaration {
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 12px 16px;
	background: #fafafa;
}

.hw-ocr-consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.hw-ocr-history-table {
	width: 100%;
	border-collapse: collapse;
}
.hw-ocr-history-table th,
.hw-ocr-history-table td {
	padding: 8px;
	border-bottom: 1px solid #eee;
}

/* Modal */
.hw-ocr-modal {
	/*
	 * Center the native <dialog> explicitly — at class specificity + !important — so
	 * author resets shipped by some themes (e.g. * { margin:0 }, dialog[open]{ margin:0 },
	 * normalize/preflight) can't defeat the browser's default margin:auto centering and
	 * leave the popup pinned top-left. These values mirror the UA `dialog:modal` recipe.
	 */
	position: fixed !important;
	inset: 0 !important;
	margin: auto !important;          /* load-bearing: auto margins center both axes */
	height: fit-content !important;   /* content height so vertical margin:auto centers instead of stretching full-height */
	width: min(560px, 92vw);
	max-width: 92vw;
	max-height: calc(100vh - 2em);    /* fallback for engines without dvh */
	max-height: calc(100dvh - 2em);   /* mobile: excludes the dynamic browser chrome */
	z-index: 100000;                  /* only matters for the non-modal open-attribute fallback; harmless in the top layer */
	border: none;
	border-radius: 10px;
	padding: 0;
}
.hw-ocr-modal::backdrop {
	background: rgba(0, 0, 0, 0.5);
}
.hw-ocr-modal-inner {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px;
	max-height: 82vh;
}
.hw-ocr-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.hw-ocr-modal-header h2 {
	margin: 0;
	font-size: 1.2em;
}
.hw-ocr-modal-close {
	background: none;
	border: none;
	font-size: 1.6em;
	line-height: 1;
	cursor: pointer;
}
.hw-ocr-modal-body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	overflow-y: auto;
}
.hw-ocr-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}
.hw-ocr-modal-footer .hw-ocr-back {
	margin-right: auto;
}
