/* Bollaert PDF Fiche - button + modal */

.bpdfx-btn-wrap {
	margin: 18px 0;
	clear: both;
}

.bpdfx-btn {
	display: inline-flex !important;
	align-items: center;
	background: #2b98d3 !important;
	color: #fff !important;
	border: 0 !important;
	padding: 10px 18px !important;
	font-weight: 600 !important;
	font-size: 14px !important;
	border-radius: 3px !important;
	cursor: pointer;
}

.bpdfx-btn:hover,
.bpdfx-btn:focus {
	background: #1e7eb5 !important;
	color: #fff !important;
}

.bpdfx-btn:disabled {
	opacity: .6;
	cursor: not-allowed;
}

/* --- Modal --- */

body.bpdfx-modal-open {
	overflow: hidden;
}

.bpdfx-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bpdfx-modal[hidden] {
	display: none;
}

.bpdfx-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .55);
}

.bpdfx-modal__dialog {
	position: relative;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
	width: min(640px, calc(100vw - 24px));
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 22px 24px 18px;
	transition: width .2s ease;
}

.bpdfx-modal--preview .bpdfx-modal__dialog {
	width: min(960px, calc(100vw - 24px));
}

.bpdfx-preview {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bpdfx-preview[hidden] {
	display: none;
}

.bpdfx-preview__title {
	margin: 0;
	font-size: 20px;
	color: #2b98d3;
}

.bpdfx-preview__frame {
	width: 100%;
	height: 70vh;
	min-height: 400px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #f5f5f5;
}

.bpdfx-preview__actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.bpdfx-preview .bpdfx-btn-back {
	background: #eee !important;
	color: #333 !important;
}

.bpdfx-preview .bpdfx-btn-download {
	background: #2b98d3 !important;
	color: #fff !important;
}

.bpdfx-preview .bpdfx-btn-download:hover { background: #1e7eb5 !important; }

.bpdfx-modal__close {
	position: absolute;
	top: 8px;
	right: 10px;
	background: transparent;
	border: 0;
	font-size: 28px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 4px 8px;
}

.bpdfx-modal__close:hover {
	color: #000;
}

.bpdfx-modal__title {
	margin: 0 0 14px;
	font-size: 20px;
	color: #2b98d3;
}

.bpdfx-modal__images {
	border: 0;
	padding: 0;
	margin: 0 0 14px;
}

.bpdfx-modal__images legend {
	font-weight: 600;
	padding: 0;
	margin: 0 0 8px;
}

.bpdfx-modal__bulk {
	font-size: 13px;
	color: #666;
	margin-bottom: 8px;
}

.bpdfx-link {
	background: none;
	border: 0;
	color: #2b98d3;
	cursor: pointer;
	padding: 0 4px;
	font-size: 13px;
	text-decoration: underline;
}

.bpdfx-link:hover { color: #1e7eb5; }

.bpdfx-modal__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	gap: 10px;
	max-height: 320px;
	overflow-y: auto;
	padding: 4px;
	border: 1px solid #eee;
	border-radius: 4px;
}

.bpdfx-tile {
	position: relative;
	display: block;
	border: 2px solid transparent;
	border-radius: 4px;
	cursor: grab;
	padding: 6px 6px 6px 22px;
	background: #fafafa;
	transition: border-color .15s, background .15s;
}

.bpdfx-tile:active {
	cursor: grabbing;
}

.bpdfx-tile.bpdfx-tile--dragging {
	opacity: 0.4;
}

.bpdfx-tile--main {
	box-shadow: 0 0 0 2px rgba(43, 152, 211, 0.18);
}

.bpdfx-tile__drag {
	position: absolute;
	top: 6px;
	left: 4px;
	font-size: 14px;
	color: #aaa;
	line-height: 1;
	user-select: none;
	cursor: grab;
}

.bpdfx-modal__hint {
	font-size: 12px;
	color: #888;
	margin-right: 8px;
}

.bpdfx-tile:has(input:checked) {
	border-color: #2b98d3;
	background: #eaf5fc;
}

.bpdfx-tile input[type="checkbox"] {
	position: absolute;
	top: 6px;
	left: 6px;
	margin: 0;
	z-index: 2;
}

.bpdfx-tile__img {
	display: block;
	aspect-ratio: 1 / 1;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 3px;
	overflow: hidden;
}

.bpdfx-tile__img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.bpdfx-tile__label {
	display: block;
	font-size: 11px;
	color: #2b98d3;
	font-weight: 600;
	margin-top: 4px;
	text-align: center;
	line-height: 1.2;
}

/* --- Accessories --- */

.bpdfx-modal__accessories {
	border: 0;
	padding: 0;
	margin: 14px 0;
}

.bpdfx-modal__accessories legend {
	font-weight: 600;
	padding: 0;
	margin: 0 0 8px;
}

.bpdfx-acc-group {
	margin-bottom: 12px;
}

.bpdfx-acc-group__title {
	font-size: 13px;
	font-weight: 600;
	color: #2b98d3;
	margin: 0 0 6px;
	padding: 4px 0;
	border-bottom: 1px solid #e0e0e0;
}

.bpdfx-acc-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	border: 1px solid #eee;
	border-radius: 4px;
	padding: 4px;
}

.bpdfx-modal__accessories > .bpdfx-acc-group:only-child .bpdfx-acc-list {
	max-height: 280px;
	overflow-y: auto;
}

.bpdfx-acc {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 8px;
	background: #fafafa;
	border: 2px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	transition: border-color .15s, background .15s;
}

.bpdfx-acc:has(input:checked) {
	border-color: #2b98d3;
	background: #eaf5fc;
}

.bpdfx-acc input[type="checkbox"] { margin: 0; }

.bpdfx-acc__img {
	flex: 0 0 50px;
	width: 50px;
	height: 50px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 3px;
	overflow: hidden;
}

.bpdfx-acc__img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.bpdfx-acc__info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.bpdfx-acc__title {
	font-size: 13px;
	font-weight: 600;
}

.bpdfx-acc__price {
	font-size: 12px;
	color: #2b98d3;
}

.bpdfx-modal__options {
	padding: 8px 0;
	border-top: 1px solid #eee;
	border-bottom: 1px solid #eee;
	margin: 8px 0 14px;
}

.bpdfx-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 14px;
	user-select: none;
}

.bpdfx-modal__actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.bpdfx-btn-cancel {
	background: #eee !important;
	color: #333 !important;
}

.bpdfx-btn-generate {
	background: #2b98d3 !important;
	color: #fff !important;
}

.bpdfx-btn-generate:hover { background: #1e7eb5 !important; }

.bpdfx-modal__status {
	margin-top: 10px;
	padding: 8px 10px;
	border-radius: 4px;
	font-size: 13px;
	background: #eaf5fc;
	color: #1e7eb5;
}

.bpdfx-modal__status.is-error {
	background: #fce8e8;
	color: #b32d2d;
}

@media (max-width: 480px) {
	.bpdfx-modal__dialog { padding: 18px 14px; }
	.bpdfx-modal__grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); max-height: 240px; }
	.bpdfx-modal__actions { flex-direction: column-reverse; }
	.bpdfx-modal__actions .button { width: 100%; }
}
