/**
 * Mini Quote Icon — theme-compatible, self-contained styles.
 *
 * Architecture mirrors WooCommerce Mini-Cart: the badge is positioned
 * absolutely relative to .wt-mini-quote__quantity-badge (position: relative),
 * so alignment never depends on the active theme's header layout.
 *
 * CSS custom properties for safe overrides:
 *   --wt-mini-quote-icon-color
 *   --wt-mini-quote-icon-size
 *   --wt-mini-quote-badge-background
 *   --wt-mini-quote-badge-color
 *   --wt-mini-quote-badge-size
 *
 * @package Wt_Woo_Request_Quote
 * @since   1.5.0
 */

/* ------------------------------------------------------------------ */
/*  Wrapper                                                           */
/* ------------------------------------------------------------------ */
.wt-mini-quote {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	flex: 0 0 auto;
	line-height: 1;
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ */
/*  Button / link — full reset so theme rules cannot break layout     */
/* ------------------------------------------------------------------ */
.wt-mini-quote__button {
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	color: var(--wt-mini-quote-icon-color, currentColor);
	font: inherit;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	text-decoration: none;
	box-shadow: none;
	outline-offset: 2px;
	min-width: 44px;
	min-height: 44px;
	box-sizing: border-box;
	position: relative;
}

.wt-mini-quote__button:hover,
.wt-mini-quote__button:focus,
.wt-mini-quote__button:active {
	color: var(--wt-mini-quote-icon-color, currentColor);
	text-decoration: none;
	background: transparent;
	box-shadow: none;
}

/* ------------------------------------------------------------------ */
/*  Quantity-badge wrapper — the positioning anchor                   */
/* ------------------------------------------------------------------ */
.wt-mini-quote__quantity-badge {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

/* ------------------------------------------------------------------ */
/*  SVG icon                                                          */
/* ------------------------------------------------------------------ */
.wt-mini-quote__icon {
	display: block;
	width: var(--wt-mini-quote-icon-size, 32px);
	height: var(--wt-mini-quote-icon-size, 32px);
	fill: none;
	stroke: currentColor;
	flex-shrink: 0;
	pointer-events: none;
	box-sizing: border-box;
	/* Prevent themes from overriding SVG dimensions via generic rules */
	max-width: none;
	max-height: none;
}

/* ------------------------------------------------------------------ */
/*  Count badge                                                       */
/* ------------------------------------------------------------------ */
.wt-mini-quote__badge {
	position: absolute;
	top: 0;
	/* Use inset-inline-end for RTL; fallback to right for older browsers */
	right: 0;
	inset-inline-end: 0;
	transform: translate(35%, -25%);
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: var(--wt-mini-quote-badge-size, 18px);
	height: var(--wt-mini-quote-badge-size, 18px);
	padding-inline: 5px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	background: var(--wt-mini-quote-badge-background, #111);
	color: var(--wt-mini-quote-badge-color, #fff);
	box-sizing: border-box;
	white-space: nowrap;
	pointer-events: none;
	/* Prevent themes from inheriting unwanted text styles */
	text-transform: none;
	letter-spacing: 0;
	text-decoration: none;
}

/* RTL: flip the badge transform direction */
[dir="rtl"] .wt-mini-quote__badge {
	transform: translate(-35%, -25%);
}

/* ------------------------------------------------------------------ */
/*  Mini quote hover dropdown on the quote icon                       */
/* ------------------------------------------------------------------ */
.wt-mini-quote.wtwraq-mini-quote-list {
	position: relative;
}

.wt-mini-quote .wtwraq-mini-quote-list-div {
	position: absolute !important;
	top: 100%;
	left: 0;
	z-index: 9999;
	width: 0;
	height: 0;
	overflow: visible;
}

/* JS dynamically positions the content; these are safe defaults */
.wt-mini-quote .wtwraq-mini-quote-list-div .wtwraq-mini-quote-list-content,
.wt-mini-quote .wtwraq-mini-quote-list-div .wtwraq-mini-quote-list-empty {
	/* position: absolute is already set by the main plugin CSS */
	top: 0;
}

/* Stabilise the View Quote button inside the mini quote dropdown —
   prevent ANY theme hover styles from shifting layout.
   Applied globally (not just inside .wt-mini-quote) because the
   dropdown also appears on the nav menu item. */
.wtwraq-mini-quote-list-content .wtwraq-mini-quote-button,
.wtwraq-mini-quote-list-content .wtwraq-mini-quote-button:hover,
.wtwraq-mini-quote-list-content .wtwraq-mini-quote-button:focus,
.wtwraq-mini-quote-list-content .wtwraq-mini-quote-button:active,
.wtwraq-mini-quote-list-content .wtwraq-mini-quote-button:visited {
	transform: none !important;
	border: none !important;
	border-bottom: none !important;
	box-shadow: none !important;
	outline-offset: 2px;
	margin: 10px auto 0 auto !important;
	padding: 0 15px !important;
	height: 40px !important;
	line-height: 40px !important;
	min-height: 40px !important;
	max-height: 40px !important;
	width: 100% !important;
	box-sizing: border-box !important;
	text-decoration: none !important;
	letter-spacing: normal !important;
}

/* ------------------------------------------------------------------ */
/*  Fallback placement — when no cart found, float to the right       */
/* ------------------------------------------------------------------ */
.wt-mini-quote--header-fallback {
	margin-inline-start: auto;
	float: right;
}

/* ------------------------------------------------------------------ */
/*  Theme icon containers — inherit the theme's icon sizing           */
/* ------------------------------------------------------------------ */

/* Martfury: .extras-menu icons are 30px */
.extras-menu .wt-mini-quote .wt-mini-quote__icon {
	width: 30px;
	height: 30px;
}

.extras-menu .wt-mini-quote .wt-mini-quote__button {
	min-width: 30px;
	min-height: 30px;
}

/* General: when inside a UL icon list, reduce min tap target to match siblings */
ul > .wt-mini-quote-menu-item .wt-mini-quote__button {
	min-width: unset;
	min-height: unset;
}

/* ------------------------------------------------------------------ */
/*  Nav menu integration (classic themes)                             */
/* ------------------------------------------------------------------ */
.wt-mini-quote-menu-item {
	display: inline-flex !important;
	align-items: center;
	list-style: none;
}

/* Prevent themes from adding unwanted padding/bullets */
.wt-mini-quote-menu-item > .wt-mini-quote {
	margin: 0;
	padding: 0;
}

/* ------------------------------------------------------------------ */
/*  Gutenberg block alignment helpers                                 */
/* ------------------------------------------------------------------ */
.wp-block-webtoffee-mini-quote {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
}

/* When the Mini Quote sits as a sibling in a flex/list container */
ul > .wt-mini-quote,
li > .wt-mini-quote {
	list-style: none;
}

/* ------------------------------------------------------------------ */
/*  Responsive — ensure the component never overflows on small screens */
/* ------------------------------------------------------------------ */
@media (max-width: 480px) {
	.wt-mini-quote__icon {
		width: var(--wt-mini-quote-icon-size, 28px);
		height: var(--wt-mini-quote-icon-size, 28px);
	}
}
