/*
 * Penguin Shoe Polish Blocks — button styling.
 *
 * Reproduces the legacy site's .btn / .btn-primary / .btn-ghost / .btn-light /
 * .chip / .arrow-link treatments on core/button (see legacy-site/*.html
 * <style> blocks and inline styles). Registered style variations live in
 * includes/block-styles.php; icon modifiers are plain classNames:
 *   .penguin-icon-arrow  — trailing arrow (→), shifts right on hover
 *   .penguin-icon-phone  — leading handset icon
 *   .penguin-pill        — 44px pill (products page filters)
 *   .penguin-btn-sm      — 48px / 14px button (custom-order box)
 *   .penguin-btn-dark    — #0F0F0F background (red CTA band)
 *   .penguin-btn-outline-white — 1.5px white border (red CTA band)
 *   .penguin-arrow-sm    — 14px arrow-link with 16px arrow
 * Enqueued on both the front end and the block editor.
 */

:root {
	--penguin-icon-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
	--penguin-icon-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h4l2 5-2.5 1.5a11 11 0 0 0 6 6L16 13l5 2v4a2 2 0 0 1-2 2A17 17 0 0 1 3 5a2 2 0 0 1 2-2z'/%3E%3C/svg%3E");
}

/* Base: legacy .btn / .btn-primary */
.wp-block-button .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 52px;
	padding: 0 24px;
	border: 0;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	box-sizing: border-box;
	transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

/* Legacy buttons were content-box <a>s with 0 vertical padding, so the
   bordered variants (ghost / outline: 1.5px, chip: 1px) stand taller than
   solid ones by their border. Reproduce those exact box heights. */
.wp-block-button.is-style-ghost .wp-block-button__link,
.wp-block-button.penguin-btn-outline-white .wp-block-button__link {
	height: 55px;
}

.penguin-header .wp-block-button.is-style-ghost .wp-block-button__link {
	height: 51px;
}

.wp-block-button.is-style-ghost.penguin-pill .wp-block-button__link {
	height: 47px;
}

.wp-block-button .wp-block-button__link:hover {
	transform: translateY(-2px);
}

/* Primary (default) hover glow — only for solid accent buttons. */
.wp-block-button:not([class*="is-style-"]):not(.penguin-btn-dark):not(.penguin-btn-outline-white) .wp-block-button__link:hover {
	filter: brightness(1.1);
	box-shadow: 0 12px 28px rgba(224, 32, 32, 0.38);
}

/* Icon modifiers (mask-image so they inherit currentColor exactly like the
   legacy inline <svg stroke="currentColor">). */
.penguin-icon-arrow .wp-block-button__link::after,
.penguin-icon-phone .wp-block-button__link::before {
	content: "";
	display: inline-block;
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	background-color: currentColor;
	-webkit-mask: var(--penguin-icon-arrow) no-repeat center / contain;
	mask: var(--penguin-icon-arrow) no-repeat center / contain;
	transition: transform 0.2s ease;
}

.penguin-icon-phone .wp-block-button__link::before {
	-webkit-mask-image: var(--penguin-icon-phone);
	mask-image: var(--penguin-icon-phone);
}

.penguin-icon-arrow .wp-block-button__link:hover::after {
	transform: translateX(3px);
}

/* Ghost — legacy .btn-ghost */
.wp-block-button.is-style-ghost .wp-block-button__link {
	background: transparent;
	color: #FFFFFF;
	border: 1.5px solid #3A3A3A;
}

.wp-block-button.is-style-ghost .wp-block-button__link:hover,
.wp-block-button.is-style-ghost .wp-block-button__link:focus {
	background: transparent;
	color: #FFFFFF;
	border-color: #FFFFFF;
}

/* Light — legacy .btn-light */
.wp-block-button.is-style-light .wp-block-button__link {
	background: #FFFFFF;
	color: #0F0F0F;
}

.wp-block-button.is-style-light .wp-block-button__link:hover,
.wp-block-button.is-style-light .wp-block-button__link:focus {
	background: #FFFFFF;
	color: #0F0F0F;
	box-shadow: 0 12px 28px rgba(255, 255, 255, 0.18);
}

