/* Favourite button (icon-only toggle) */

.mds-favourite-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--mds-spacing-xs);
  border: none;
  border-radius: var(--mds-border-radius-pill);
  background-color: var(--mds-bg-surface-default);
  color: var(--mds-text-subtle);
  cursor: pointer;
  transition:
    background-color 0.15s ease-in-out,
    color 0.15s ease-in-out;
}

.mds-favourite-button__icon {
  display: block;
  inline-size: var(--mds-icons-xs);
  block-size: var(--mds-icons-xs);
  background-color: currentColor;
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M6.17227%200C6.40664%200%206.59414%200.140625%206.68789%200.328125L8.30508%203.63281L11.891%204.17188C12.102%204.19531%2012.266%204.33594%2012.3363%204.54688C12.4066%204.75781%2012.3598%204.96875%2012.1957%205.13281L9.59414%207.71094L10.2035%2011.3438C10.2504%2011.5547%2010.1566%2011.7891%209.99258%2011.9062C9.80508%2012.0234%209.5707%2012.0469%209.3832%2011.9531L6.17227%2010.2188L2.98477%2011.9531C2.77383%2012.0469%202.56289%2012.0234%202.37539%2011.9062C2.21133%2011.7656%202.11758%2011.5547%202.16445%2011.3438L2.77383%207.71094L0.172266%205.13281C0.00820312%204.96875%20-0.0386719%204.75781%200.0316406%204.54688C0.101953%204.35938%200.266016%204.19531%200.476953%204.17188L4.06289%203.63281L5.68008%200.328125C5.77383%200.140625%205.96133%200%206.17227%200ZM6.17227%201.85156L4.95352%204.40625C4.85977%204.57031%204.71914%204.6875%204.53164%204.71094L1.76602%205.10938L3.7582%207.10156C3.89883%207.24219%203.96914%207.42969%203.92227%207.59375L3.45352%2010.4062L5.91445%209.09375C6.07852%209%206.28945%209%206.45352%209.09375L8.91445%2010.4062L8.4457%207.61719C8.39883%207.42969%208.46914%207.24219%208.60977%207.125L10.602%205.10938L7.83633%204.71094C7.64883%204.6875%207.5082%204.57031%207.41445%204.40625L6.17227%201.85156Z%22%20fill%3D%22%231D2125%22%2F%3E%20%3C%2Fsvg%3E');
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M6.17227%200C6.40664%200%206.59414%200.140625%206.68789%200.328125L8.30508%203.63281L11.891%204.17188C12.102%204.19531%2012.266%204.33594%2012.3363%204.54688C12.4066%204.75781%2012.3598%204.96875%2012.1957%205.13281L9.59414%207.71094L10.2035%2011.3438C10.2504%2011.5547%2010.1566%2011.7891%209.99258%2011.9062C9.80508%2012.0234%209.5707%2012.0469%209.3832%2011.9531L6.17227%2010.2188L2.98477%2011.9531C2.77383%2012.0469%202.56289%2012.0234%202.37539%2011.9062C2.21133%2011.7656%202.11758%2011.5547%202.16445%2011.3438L2.77383%207.71094L0.172266%205.13281C0.00820312%204.96875%20-0.0386719%204.75781%200.0316406%204.54688C0.101953%204.35938%200.266016%204.19531%200.476953%204.17188L4.06289%203.63281L5.68008%200.328125C5.77383%200.140625%205.96133%200%206.17227%200ZM6.17227%201.85156L4.95352%204.40625C4.85977%204.57031%204.71914%204.6875%204.53164%204.71094L1.76602%205.10938L3.7582%207.10156C3.89883%207.24219%203.96914%207.42969%203.92227%207.59375L3.45352%2010.4062L5.91445%209.09375C6.07852%209%206.28945%209%206.45352%209.09375L8.91445%2010.4062L8.4457%207.61719C8.39883%207.42969%208.46914%207.24219%208.60977%207.125L10.602%205.10938L7.83633%204.71094C7.64883%204.6875%207.5082%204.57031%207.41445%204.40625L6.17227%201.85156Z%22%20fill%3D%22%231D2125%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

.mds-favourite-button--selected .mds-favourite-button__icon {
  mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M6.84706%200.421875L8.3705%203.53906L11.7221%204.03125C12.0033%204.07812%2012.2377%204.26562%2012.3314%204.54688C12.4252%204.80469%2012.3549%205.10938%2012.1439%205.29688L9.70643%207.71094L10.2924%2011.1328C10.3392%2011.4141%2010.2221%2011.6953%209.98768%2011.8594C9.75331%2012.0469%209.44862%2012.0469%209.19081%2011.9297L6.19081%2010.3125L3.16737%2011.9297C2.933%2012.0469%202.62831%2012.0469%202.39393%2011.8594C2.15956%2011.6953%202.04237%2011.4141%202.08925%2011.1328L2.65175%207.71094L0.214245%205.29688C0.0267453%205.10938%20-0.0435672%204.80469%200.0267453%204.54688C0.120495%204.26562%200.35487%204.07812%200.63612%204.03125L4.01112%203.53906L5.51112%200.421875C5.62831%200.164062%205.88612%200%206.19081%200C6.47206%200%206.72987%200.164062%206.84706%200.421875Z%22%20fill%3D%22%230F6CBF%22%2F%3E%20%3C%2Fsvg%3E');
  -webkit-mask-image: url('data:image/svg+xml,%3Csvg%20width%3D%2213%22%20height%3D%2213%22%20viewBox%3D%220%200%2013%2013%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cpath%20d%3D%22M6.84706%200.421875L8.3705%203.53906L11.7221%204.03125C12.0033%204.07812%2012.2377%204.26562%2012.3314%204.54688C12.4252%204.80469%2012.3549%205.10938%2012.1439%205.29688L9.70643%207.71094L10.2924%2011.1328C10.3392%2011.4141%2010.2221%2011.6953%209.98768%2011.8594C9.75331%2012.0469%209.44862%2012.0469%209.19081%2011.9297L6.19081%2010.3125L3.16737%2011.9297C2.933%2012.0469%202.62831%2012.0469%202.39393%2011.8594C2.15956%2011.6953%202.04237%2011.4141%202.08925%2011.1328L2.65175%207.71094L0.214245%205.29688C0.0267453%205.10938%20-0.0435672%204.80469%200.0267453%204.54688C0.120495%204.26562%200.35487%204.07812%200.63612%204.03125L4.01112%203.53906L5.51112%200.421875C5.62831%200.164062%205.88612%200%206.19081%200C6.47206%200%206.72987%200.164062%206.84706%200.421875Z%22%20fill%3D%22%230F6CBF%22%2F%3E%20%3C%2Fsvg%3E');
}

/* Unselected states */
.mds-favourite-button:hover:not(:disabled) {
  background-color: var(--mds-bg-surface-subtle);
  color: var(--mds-text-subtle);
}

.mds-favourite-button:active:not(:disabled) {
  background-color: var(--mds-bg-surface-strong);
  color: var(--mds-text-subtle);
}

/* Selected states */
.mds-favourite-button--selected {
  background-color: var(--mds-bg-surface-default);
  color: var(--mds-text-link-primary-default);
}

.mds-favourite-button--selected:hover:not(:disabled) {
  background-color: var(--mds-bg-surface-subtle);
  color: var(--mds-text-link-primary-hover);
}

.mds-favourite-button--selected:active:not(:disabled) {
  background-color: var(--mds-bg-surface-strong);
  color: var(--mds-text-link-primary-default);
}

/* Disabled states */
.mds-favourite-button:disabled {
  background-color: var(--mds-bg-surface-default);
  color: var(--mds-text-muted);
  cursor: not-allowed;
}

.mds-favourite-button--selected:disabled {
  color: var(--mds-text-link-primary-disabled);
}

/* Focus ring */
.mds-favourite-button:focus {
  box-shadow: none;
  outline: none;
}

.mds-favourite-button:focus-visible {
  box-shadow: none;
  outline: var(--mds-stroke-weight-md) solid var(--mds-focus-default);
  outline-offset: 0;
}
