/*
 * BITERO navbar mini-cart (Task 8) — scoped to #bitero-mini-cart only.
 *
 * The navbar icon, its badge and its position are NOT restyled here; the
 * theme's own .shop-icon rules stay in charge. This file only styles the
 * dropdown panel that mini-cart.js appends to <body>. Colors/typography
 * reuse the theme's variables (--theme #FFC222, --theme2 green, --theme3,
 * --header) and its existing .theme-btn/.small-btn button class.
 *
 * z-index: the header is capped at 1000 by the site's Additional CSS
 * (.ehf-header #masthead { z-index: 1000 }); 1010 sits above it and below
 * Magnific Popup (1042) / the WP admin bar (99999).
 *
 * Responsive repair (2026-11-16): foodis-core's main-style.css declares
 * `ul { padding: 0 !important }`, which beats any specificity and zeroed
 * the list's 18px side padding, so rows ran to the panel's clipping edge
 * (line totals / Remove cut off, thumbnail flush left). The horizontal
 * padding now lives on each row (<li>), which that reset does not touch.
 */
#bitero-mini-cart,
#bitero-mini-cart * {
	box-sizing: border-box;
}

#bitero-mini-cart {
	position: fixed; /* top/right are set by mini-cart.js from the cart icon's bounding box (CL-CORR-010) */
	z-index: 1010;
	width: 400px;
	max-width: calc(100vw - 24px);
	max-height: calc(100vh - 120px);
	display: flex;
	flex-direction: column;
	background: #fff;
	color: var(--header);
	border-radius: 14px;
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
	font-family: inherit;
	overflow: hidden;
}
#bitero-mini-cart[hidden] {
	display: none;
}

#bitero-mini-cart .bitero-mini-cart__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px 12px;
	border-bottom: 1.5px dashed rgba(30, 29, 35, 0.15);
	flex: 0 0 auto;
}
#bitero-mini-cart .bitero-mini-cart__title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--header);
}
#bitero-mini-cart .bitero-mini-cart__close {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: rgba(30, 29, 35, 0.06);
	color: var(--header);
	font-size: 22px;
	line-height: 36px;
	padding: 0;
	cursor: pointer;
}
#bitero-mini-cart .bitero-mini-cart__close:hover {
	background: var(--theme);
}

#bitero-mini-cart .bitero-mini-cart__status {
	min-height: 0;
	padding: 0 18px;
	font-size: 13px;
	font-weight: 600;
	flex: 0 0 auto;
}
#bitero-mini-cart .bitero-mini-cart__status:not(:empty) {
	padding-top: 8px;
}
#bitero-mini-cart .bitero-mini-cart__status.is-busy {
	color: rgba(30, 29, 35, 0.55);
}
#bitero-mini-cart .bitero-mini-cart__status.is-error {
	color: var(--theme3);
}

#bitero-mini-cart .bitero-mini-cart__empty {
	padding: 28px 18px 24px;
	text-align: center;
}
#bitero-mini-cart .bitero-mini-cart__empty p {
	margin: 0 0 14px;
	font-size: 15px;
}

/* The theme forces `ul { padding: 0 !important }`; keep the list itself
   padding-free and put the side padding on each row instead. */
#bitero-mini-cart .bitero-mini-cart__list {
	list-style: none;
	margin: 0;
	padding: 6px 0;
	overflow-y: auto;
	overflow-x: hidden;
	flex: 1 1 auto;
	min-height: 0;
}
#bitero-mini-cart .bitero-mini-cart__item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 18px;
	margin: 0;
	border-bottom: 1px solid rgba(30, 29, 35, 0.08);
	transition: opacity 0.2s;
}
#bitero-mini-cart .bitero-mini-cart__item:last-child {
	border-bottom: none;
}
#bitero-mini-cart .bitero-mini-cart__item.is-busy {
	opacity: 0.55;
}
#bitero-mini-cart .bitero-mini-cart__thumb {
	flex: 0 0 56px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	overflow: hidden;
	background: rgba(30, 29, 35, 0.04);
}
#bitero-mini-cart .bitero-mini-cart__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
#bitero-mini-cart .bitero-mini-cart__body {
	flex: 1 1 auto;
	min-width: 0;
}
#bitero-mini-cart .bitero-mini-cart__name {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 700;
	color: var(--header);
	line-height: 1.3;
	overflow-wrap: anywhere;
}
#bitero-mini-cart .bitero-mini-cart__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 4px 10px;
	font-size: 13px;
	margin-bottom: 8px;
}
#bitero-mini-cart .bitero-mini-cart__unit {
	color: rgba(30, 29, 35, 0.6);
	white-space: nowrap;
}
#bitero-mini-cart .bitero-mini-cart__line-total {
	color: var(--theme2);
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
	flex: 0 0 auto;
}
#bitero-mini-cart .bitero-mini-cart__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 10px;
}
#bitero-mini-cart .bitero-mini-cart__qty {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	border: 1.5px dashed rgba(30, 29, 35, 0.2);
	border-radius: 8px;
	overflow: hidden;
}
#bitero-mini-cart .bitero-mini-cart__qty-btn {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	line-height: 36px;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--header);
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}
#bitero-mini-cart .bitero-mini-cart__qty-btn:hover:not(:disabled) {
	background: var(--theme);
}
#bitero-mini-cart .bitero-mini-cart__qty-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}
#bitero-mini-cart .bitero-mini-cart__qty-value {
	flex: 0 0 auto;
	min-width: 34px;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	border-left: 1.5px dashed rgba(30, 29, 35, 0.2);
	border-right: 1.5px dashed rgba(30, 29, 35, 0.2);
	line-height: 36px;
}
#bitero-mini-cart .bitero-mini-cart__remove {
	flex: 0 0 auto;
	border: none;
	background: transparent;
	color: var(--theme3);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	padding: 8px 0;
	white-space: nowrap;
	text-decoration: underline;
	text-underline-offset: 2px;
}
#bitero-mini-cart .bitero-mini-cart__remove:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