/* Dark + outline-white — the two buttons in the red CTA bands */
.wp-block-button.penguin-btn-dark .wp-block-button__link {
	background: #0F0F0F;
	color: #FFFFFF;
}

.wp-block-button.penguin-btn-outline-white .wp-block-button__link {
	background: transparent;
	color: #FFFFFF;
	border: 1.5px solid #FFFFFF;
}

/* Chip — legacy .chip */
.wp-block-button.is-style-chip .wp-block-button__link {
	height: 38px;
	padding: 0 16px;
	border-radius: 999px;
	background: #2A2A2A;
	border: 1px solid #3A3A3A;
	font-size: 14px;
	font-weight: 600;
	color: #FFFFFF;
}

.wp-block-button.is-style-chip .wp-block-button__link:hover,
.wp-block-button.is-style-chip .wp-block-button__link:focus {
	border-color: #FFFFFF;
	color: #FFFFFF;
}

/* Pill filters on the products page (44px, 14px, fully rounded) */
.wp-block-button.penguin-pill .wp-block-button__link {
	height: 44px;
	padding: 0 18px;
	border-radius: 999px;
	font-size: 14px;
}

/* Small button (custom-order box): 48px / 14px / 16px arrow */
.wp-block-button.penguin-btn-sm .wp-block-button__link {
	height: 48px;
	padding: 0 20px;
	font-size: 14px;
}

.wp-block-button.penguin-btn-sm .wp-block-button__link::after {
	width: 16px;
	height: 16px;
}

/* Arrow link — legacy .arrow-link (text + accent-light arrow, no background) */
.wp-block-button.is-style-arrow-link .wp-block-button__link {
	height: auto;
	padding: 0;
	gap: 8px;
	background: transparent;
	border: 0;
	border-radius: 0;
	color: #FFFFFF;
	font-size: 15px;
	font-weight: 700;
}

.wp-block-button.is-style-arrow-link .wp-block-button__link::after {
	content: "";
	display: inline-block;
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	background-color: #E85858;
	-webkit-mask: var(--penguin-icon-arrow) no-repeat center / contain;
	mask: var(--penguin-icon-arrow) no-repeat center / contain;
	transition: transform 0.2s ease;
}

.wp-block-button.is-style-arrow-link .wp-block-button__link:hover,
.wp-block-button.is-style-arrow-link .wp-block-button__link:focus {
	transform: none;
	background: transparent;
	color: #FFFFFF;
	filter: none;
	box-shadow: none;
}

.wp-block-button.is-style-arrow-link .wp-block-button__link:hover::after {
	transform: translateX(4px);
}

.wp-block-button.is-style-arrow-link.penguin-arrow-sm .wp-block-button__link {
	font-size: 14px;
}

.wp-block-button.is-style-arrow-link.penguin-arrow-sm .wp-block-button__link::after {
	width: 16px;
	height: 16px;
}

/*
 * Product grid "added to your quote" toast (created by
 * build/product-grid/view.js). Sits centred just above the fixed
 * .penguin-quote-bar (bottom: 24px / 16px on mobile, ~68px tall — see
 * build/product-grid/style-index.css) so both stay visible.
 */
.penguin-quote-toast {
	position: fixed;
	left: 50%;
	bottom: 104px;
	z-index: 91;
	box-sizing: border-box;
	max-width: min(420px, calc(100% - 32px));
	padding: 12px 18px;
	border: 1px solid var(--wp--preset--color--line, #2C2C2C);
	border-left: 3px solid #8fe3a6;
	border-radius: 12px;
	background: var(--wp--preset--color--raised, #171717);
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
	color: var(--wp--preset--color--white, #FFFFFF);
	font-family: var(--wp--preset--font-family--manrope, "Manrope", "Inter", system-ui, sans-serif);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	overflow-wrap: anywhere;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 10px);
	transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0.25s;
}

.penguin-quote-toast.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
	transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s;
}

.penguin-quote-toast:empty {
	display: none;
}

@media (max-width: 600px) {
	.penguin-quote-toast {
		bottom: 94px;
		width: calc(100% - 32px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.penguin-quote-toast,
	.penguin-quote-toast.is-visible {
		transform: translate(-50%, 0);
		transition: none;
	}
}
