{#
  Button. Params: label (translated text), variant: merchant | primary | secondary | ghost | danger,
  size: sm | md | lg, type, icon (icon name, leading), class, attrs (raw Alpine/HTML attributes),
  full (bool → w-full), tag ('a' for links, pass href in attrs).

  Only these params: an include inherits the caller's context, so anything read
  here that a caller happens to have in scope leaks in. `content` used to be
  echoed and picked up the Google shortcode's array of reviews, which warned
  "Array to string conversion" on every render.
#}
{% set variants = {
  merchant: 'rvx-bg-merchant rvx-text-merchant-fg hover:rvx-bg-merchant-hover rvx-shadow-xs',
  primary: 'rvx-bg-brand rvx-text-brand-fg hover:rvx-bg-brand-hover rvx-shadow-xs',
  secondary: 'rvx-bg-surface rvx-text-fg rvx-border rvx-border-line-strong hover:rvx-bg-surface-sunken hover:rvx-border-fg-subtle',
  ghost: 'rvx-bg-transparent rvx-text-fg-muted hover:rvx-bg-surface-sunken hover:rvx-text-fg',
  danger: 'rvx-bg-danger rvx-text-fg-inverse hover:rvx-opacity-90',
} %}
{% set sizes = { sm: 'rvx-h-control-sm rvx-px-space12 rvx-text-sm rvx-gap-[6px]', md: 'rvx-h-control-md rvx-px-space16 rvx-text-base rvx-gap-space8', lg: 'rvx-h-control-lg rvx-px-space20 rvx-text-md rvx-gap-space8' } %}
{% set tag = tag|default('button') %}
<{{ tag }}{% if tag == 'button' %} type="{{ type|default('button') }}"{% endif %}
  class="rvx-inline-flex rvx-items-center rvx-justify-center rvx-whitespace-nowrap rvx-no-underline hover:rvx-no-underline rvx-rounded-control rvx-font-semibold rvx-leading-none rvx-transition rvx-duration-fast rvx-ease-standard disabled:rvx-opacity-60 disabled:rvx-cursor-not-allowed {{ variants[variant|default('secondary')] }} {{ sizes[size|default('md')] }}{% if full|default(false) %} rvx-w-full{% endif %} {{ class|default('') }}"
  {% if attrs is defined %}{{ attrs|raw }}{% endif %}>
  {% if icon is defined and icon %}{% include 'storefront/ui/icon.twig' with { name: icon, size: 18, mirror: icon_mirror|default(false) } %}{% endif %}
  {% if label is defined %}<span>{{ label }}</span>{% endif %}
</{{ tag }}>
