/**
 * GlassOn try-on buttons.
 *
 * These render inside arbitrary themes, so the rules are scoped tightly to
 * `.glasson-*` and set every property they depend on rather than inheriting.
 * Colours come from inline styles the merchant configures, so they are not set
 * here — only layout, spacing and states.
 */

.glasson-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 12px 0;
	clear: both;
}

.glasson-wrap[hidden] {
	display: none !important;
}

.glasson-wrap--full .glasson-btn {
	flex: 1 1 auto;
}

.glasson-wrap--catalog {
	margin: 8px 0 0;
}

.glasson-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 16px;
	border: 1px solid currentColor;
	border-radius: 4px;
	background: none;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-transform: none;
	cursor: pointer;
	/* Themes routinely set a global button transition/shadow; neutralise both so
	   the button looks the same everywhere. */
	box-shadow: none;
	transition: opacity 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.glasson-btn:hover,
.glasson-btn:focus-visible {
	opacity: 0.85;
}

.glasson-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.glasson-btn__icon {
	/*
	 * The icons are not square (26x17, 32x18, 26x18). A fixed square box would
	 * letterbox them: the drawing scales down to fit and gains vertical padding.
	 * Fix the height and let the viewBox drive the width instead.
	 */
	height: 18px;
	width: auto;
	flex: 0 0 auto;
}

.glasson-btn__label {
	white-space: nowrap;
}

/* Catalog cards are narrow; drop the label to the icon on very small cards
   rather than letting the button wrap the card layout. */
.glasson-wrap--catalog .glasson-btn {
	padding: 8px 12px;
	font-size: 13px;
}

.glasson-wrap--injected {
	/* Fill a normal parent so the alignment setting has room to work, but never
	   collapse below the buttons' own size: the fallback can land in a container
	   that a theme has laid out to zero width (a block theme's unstyled classic
	   gallery does exactly that), and a zero-width flex container would leave the
	   button visible only by overflowing. */
	width: 100%;
	min-width: max-content;
}

@media (max-width: 480px) {
	.glasson-wrap--catalog .glasson-btn__label {
		display: none;
	}
}
