/**
 * BSM Arrow Shortening – Modal-Styles.
 *
 * Design-Ziele:
 *   - themeunabhängig lesbar (eigene Farben, eigene Typographie-Defaults)
 *   - hoher z-index gegen Theme-Header/Sticky-Bars
 *   - responsive (Mobile: full-width mit reduzierter Padding)
 *   - keyboard-fokussierbar, Aria-Attribute wurden im PHP-Template gesetzt
 */

/* ---- Container & Backdrop ---- */

.bsm-as-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
	align-items: center;
	justify-content: center;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	color: #1a1a1a;
}

.bsm-as-modal.bsm-as-modal--open {
	display: flex;
}

body.bsm-as-modal-open {
	overflow: hidden;
}

.bsm-as-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.55 );
	cursor: pointer;
}

/* ---- Dialog ---- */

.bsm-as-modal__dialog {
	position: relative;
	z-index: 1;
	background: #ffffff;
	border-radius: 0;
	max-width: 540px;
	width: calc( 100% - 32px );
	max-height: calc( 100vh - 64px );
	padding: 32px 28px 24px;
	box-shadow: 0 20px 50px rgba( 0, 0, 0, 0.3 );
	overflow-y: auto;
	box-sizing: border-box;
}

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

.bsm-as-modal__close:hover,
.bsm-as-modal__close:focus {
	color: #000;
	outline: none;
}

.bsm-as-modal__title {
	margin: 0 0 12px;
	font-size: 22px;
	line-height: 1.2;
	font-weight: 700;
	color: #111;
}

.bsm-as-modal__question {
	margin: 0 0 16px;
	font-size: 15px;
	color: #333;
}

/* ---- Info-Box ---- */

.bsm-as-modal__info {
	background: #f5f5f5;
	border-left: 4px solid #1a1a1a;
	padding: 12px 16px;
	margin: 0 0 20px;
	font-size: 14px;
	border-radius: 0;
}

.bsm-as-modal__info p {
	margin: 0 0 8px;
}

.bsm-as-modal__info p:last-child {
	margin-bottom: 0;
}

.bsm-as-modal__wiki-link {
	font-weight: 600;
	text-decoration: underline;
	color: #1a1a1a;
}

.bsm-as-modal__wiki-link:hover {
	color: #000;
}

/* ---- Multipack-Badge ---- */

.bsm-as-modal__pack-badge {
	background: #1a1a1a;
	color: #fff;
	padding: 10px 14px;
	margin: 0 0 16px;
	border-radius: 0;
	font-size: 13px;
	line-height: 1.4;
	display: flex;
	align-items: center;
	gap: 10px;
}

.bsm-as-modal__pack-badge strong {
	font-weight: 700;
}

.bsm-as-modal__pack-badge-icon {
	display: inline-flex;
	width: 22px;
	height: 22px;
	border-radius: 0;
	background: #fff;
	color: #1a1a1a;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 12px;
	flex-shrink: 0;
}

/* ---- Radio-Auswahl ---- */

.bsm-as-modal__choice {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0 0 20px;
	padding: 0;
	border: 0;
}

.bsm-as-modal__radio {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	border: 1px solid #1a1a1a;
	border-radius: 0;
	cursor: pointer;
	transition: background 0.15s ease;
	background: #ffffff;
}

.bsm-as-modal__radio:hover {
	background: #fafafa;
}

.bsm-as-modal__radio input[type="radio"] {
	accent-color: #1a1a1a;
	margin: 0;
	width: 18px;
	height: 18px;
}

.bsm-as-modal__radio input[type="radio"]:checked + span {
	font-weight: 600;
}

/* ---- Längenauswahl ---- */

.bsm-as-modal__length-picker {
	margin-bottom: 16px;
}

.bsm-as-modal__length-picker label {
	display: block;
	margin-bottom: 6px;
}

.bsm-as-modal__length-picker select {
	width: 100%;
	padding: 10px 12px;
	font-size: 16px;
	border: 1px solid #1a1a1a;
	border-radius: 0;
	background: #fff;
	color: inherit;
	box-sizing: border-box;
}

.bsm-as-modal__length-picker select:focus {
	border-color: #1a1a1a;
	outline: none;
}

/* ---- Zusammenfassung ---- */

.bsm-as-modal__summary {
	background: #fafafa;
	border: 1px solid #eaeaea;
	border-radius: 0;
	padding: 14px 16px;
	margin: 0 0 22px;
}

.bsm-as-modal__summary-row {
	display: flex;
	justify-content: space-between;
	padding: 4px 0;
	font-size: 14px;
}

.bsm-as-modal__summary-row--total {
	border-top: 1px solid #e0e0e0;
	margin-top: 6px;
	padding-top: 10px;
	font-size: 16px;
}

/* ---- Buttons ----
 *
 * Corporate-Design: rechteckig, 1px solid #1a1a1a, normales Weight,
 * keine Rundungen. Siehe Header-CTA "IN DEN WARENKORB" als Referenz.
 * Breite ergibt sich natürlich aus dem Textinhalt — kein flex:1, kein
 * min-width, sonst wirkt der Primärbutton auf Desktop überdimensioniert.
 */

.bsm-as-modal__actions {
	display: flex;
	gap: 12px;
	justify-content: flex-end;
	flex-wrap: wrap;
	align-items: center;
}

.bsm-as-modal__actions .button,
.bsm-as-modal__actions button {
	min-height: 0;
	padding: 9px 18px;
	font-size: 12px;
	line-height: 1.3;
	cursor: pointer;
	border-radius: 0;
	border: 1px solid #1a1a1a;
	background: #ffffff;
	color: #1a1a1a;
	font-weight: 400;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	transition: background 0.15s ease, color 0.15s ease;
}

.bsm-as-modal__actions .button:hover,
.bsm-as-modal__actions button:hover {
	background: #f2f2f2;
}

.bsm-as-modal__actions .button.button-primary,
.bsm-as-modal__actions button.button-primary {
	background: #1a1a1a;
	color: #ffffff;
	border-color: #1a1a1a;
}

.bsm-as-modal__actions .button.button-primary:hover,
.bsm-as-modal__actions button.button-primary:hover {
	background: #000;
	border-color: #000;
	color: #ffffff;
}

.bsm-as-modal__actions button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ---- Mini-Cart-Zusatzinfo ---- */

.bsm-as-mini-cart-info {
	display: block;
	font-size: 12px;
	color: #555;
	margin-top: 2px;
}

/* ---- Mobile ---- */

@media ( max-width: 540px ) {
	.bsm-as-modal__dialog {
		padding: 24px 20px 20px;
		max-height: calc( 100vh - 32px );
		width: calc( 100% - 24px );
		border-radius: 0;
	}

	.bsm-as-modal__title {
		font-size: 20px;
	}

	.bsm-as-modal__actions {
		flex-direction: column-reverse;
	}

	.bsm-as-modal__actions .button,
	.bsm-as-modal__actions button {
		width: 100%;
	}
}