#bitero-mini-cart .bitero-mini-cart__footer {
	padding: 12px 18px 18px;
	border-top: 1.5px dashed rgba(30, 29, 35, 0.15);
	background: #fff;
	flex: 0 0 auto;
}
#bitero-mini-cart .bitero-mini-cart__subtotal {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	font-size: 15px;
	margin-bottom: 12px;
}
#bitero-mini-cart .bitero-mini-cart__subtotal-value {
	color: var(--theme2);
	font-size: 18px;
	font-weight: 700;
	white-space: nowrap;
}
#bitero-mini-cart .bitero-mini-cart__actions {
	display: flex;
	gap: 10px;
}
#bitero-mini-cart .bitero-mini-cart__actions .theme-btn {
	flex: 1 1 0;
	min-width: 0;
	text-align: center;
	white-space: nowrap;
}
#bitero-mini-cart .bitero-mini-cart__order {
	background-color: var(--theme2);
	border-color: var(--theme2);
	color: #fff;
}

/* Keyboard focus stays visible inside the dialog. */
#bitero-mini-cart button:focus-visible,
#bitero-mini-cart a:focus-visible {
	outline: 3px solid var(--theme2);
	outline-offset: 2px;
}

@media (max-width: 575px) {
	#bitero-mini-cart {
width: calc(100vw - 24px);
		border-radius: 12px;
	}
	#bitero-mini-cart .bitero-mini-cart__actions {
		flex-direction: column;
	}
	/* In the column layout a 0 flex-basis would collapse the buttons to
	   0 height (found in the 390/360px test); size them by content. */
	#bitero-mini-cart .bitero-mini-cart__actions .theme-btn {
		flex: 0 0 auto;
		width: 100%;
	}
}

/* Very narrow phones (<= 399px): a little less chrome so rows breathe. */
@media (max-width: 399px) {
	#bitero-mini-cart {
		width: calc(100vw - 16px);
max-width: calc(100vw - 16px);
	}
	#bitero-mini-cart .bitero-mini-cart__head,
	#bitero-mini-cart .bitero-mini-cart__footer {
		padding-left: 14px;
		padding-right: 14px;
	}
	#bitero-mini-cart .bitero-mini-cart__status {
		padding-left: 14px;
		padding-right: 14px;
	}
	#bitero-mini-cart .bitero-mini-cart__item {
		padding: 12px 14px;
		gap: 10px;
	}
	#bitero-mini-cart .bitero-mini-cart__thumb {
		flex-basis: 48px;
		width: 48px;
		height: 48px;
	}
}

/*
 * Tablet gap (pre-existing theme behavior, found in the Task 8 1024px test):
 * the Foodis header's desktop strip (.header-middle-sec, which holds the
 * desktop cart icon) is `d-none d-xl-block` (visible >= 1200px) while the
 * sticky bar's cart icon is `d-lg-none` (visible < 992px), so between 992
 * and 1199px NO cart icon is rendered at all. This one scoped rule shows
 * the theme's own sticky-bar icon in that band so the cart stays reachable.
 * Nothing else in the header is touched. Revert = delete this block.
 */
@media (min-width: 992px) and (max-width: 1199.98px) {
	.header-1 .header-right a.shop-icon.shop-cart-mobile {
		display: inline-block !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	#bitero-mini-cart .bitero-mini-cart__item {
		transition: none;
	}
}

/* Final UX correction: equal, readable action buttons (the theme's 30px side padding clipped "Warenkorb ansehen"). */
#bitero-mini-cart .bitero-mini-cart__actions { gap: 10px; align-items: stretch; }
#bitero-mini-cart .bitero-mini-cart__actions .theme-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 50px;
	padding: 0 12px;
	font-size: 15px;
	line-height: 1.1;
	text-align: center;
}
@media (max-width: 575px) {
	#bitero-mini-cart .bitero-mini-cart__actions .theme-btn { flex: 0 0 50px; width: 100%; }
}
#bitero-mini-cart .bitero-mini-cart__meta,
#bitero-mini-cart .bitero-mini-cart__controls { align-items: center; }
